Working on my tamer statue script. Can somebody take a look and see if I am on the right track.
 

Attachments

  • TamingCow.cs
    10.7 KB · Views: 4
I did. If I double click on it it says "You are taming this creature" but never gets past that. If I double click on it again my server crashes.

Crash report:


Server Crash Report
===================
ServUO Version 0.5, Build 6472.26597
Operating System: Microsoft Windows NT 6.2.9200.0
.NET Framework: 4.0.30319.42000
Time: 11/23/2017 9:34:53 AM
Mobiles: 6240
Items: 723428
Exception:
System.NullReferenceException: Object reference not set to an instance of an object.
at Server.Mobiles.TamingCow.OnDoubleClick(Mobile from)
at Server.Mobile.Use(Mobile m) in c:\Users\Ted Gress\Desktop\ServUO-master reboot\ServUO-master\ServUO-master\Server\Mobile.cs:line 4449
at Server.Engines.XmlSpawner2.XmlAttach.UseReq(NetState state, PacketReader pvSrc)
at Server.Network.MessagePump.HandleReceive(NetState ns) in c:\Users\Ted Gress\Desktop\ServUO-master reboot\ServUO-master\ServUO-master\Server\Network\MessagePump.cs:line 187
at Server.Network.MessagePump.Slice() in c:\Users\Ted Gress\Desktop\ServUO-master reboot\ServUO-master\ServUO-master\Server\Network\MessagePump.cs:line 121
at Server.Core.Main(String[] args) in c:\Users\Ted Gress\Desktop\ServUO-master reboot\ServUO-master\ServUO-master\Server\Main.cs:line 588
Clients:
- Count: 1
+ 127.0.0.1: (account = ted_gress) (mobile = 0x3B1 'Arcadian')
 
OK, so the trick to crash logs is to read them in reverse, the most significant line we can use that is closest to the top of the stack is;
at Server.Mobiles.TamingCow.OnDoubleClick(Mobile from)

That tells us the NullReferenceException is originating from a TamingCow, in the method OnDoubleClick.

If you run the shard in debug mode, it would give you the exact error line number, too.
 
Yes I know this much about error logs. It is saying there is a null reference on either the Mobile from or the object target. How do you run the shard in debug mode?
 
Create a new empty txt file with the contents:
Code:
ServUO.exe -debug

Rename the file's extension to .bat, put it in the same directory as ServUO.exe.
Run the .bat file.
 
Ok. Its crashing on m_Item.Movable = true. So I am guessing m_Item is null for some reason. I'm not sure if what I should set it to. Its defined as BaseTamer m_Item but I don't think it is initialized.
 
That's correct.

I looked at the code, not even sure what BaseTamer should be. Maybe you can remove all references to m_Item and get rid of m_Item itself.
 
Can't. Its being used by:

private class InternalTimer : Timer
{
private BaseTamer m_Item;
private Mobile m_Tamer;
private BaseCreature m_Creature;
private int m_MaxCount;
private int m_Count;

public InternalTimer( BaseTamer item, Mobile tamer, BaseCreature creature, int count ) : base( TimeSpan.FromSeconds( 3.0 ), TimeSpan.FromSeconds( 3.0 ), count )
{
m_Tamer = tamer;
m_Creature = creature;
m_MaxCount = count;
m_Item = item;
}
[doublepost=1511438757][/doublepost]Ok so I removed m_Item from *everything* and now he tames on double click. I just need help with him being untamed by the timer;.
 

Active Shards

Donations

Total amount
$0.00
Goal
$1,000.00
Back