Respaw AI problem
by Graham Evans · in Torque Game Engine · 03/25/2006 (7:07 pm) · 4 replies
Greetings all.
I am having a slight problem in respawning my AI "Mobs".
I am using a resource called AI guard, which is excellent, and have it fully set up with the ability to have different mobs and to have chest drops on death and looting take place, but :- (theres always a but)
When it come to respawning, there is a variable for delay before respawn which is triggered by a schedule command of
It would appear that as soon as $AI_GUARD_RESPAWN_DELAY is greater than the time taken for the corpse to decay, then the schedule never fires.
I have tried resetting the schedule to do a brand new spawn function rather than respawn, but this also never fires, it's like I am loosing the schedule command or it is being cancelled.
Is there a way around this at all...
Sorry if this is a really stupid question, but I haven't found anything on a forum search about this.
Regards
Graham Evans
I am having a slight problem in respawning my AI "Mobs".
I am using a resource called AI guard, which is excellent, and have it fully set up with the ability to have different mobs and to have chest drops on death and looting take place, but :- (theres always a but)
When it come to respawning, there is a variable for delay before respawn which is triggered by a schedule command of
%this.respawntrigger = %this.schedule($AI_GUARD_RESPAWN_DELAY,"respawn", %name, %marker);
It would appear that as soon as $AI_GUARD_RESPAWN_DELAY is greater than the time taken for the corpse to decay, then the schedule never fires.
I have tried resetting the schedule to do a brand new spawn function rather than respawn, but this also never fires, it's like I am loosing the schedule command or it is being cancelled.
Is there a way around this at all...
Sorry if this is a really stupid question, but I haven't found anything on a forum search about this.
Regards
Graham Evans
#2
04/03/2006 (8:09 am)
This is a guess. Don't schedule it on the object itself. Use schedule rather than %this.schedule. Perhaps the object is being deleted once the corpse finishes fading out. If that's the case, schedule won't succeed since the object it has a handle on is gone. Check your console logs, you may see a message indicating that.
#3
Regards
Graham
04/03/2006 (8:02 pm)
@Ben Thanks!! I will try that as soon as I have finished this latest code change and taken a backup.. I really hope thats the answer because as you say, it seems the respawn is loosing the id when the corpse decays :)Regards
Graham
#4
My solution was to fade the corpse and cloak it so technically it is still there but invis and no collision for as long as I needed, then decay the corpse 1 second after the respawn.
I had to use cloaked not hide as this is still based from a player char not an object.
Hopoe this helps someone.
Regards
Graham
04/17/2006 (9:56 am)
Okay, as a follow up for anyone reading this later.. the corpse decaying does in fact delete the id and even a schedule will not resurrect it.My solution was to fade the corpse and cloak it so technically it is still there but invis and no collision for as long as I needed, then decay the corpse 1 second after the respawn.
I had to use cloaked not hide as this is still based from a player char not an object.
Hopoe this helps someone.
Regards
Graham
Torque 3D Owner Graham Evans
The latest thing I am trying is to schedule the corpse into a fade for a couple of minutes and then respawning it, which seems to be possible, but haven't finished fully testing it yet.
But if anyone has any insight into this, I would really appreciate it.
Regards
Graham Evans