I have this trigger that does "If (infestors) current life % is >= 70 it will then Display a text on the screen like (Times up or something), but how do i do so it only shows up once and not everytime he gets hit under 70% hp?
this is what is looks like, im not sure what you mean, where do i create the true or false variable?
Untitled Trigger 001
Events
Unit - Infestor (Spellcaster) [125.89, 125.63] takes Fatal or Non-Fatal Any damage (from Any effects)
Local Variables
Untitled Variable 001 = 0 <Integer>
Conditions
Actions
General - If (Conditions) then do (Actions) else do (Actions)
If
(Infestor (Spellcaster) [125.89, 125.63] Life (Percent) (Current)) >= 70.0
Then
UI - Display "Nice " for (All players) to Subtitle area
Else
you need to create a global variable to check whether the infestor has been below 70% hp or not, and you will just add the variable into your conditions
im sorry for the "wall of mess " xD i thought it would be as in editor...
anyhow the thing is that i dont know how to create a global veriable and where to create it and so on...if u had like a picture or something, i would really appreciate it :) (kinda noob to all this :( started with map editor yesterday...)
Havent read through the wall of mess but ill just point out how to create a global variable really quickly...
Go to where all your triggers and trigger folders are, right click underneath them (still same window/box), create new -> Variable. Something like that, very far down the list.
Then name your variable and set it's type.
To explain what variables do... They're kind of like the most awesome and useful thing in the whole friggin trigger editor together with loops and if then else actions, and you should learn how to use all three of these since they are a LOT of help.
Variables store any data you want. You have to set the variable type. There's boolean for example, which is basically just a "true" or "false" statement. Integers save integers (whole numbers), Reals saves Real numbers (numbers with a decimal point in general), unit variables save a unit, game links save certain game links (behaviors, effects, unit types, upgrades, abilities, etc. anything in the data editor basically), and all the other things are very straightforward.
Use the "Set variable" action to store certain data in a variable. If you used a global variable, that data is accesible to all triggers (After it has been written). Local variables on the other hand get wiped once the trigger they are created in finishes. local variable are, when you create a new trigger, placed between events and conditions. The Set Variable action is the default action when you want to create a new action, so it shouldnt be hard to find (ctrl+w, enter)
If you want more help with variables, PM me so that i dont clutter this thread.
To answer your original question, Create a global variable of type boolean, have its default value false, then make your trigger look like this:
Also, when pasting triggers into a forum post, select the text afterwards and hit the button on top beside "Markup Type", the one with wheel. It should create square brackets with "Code" written in them :) Post and itll look like my trigger
I have this trigger that does "If (infestors) current life % is >= 70 it will then Display a text on the screen like (Times up or something), but how do i do so it only shows up once and not everytime he gets hit under 70% hp?
well currently...
current life % >= 70. In words means when current life is greater or = to 70. so this is the revese of what you want currently.
and you would need a true or false variable to check if its allready happened
if current life % <= 70 and if "allready happened" = false. then do times up message and set "allready happened" to true.
@nevjmac: Go
this is what is looks like, im not sure what you mean, where do i create the true or false variable? Untitled Trigger 001 Events Unit - Infestor (Spellcaster) [125.89, 125.63] takes Fatal or Non-Fatal Any damage (from Any effects) Local Variables Untitled Variable 001 = 0 <Integer> Conditions Actions General - If (Conditions) then do (Actions) else do (Actions) If (Infestor (Spellcaster) [125.89, 125.63] Life (Percent) (Current)) >= 70.0 Then UI - Display "Nice " for (All players) to Subtitle area Else
other than that being a wall of mess lol..
you need to create a global variable to check whether the infestor has been below 70% hp or not, and you will just add the variable into your conditions
@nevjmac: Go
im sorry for the "wall of mess " xD i thought it would be as in editor... anyhow the thing is that i dont know how to create a global veriable and where to create it and so on...if u had like a picture or something, i would really appreciate it :) (kinda noob to all this :( started with map editor yesterday...)
Havent read through the wall of mess but ill just point out how to create a global variable really quickly...
Go to where all your triggers and trigger folders are, right click underneath them (still same window/box), create new -> Variable. Something like that, very far down the list.
Then name your variable and set it's type.
To explain what variables do... They're kind of like the most awesome and useful thing in the whole friggin trigger editor together with loops and if then else actions, and you should learn how to use all three of these since they are a LOT of help.
Variables store any data you want. You have to set the variable type. There's boolean for example, which is basically just a "true" or "false" statement. Integers save integers (whole numbers), Reals saves Real numbers (numbers with a decimal point in general), unit variables save a unit, game links save certain game links (behaviors, effects, unit types, upgrades, abilities, etc. anything in the data editor basically), and all the other things are very straightforward.
Use the "Set variable" action to store certain data in a variable. If you used a global variable, that data is accesible to all triggers (After it has been written). Local variables on the other hand get wiped once the trigger they are created in finishes. local variable are, when you create a new trigger, placed between events and conditions. The Set Variable action is the default action when you want to create a new action, so it shouldnt be hard to find (ctrl+w, enter)
If you want more help with variables, PM me so that i dont clutter this thread.
To answer your original question, Create a global variable of type boolean, have its default value false, then make your trigger look like this:
Also, when pasting triggers into a forum post, select the text afterwards and hit the button on top beside "Markup Type", the one with wheel. It should create square brackets with "Code" written in them :) Post and itll look like my trigger
@TheAlmaity: Go
ok ty i will try that :)