| 11-04-2003, 06:07 AM | #1 |
on the Warcraft III and TFT campaigns there is a Bolean variable that has the Name GAMEOVER and my question is how do the get this one to work..becuse they dont use Set variable... and the hole map just crash if i take it away.... |
| 11-04-2003, 11:33 AM | #2 |
the variable GAMEOVER Probably has a preset value of false. that way all they have to do is referecnce it as false until the game is actually over. That is what i suspect. I had used similar methods myself. |
| 11-04-2003, 03:05 PM | #3 |
Its a variable not a preset vaule that tells you if you game is over. The maker uses it to stop triggers from running and such after you die or something. You just put it as a condition in a trigger. That way your triggers will stop running after you decide it is game over for them. |
| 11-04-2003, 04:47 PM | #4 |
i said variable with preset value. dummy me. i meant variable with an initial value like you can define when you create variables. thanks for correcting me though. |
| 11-04-2003, 05:35 PM | #5 |
yeah i now that..but does i dont have to set variable first like this... Set GAMEOVER = Player X have left the Game or somthing like that |
| 11-05-2003, 12:21 AM | #6 |
If GAMEOVER is a boolean variable then you would set it like this: Set GAMEOVER = false you can set the initial value to true or false when you create it. |
| 11-05-2003, 06:29 AM | #7 |
okay..so Bolean Variables work like there names...becuse if i change the name to "Grunt"...then it dont work.. |
| 11-05-2003, 02:57 PM | #8 |
No the name has nothing to do with it. You have to use it in a trigger for it to wrok. The name is just something for the creator to know which varible is which. The name is a totaly indepented varible and has no direct effect on it. To use a boolen Varible in a trigger do this. 1-Create a Varible by selecting on the "X" in you object editor. Then click on the plus button to create a new one. Make it a boolean (This is the original chooce so you dont have to change it). Set a name, put it as GAMEOVER for the example. Making sure it's intial value is false. 2-Next create a trigger Called "hero dies". Go: Event: Unit die "your hero" <-your hero is the hero of the your choosing. Actions: Set "GAMEOVER" to: TRUE (This is the set varible trigger) Now that have you have the trigger you have to connect your triggers so that when the hero dies the other triggers wont run. You do this through the conditions in the trigger. Here is an example. Make another trigger call it "Next level" Event: "A unit owned by Player 12 dies" Condtion: GAMEOVER IS EQUAL TO FALSE Actions: Give Player 1 100 gold. So what happens? This means this trigger will not run unless the GAMEOVER varible is equal to false. So if you hero dies the trigger will not run and the game will be over. This is just an example and there are 1000's of combinations of varibles and triggers, if not 1000000s. So if you still dont get it open up a map that and look at the triggers and varibles. Play around with them on a test map or something that is the only way you can get better. Good Luck. |
