Game Development Community

Engine crash

by HAZ MATT · in Technical Issues · 06/22/2007 (9:42 pm) · 4 replies

The engine keeps crashing when I attempt to delete an AIPlayer object. Here is my code:

//create guy to kill
new AIPlayer(Enemy1)
{
datablock = "Guard1";
};


//.....


Enemy1.delete();



Seems simple enought, but I don't know why it keeps crashing the engine. Any help would be greatly appriciated!

#1
06/23/2007 (1:33 am)
Usually the object is still referenced. What you should use instead is the safe and network-aware method by doing a

Enemy1.schedule(0, "delete");
#2
06/23/2007 (9:11 am)
Thanks Martin!

I tried using that method and got the same results. Still trying to figure this one out.
#3
06/23/2007 (2:31 pm)
Turns out I was calling delete manually, and in the onRemove callback..... That's what was causing the problem.

Thanks for the help Martin!
#4
06/23/2007 (2:34 pm)
Did I help? :-) Sure, you're welcome!