Game stages
by Jonas · in Torque 3D Beginner · 06/25/2010 (2:53 pm) · 5 replies
Hi everyone!
I have been using torque script now for about 4 months and i have played around with it quite alot made new weapons changed around stuff to see the effect to kinda learn the basics and i think i got it down now and i understand everything pretty well so now i wanna move onto triggers/game stages.
What i mean by that is if i want the person playing to need a key to continue, i need to make a trigger opening a gate if he approach it with the key in backpack and if not the animation opening the game and changing objective does not happen. Same for bosses if the HP drops below a certain point i want the fight dynamics to change.
My question is how would i go about learning this? do you have any tutorials to recommend etc?
Best regards
/Jonas
I have been using torque script now for about 4 months and i have played around with it quite alot made new weapons changed around stuff to see the effect to kinda learn the basics and i think i got it down now and i understand everything pretty well so now i wanna move onto triggers/game stages.
What i mean by that is if i want the person playing to need a key to continue, i need to make a trigger opening a gate if he approach it with the key in backpack and if not the animation opening the game and changing objective does not happen. Same for bosses if the HP drops below a certain point i want the fight dynamics to change.
My question is how would i go about learning this? do you have any tutorials to recommend etc?
Best regards
/Jonas
About the author
Freelance 3D artist at day scripter/coder on Enduring Life at night. Lover of all things TorqueScript.
#2
http://www.torquepowered.com/community/forums/viewthread/105317
http://www.torquepowered.com/community/forums/viewthread/74773
http://www.torquepowered.com/community/forums/viewthread/46680
Sorry I can't help further :/
06/26/2010 (8:34 pm)
I have yet to touch triggers but these 3 posts might give you a starting point to work with.http://www.torquepowered.com/community/forums/viewthread/105317
http://www.torquepowered.com/community/forums/viewthread/74773
http://www.torquepowered.com/community/forums/viewthread/46680
Sorry I can't help further :/
#3
07/12/2010 (11:54 am)
About the boss battle type stuff, I don't have any tutorials to recommend, you just need to get more familiar with torque scripting in general. If you give me a scenario, I could write up a little tutorial for exactly what you need.
#4
Ok here goes:
The boss fight starts of with a cut scene(this i know how to do).
Then the boss (a giant snow monster) starts swipping the ground with hes hands/arms forcing the player to jump over them (this i also know how to do)
and here comes the part i am unsure of:
when the boss hits 80% hp i want him to change "stance" and use a different set of attacks.
And then once again at 20% i want it to change again.
07/16/2010 (7:51 am)
@Jonathan that would be great!Ok here goes:
The boss fight starts of with a cut scene(this i know how to do).
Then the boss (a giant snow monster) starts swipping the ground with hes hands/arms forcing the player to jump over them (this i also know how to do)
and here comes the part i am unsure of:
when the boss hits 80% hp i want him to change "stance" and use a different set of attacks.
And then once again at 20% i want it to change again.
#5
Note: getDamagePercent() returns the percent of damage taken, so 1 - %obj.getDamagePercent() returns the percent of health remaining
If you already know how to set the stance, then I would assume you could figure out how to change it, but if you need help then I would need to know how you set up the original stance and what you want to change it to.
If you need any more help, let me know.
-Jon
07/17/2010 (3:08 am)
Create the following function where "Boss1" is the name of the boss's datablockfunction Boss1::damage(%this, %obj, %sourceObject, %position, %damage, %damageType)
{
if (!isObject(%obj) || %obj.getState() $= "Dead")
return;
%healthPercent = 1 - %obj.getDamagePercent();
if (%healthPercent <= 0.2)
{
// %the boss's health is at or below 20%, change stance
}
else if (%healthPercent <= 0.8)
{
// %the boss's health is at or below 80% (but greater than 20%), change stance
}
}Note: getDamagePercent() returns the percent of damage taken, so 1 - %obj.getDamagePercent() returns the percent of health remaining
If you already know how to set the stance, then I would assume you could figure out how to change it, but if you need help then I would need to know how you set up the original stance and what you want to change it to.
If you need any more help, let me know.
-Jon
Torque Owner Jonas