Game Development Community

Invulnerability

by Todd Johnson · in Torque Game Engine · 12/05/2004 (10:05 pm) · 6 replies

Has anyone used setInvincibleMode? It takes two parameters (time and speed). I have no idea what this does. I would like to know how I can set my player to be invulnerable.

#1
12/07/2004 (9:16 pm)
Never tried it. Have you tried setting some random large values in it and seeing what happens?
#2
12/08/2004 (3:46 am)
Yes I have, time is basically how long the effect stays. Where as speed makes my screen flash blue at a higher frequency... eh? Is this desirable?
#3
12/08/2004 (8:55 am)
Seems like it's working to me. :)
#4
12/08/2004 (6:58 pm)
So the flashing blue is desirable eh.
#5
12/08/2004 (10:16 pm)
Well, I dunno if it's desirable, but it sounds like it's doing _something_ roughly like what it ought to be. ;)
#6
05/06/2008 (12:40 pm)
Here is a way It is also an ideal way to change the Datablock
ActionMap.bind(keyboard, "d", DisableDamage);

function DisableDamage(%val)
{
   if(%val)
      commandToServer('ToggleDamage');
}
(note the empty DB)
function serverCmdToggleDamage(%client)
{

   %player = %client.player;
   %playerDb = %player.getDatablock();
   if(%playerDb.isInvincible)
      %playerDb.isInvincible = false;
   else
      %playerDb.isInvincible = true;

   %player.setDataBlock(NotUsedPlayerData);   
   %player.setDataBlock(%playerDb);   
   
}