Player death and print messege
by Thomas Shaw · in Torque Game Engine · 11/18/2004 (12:07 pm) · 5 replies
I have a player-triggered event where a player completes a task then they are supposed to die, have a messege appear on screen, and have the player respawn back at their base.
The parts I can't figure out are how to actually kill the player. I can just make him respawn, but I want him to physically die. So is there like a playerKill() or something? Also, how to print messeges to the HUD, and what options are there? Right now im just doing an echo and printing it to the stupid console ; ;
The parts I can't figure out are how to actually kill the player. I can just make him respawn, but I want him to physically die. So is there like a playerKill() or something? Also, how to print messeges to the HUD, and what options are there? Right now im just doing an echo and printing it to the stupid console ; ;
#2
11/18/2004 (2:40 pm)
That seems a little messy, there must be a kill function. Also, still no answer to my question on printing to the screen?
#3
For the printing you could use bottomPrint. I'm unsure of the syntax but you should be able to find out some more information on it with a search or looking in the script.
You SHOULD be able to test it out though:
bottomPrint(%client, "TEXT HERE", 2, 10);
I THINK the 10 is the delay until disappear.
The 2 though I'm not sure of sorry.
Now, for the death you can just call the applyDamage(%damage) function and that should kill complete with animations/sounds etc.
You could also call onDeath directly however it doesn't appear to trigger the animations etc.
The simplist and best way is probably applyDamage.
NOTE: I'm VERY new to Torque and TorqueScript so my answers are probably not the best way to do things. Just trying to lend a hand where I can :)
EDIT - left out the not
11/18/2004 (9:39 pm)
Thomas,For the printing you could use bottomPrint. I'm unsure of the syntax but you should be able to find out some more information on it with a search or looking in the script.
You SHOULD be able to test it out though:
bottomPrint(%client, "TEXT HERE", 2, 10);
I THINK the 10 is the delay until disappear.
The 2 though I'm not sure of sorry.
Now, for the death you can just call the applyDamage(%damage) function and that should kill complete with animations/sounds etc.
You could also call onDeath directly however it doesn't appear to trigger the animations etc.
The simplist and best way is probably applyDamage.
NOTE: I'm VERY new to Torque and TorqueScript so my answers are probably not the best way to do things. Just trying to lend a hand where I can :)
EDIT - left out the not
#4
Messy? Not really. Or you can just call the function which is called when your health hits 0, look in shapebase.
The print message is something I would do trough a message from server to client which initiates a GUI on the screen with text. Like BottomPrint, although I've never used it.
Or if you're talking the messageHUD, pushbackline(); will work.
11/19/2004 (4:58 am)
ThomasMessy? Not really. Or you can just call the function which is called when your health hits 0, look in shapebase.
The print message is something I would do trough a message from server to client which initiates a GUI on the screen with text. Like BottomPrint, although I've never used it.
Or if you're talking the messageHUD, pushbackline(); will work.
#5
11/19/2004 (5:26 am)
You might also look into the suicide command ctrl k and alter it to what you need. It kills the player immediately.
Torque Owner Stefan Lundmark