Not sure what's happened, but it used to be that I could build a lava mining area using the static deco lava tiles (animated or not) and you could mine them. But for some reason, it doesn't seem to work now. Not sure if I need to add something into the FireRockMining.cs or what. When you go to mine an added lava tile, it asks where you want to mine, then does nothing when targeting the tile. I wanted to make some areas that can be mined without mobs crawling up the players backsides constantly. lol Any suggestions?
 

Attachments

  • FireRockMining.cs
    10.5 KB · Views: 4
Looking in Fishing.cs (sounds weird, but there was a reason) I checked the coding for LavaFishing & think that could work for the lava mining in FireRockMining, but I'm not exactly sure how to convert it over. It wouldn't need all of it obviously, but a good portion of it would be.
[doublepost=1486212890][/doublepost]Well, I've been trying to get this to work, but so far it wont compile. This is the current errors. I hope I'm on the right track in getting this to function properly. It used to allow lava mining with added static tiles, but not anymore so I'm hoping the lava fishing coding in Fishing.cs will help.
Code:
--------------------------------------------------------------------------------

ServUO - [http://www.servuo.com] Version 0.5, Build 6230.16629
Publish 54
Core: Optimizing for 6 64-bit processors
RandomImpl: CSPRandom (Software)
Core: Loading config...
Scripts: Compiling C# scripts...Failed with: 1 errors

Errors:
+ CUSTOMS/CRAFTABLES/FireRockCraftVer 3.0 Shazzys/FireRockMining.cs:
    CS0103: Line 270: The name 'HasFirePick' does not exist in the current conte
xt
    CS0118: Line 270: 'Server.Items.FirePick' is a 'type' but is used like a 'va
riable'
    CS0103: Line 323: The name 'HasFirePick' does not exist in the current conte
xt
    CS0118: Line 323: 'Server.Items.FirePick' is a 'type' but is used like a 'va
riable'
    CS0103: Line 326: The name 'GetDefinitionFromTile' does not exist in the cur
rent context
Scripts: One or more scripts failed to compile or no script files were found.
- Press return to exit, or R to try again.
 

Attachments

  • FireRockMining.cs
    14.9 KB · Views: 2
Last edited:
Ok, "slight" progress on this. Redid the FireRockMining.cs (used a copy of Mining.cs), added
Code:
                else if (this.m_System is FireRockMining)
                {
                    if (targeted is StaticTarget)
                    {
                        int itemID = ((StaticTarget)targeted).ItemID;

                    }
                }
into HarvestTarget.cs just after the WitchApprenticeQuest coding.
Added
Code:
        private int[] m_LavaTiles;
and
Code:
        public int[] LavaTiles
        {
            get
            {
                return this.m_LavaTiles;
            }
            set
            {
                this.m_LavaTiles = value;
            }
        }
into HarvestDefinition.cs
What I'm getting now is a crash for "Object reference not set to an instance of an object" and every bit of it is for validating the tiles. Adding the new FireRockMining.cs
 

Attachments

  • FireRockMining.cs
    12.7 KB · Views: 4
Here it is.
Code:
Server Crash Report
===================

RunUO Version 0.5, Build 6230.16629
Operating System: Microsoft Windows NT 6.1.7601 Service Pack 1
.NET Framework: 4.0.30319.42000
Time: 2/7/2017 3:15:40 AM
Mobiles: 7425
Items: 280176
Exception:
System.NullReferenceException: Object reference not set to an instance of an object.
   at Server.Engines.Harvest.HarvestDefinition.Validate(Int32 tileID) in d:\1)January 2017\Scripts\Services\Harvest\HarvestDefinition.cs:line 526
   at Server.Engines.Harvest.HarvestSystem.GetDefinition(Int32 tileID, Item tool) in d:\1)January 2017\Scripts\Services\Harvest\HarvestSystem.cs:line 437
   at Server.Engines.Harvest.HarvestSystem.StartHarvesting(Mobile from, Item tool, Object toHarvest) in d:\1)January 2017\Scripts\Services\Harvest\HarvestSystem.cs:line 476
   at Server.Engines.Harvest.HarvestTarget.OnTarget(Mobile from, Object targeted) in d:\1)January 2017\Scripts\Services\Harvest\HarvestTarget.cs:line 104
   at Server.Targeting.Target.Invoke(Mobile from, Object targeted) in f:\1)January 2017\Server\Targeting\Target.cs:line 269
   at Server.Network.PacketHandlers.TargetResponse(NetState state, PacketReader pvSrc) in f:\1)January 2017\Server\Network\PacketHandlers.cs:line 1323
   at Server.Network.MessagePump.HandleReceive(NetState ns) in f:\1)January 2017\Server\Network\MessagePump.cs:line 187
   at Server.Network.MessagePump.Slice() in f:\1) January 2017\Server\Network\MessagePump.cs:line 121
   at Server.Core.Main(String[] args) in f:\1)January 2017\Server\Main.cs:line 577
 
try to change
Code:
            FireRock.LavaTiles = m_LavaTiles;
to
Code:
            FireRock.Tiles = m_LavaTiles;
 
That's how I had it originally & it literally did nothing. As in dbl click the fire pick, target the tile & nothing happened. Now after the other edits mentioned previously its saying "You cant mine that", so I guess that's an improvement. :D
 
I cant remember why but for a grave robbing extension I did for mining I added 0x3fff to each grave tile. Maybe its the same in your case?
 
HarvestSystem.cs had that to being with.
Code:
        public virtual bool GetHarvestDetails(Mobile from, Item tool, object toHarvest, out int tileID, out Map map, out Point3D loc)
        {
            if (toHarvest is Static && !((Static)toHarvest).Movable)
            {
                Static obj = (Static)toHarvest;

                tileID = (obj.ItemID & 0x3FFF) | 0x4000;
                map = obj.Map;
                loc = obj.GetWorldLocation();
            }
            else if (toHarvest is StaticTarget)
            {
                StaticTarget obj = (StaticTarget)toHarvest;

                tileID = (obj.ItemID & 0x3FFF) | 0x4000;
                map = from.Map;
                loc = obj.Location;
            }
            else if (toHarvest is LandTarget)
            {
                LandTarget obj = (LandTarget)toHarvest;

                tileID = obj.TileID;
                map = from.Map;
                loc = obj.Location;
            }
            else
            {
                tileID = 0;
                map = null;
                loc = Point3D.Zero;
                return false;
            }

            return (map != null && map != Map.Internal);
        }
Not sure where else to add it.
 
I had that basically in the tiles array. For testing, take a value you know the location off or spawn it later and add the 0x3FFF to it.

If I would remember why I did that I could tell you if it is needed or just nonsense :p or rather why
 
Sorry, my mind is a bit frazzled right now from poor sleep & staring at the scripts for what seems like days, even though its only been 3 hours this round. lol Where or how would I add that?
 
Hehe well in your m_LavaTiles to their value, the graverobbing I made used this
Code:
        private static readonly int[] m_GraveTiles = new int[]
        {
           3808+0x3fff, 3809+0x3fff, 3810+0x3fff, 3811+0x3fff
        };
 
Guess I will look into it tomorrow properly and test it myself unless you find why you cant mine it
 
Ok took a look and I finally remember why I neded the +3FFF on the tile value ;)

So LandTarget objects are just the id but Static or StaticTarget get the additional value to it.
It has to be since the LandTiles go up to said value, why not a condition for it to see if it is Static and so on? not sure :)

Anyway, now to fix your problem:
- Starting from 0x12EE every value in your list needs the additional 0x3FFF added to it (can also be just like "0x12EE + 0x3FFF, ....." that way you can also read the tileid you need for adding or to check.
- The ValidateLavaTile method is never used so you can remove it.
- Your code in HarvestTarget too doesnt have any purpose. You are not looking for special things like quests or to like destroy furniture.

After that everything should work fine (at least it did for me)
 
I'll try it out in a bit. Just got in from work & I'm cold, sore & starving. lol
[doublepost=1486488974][/doublepost]It works! Thankyou so much yet again PyrO! The players on the server may praise your name for this. So far the only real place we've had to mine firerock is the Abyss along the river where no mobs were. Now I can complete my lava run mining caves!
 
Back