Player Invincibility
by Ryan Edmar · in Technical Issues · 11/22/2006 (4:07 am) · 3 replies
This might seem like a stupid question but, does anyone now how I can make a player object not take damage. The reason I for this is I recently added a RPG dialog to my game. The script for this employs an AiPlayer that just stands there(this is temporary) and then the player walks up to it and hits a button to talk to it. The problem is the script also uses the PlayerBody datablock and I don't want my Ai players to take damage as they will be like townsfolk and other things like that. I've tried a few things and searched everywhere with no luck. I remember reading somewhere that this can be done but I can't seem to find the info. Some incite would be helpful please.
About the author
#2
Personally - I just set isInvulnerable to true on the NPC spawn datablock.
This way I don,t hhave to worry about it expiring and in other areas such as radar or maps I can look at player datablocks and the isInvulnerable flag to change the dot color on the map between players, mob's and NPC's.
Means I can also use an NPC for target practice to test out new spell effects without having to wait for them to respawn each time :)
Regards
Graham
11/22/2006 (6:20 am)
Greetings.Personally - I just set isInvulnerable to true on the NPC spawn datablock.
This way I don,t hhave to worry about it expiring and in other areas such as radar or maps I can look at player datablocks and the isInvulnerable flag to change the dot color on the map between players, mob's and NPC's.
Means I can also use an NPC for target practice to test out new spell effects without having to wait for them to respawn each time :)
Regards
Graham
#3
Okay!!! New question. How do I set isInvulnerable to true?
Here is my datablock for my NPC's
datablock PlayerData(NPCPlayer : PlayerBody)
{
shootingDelay = 2000;
}
So basically just a copy of the DemoPlayer datablock in aiplayer.cs with a new name. I added isInvulnerable = ture; to this but it did nothing. This might seem like simple stuff but I quite new and the only coding I've really ever done was in Q-Basic.
Just a side point, do you think I should create a new datablock for my NPC's or just continue to piggyback of the PlayerBody datablock?
11/22/2006 (8:55 pm)
Thanks Graham and Wolfgang for the help. Both of your answers will come in very helpful to me.Okay!!! New question. How do I set isInvulnerable to true?
Here is my datablock for my NPC's
datablock PlayerData(NPCPlayer : PlayerBody)
{
shootingDelay = 2000;
}
So basically just a copy of the DemoPlayer datablock in aiplayer.cs with a new name. I added isInvulnerable = ture; to this but it did nothing. This might seem like simple stuff but I quite new and the only coding I've really ever done was in Q-Basic.
Just a side point, do you think I should create a new datablock for my NPC's or just continue to piggyback of the PlayerBody datablock?
Torque Owner Wolfgang Kurz
that should do it