You need a way to store information. There are limitless ways to store information, and lots of information is stored automatically by the engine. Information stored by the engine (unit kills, etc.) is retrievable using functions (gets/returns) and functions can be used in actions or conditions. The most generic/flexible tools are data tables, banks, and variables. Each has it's own strengths and weaknesses, but variables are ideal for something simple like this. There's global and local variables. See vocabulary below.
Create a global variable by right clicking in the trigger viewer (the area where you make your triggers). Let's call it "Photon Cannon Death Counter." Set it to type 'integer' (the default setting).
In your trigger that's triggered from the event 'Unit Dies' (I'm assuming you're using that event), add the action 'Modify Variable (Integer)' and set the variable we just created 'Photon Cannon Death Counter' to be +1.
Create another action 'If Then' and create a condition for the 'If' part (do this by clicking on 'If" and hitting 'control-K'). Or you can double click the conditions segment at the top and move the condition down, but you can't create a new condition by double clicking a condition area in the trigger actions.
For the first comparison, put your variable 'Photon Cannon Death Counter' and for the second part put the value '3'.
For the actions of the 'If-Then' put your end game actions.
What we did was:
Created a way to store the death count.
Increased the count by one each time the unit dies.
Each time the unit dies, also check whether the count is at 3 or not.
Vocabulary:
Global: When something can be returned from any thread (more accurately, a trigger instance). A variable is considered global when it's placed in the trigger viewer, rather than in an specific trigger.
Local: When something can be returned from only the one thread (trigger) in which the thing was created. A variable is considered local when you create it in a particular trigger, in the variables area in the trigger.
Variable: Things that store information of a certain type. You create a variable, globally or locally, by pressing 'control-V'.
Information Types: The type of information when something is stored. Also known as data types, but that can get confusing, due to the data module. Strings (segments of words/letters) aren't the same as integers (any whole number), which aren't the same as reals (short for real numbers) (any rational number). The pointless stuff math teachers teach kinda comes in handy here, in terminology. Some can be converted into one another, i.e. an integer of 5 can also be a real of 5.
Data Table: It's like variables, but with data tables, you don't need to create it before using it. You just specify the string ID of what you're retrieving.
@Bareleon: Go
You need a way to store information. There are limitless ways to store information, and lots of information is stored automatically by the engine. Information stored by the engine (unit kills, etc.) is retrievable using functions (gets/returns) and functions can be used in actions or conditions. The most generic/flexible tools are data tables, banks, and variables. Each has it's own strengths and weaknesses, but variables are ideal for something simple like this. There's global and local variables. See vocabulary below.
Create a global variable by right clicking in the trigger viewer (the area where you make your triggers). Let's call it "Photon Cannon Death Counter." Set it to type 'integer' (the default setting).
In your trigger that's triggered from the event 'Unit Dies' (I'm assuming you're using that event), add the action 'Modify Variable (Integer)' and set the variable we just created 'Photon Cannon Death Counter' to be +1.
Create another action 'If Then' and create a condition for the 'If' part (do this by clicking on 'If" and hitting 'control-K'). Or you can double click the conditions segment at the top and move the condition down, but you can't create a new condition by double clicking a condition area in the trigger actions.
For the first comparison, put your variable 'Photon Cannon Death Counter' and for the second part put the value '3'.
For the actions of the 'If-Then' put your end game actions.
What we did was:
Created a way to store the death count.
Increased the count by one each time the unit dies.
Each time the unit dies, also check whether the count is at 3 or not.
Vocabulary:
Global: When something can be returned from any thread (more accurately, a trigger instance). A variable is considered global when it's placed in the trigger viewer, rather than in an specific trigger.
Local: When something can be returned from only the one thread (trigger) in which the thing was created. A variable is considered local when you create it in a particular trigger, in the variables area in the trigger.
Variable: Things that store information of a certain type. You create a variable, globally or locally, by pressing 'control-V'.
Information Types: The type of information when something is stored. Also known as data types, but that can get confusing, due to the data module. Strings (segments of words/letters) aren't the same as integers (any whole number), which aren't the same as reals (short for real numbers) (any rational number). The pointless stuff math teachers teach kinda comes in handy here, in terminology. Some can be converted into one another, i.e. an integer of 5 can also be a real of 5.
Data Table: It's like variables, but with data tables, you don't need to create it before using it. You just specify the string ID of what you're retrieving.
Banks: Ehh, too lazy.
Thank you!
I will try it out.
Rollback Post to RevisionRollBack
To post a comment, please login or register a new account.
I only managed to get where you lose after one is destroyed. How do I get it so it waits for the other 2?
@Bareleon: Go
What we did was:
Vocabulary:
Thank you!
I will try it out.