Game Development Community

How do i do a timed respawn, and have team assingment

by DylaNemesis · in Torque 3D Beginner · 08/30/2013 (9:41 pm) · 2 replies

I've been trying for days to ad a delay in a characters re-spawn and no matter what its always instant, i wanted to do a 3 second delay, also i thought i had teams working fine but every-time a player dies he restarts in a new spot as a new team.

#1
09/01/2013 (8:07 pm)
Use a flag and a schedule

Example:
function GameConnection::SetFlag(%this, %flagName, %value) {
   %code = %this @"."@%flagName@" = "@%value@";";
   call(%code);
}

Then in the onDeath:
%clVictim.setFlag("CannotRespawn", true);
   %clVictim.schedule(3000, setFlag, "CannotRespawn", false);

Lastly, just add a code check for the camera's mouseClick code to check for the %client.cannotRespawn flag.
#2
09/01/2013 (8:58 pm)
Robert,

Call is only used to dynamically call methods. It should be eval(%code);