Hi, I have a question to ask the gods of triggers which relates to objectives. Basically, there are 3 objectives - two primary objectives and one secondary. (NOTE - this is a single player map; the enemy is AI).
Main Objectives:
1: Kill enemy orbital commands (6 of them on the map)
2: Do not let the enemy kill your orbital command (I made it so you cannot lift it off via tech restrictions)
Secondary objective: Collect research items around the map (4 on map)
___________________________
My question is, how would I do the following:
-Make these objectives appear in the top left, like in WoL / HotS
-Make the objectives function, i.e. If the players Orbital dies, the objective is failed and they lose. Or if you kill all the enemy orbitals, it checks off the two primary objectives and you win
-have a functional "out of X" counter beside the two objectives that this applies to, i.e. one objective is "Kill enemy Orbital Commands (0/6)" - the other counts the research items collected.
___________________________
I know that there are tutorials on objectives up already, but many are out of date, and the others I find difficult to comprehend. I would be highly grateful if someone could be so kind as to give a step-by-step guide on how to do this.
If you do decide to help me out, keep in mind that I'm not very savvy with triggers at all; I know this task involves variables, which are complicated to me. The best I could do on my own was make a campaign-style fade / zoom in mission start, set tech restrictions, and other basic region + trigger things.
Orbital Killed Objective:
Let's say there are 6 possible players:
Create global variable (maybe name it Player Orbitals[6]) by creating a 'Unit' type variable in the file list (on the left) and clicking the 'array' checkbox. Change the size of the array variable to the maximum number of players you will have.
In game, when the Orbital Commands are created for players by triggers, use the Set Variable function to set Player Orbitals[<PutPlayerNumberHere>] to the Last Created Unit (which is the Orbital you just created). If you put the Orbital Commands on the Terrain Editor, and they're already in the game when it starts without having to create them via triggers, then, in a Melee Initialization Trigger, set all of the Player Orbitals[<PlayerNumbers>] to the ones you've placed in the terrain editor (via the 'Value' tab under the Set Variable).
Create a Trigger that has multiple events that make it fire; the event you'll be looking for is 'Unit Dies'. The first Event that will cause the Trigger to execute will be something along the lines of "Player Orbitals[1] Dies. Then you will continue on and put "Player Orbitals[2] Dies, 3, 4,... etc.
I'm not using my editor to test this out right now, but you would make it so the Triggering Player is kicked from the game, or, you could change all of the player's units to Neutral, Reveal the entire map for them, and make it so they can watch but not play. I don't know how your map will play, but you can make the decision on what happens when you get that far. If you need help figuring out the rest, let me know.
As for the rest of the objectives, I don't have my Editor open right now. But, if you need further assistance, I will be glad to give you more help.
Oops, I'm sorry If I wasn't clear (I'll update my post) - this is a single player map, and they alone must kill enemy AI Orbitals (part of a mini campaign I'm toying with). Not sure if the solution you posted works in this case. If not, I'm still extremely grateful you tried to help me.
I attached a map in the style of a single-player campaign map. Open it up, give it a test run, but definitely read through the Triggers. I put a lot of comments in there for you to help you understand the process in how we make these types of objectives, make them compete when certain things happen, and all the rest of it. It really is pretty simple.
Wow, that's really awesome! Thank you so much for being so helpful. Just have one last question to clarify:
in the melee initialization trigger, you mentioned you could use an array to hold the objectives, and simply make them have to kill the specified player.
If I were to make the orbital commands all a single player (say... player 4) - so that only orbitals are in player 4 and player 4 is treated as an ally by the enemy AI (I know how to do this), how would I make the objective complete after destroying all of player 4's structures?
I've attached another map that has comments in the Code, so go ahead and give that a read - the code works for all types of structures - Orbitals, Infestation Pits, etc. (And I put a few of them on the map).
As far as the bit about arrays:
Imagine you made a map, that had 8 players, and they each had to ... kill One Zergling on the map. Since you now know how to create global objective variables, you might create 8 Individual varaibles like this....
Then, inside your Unit Dies Trigger, you would have to use an If Then Else statements (like 8 of them) to check what player killed a Zergling, and then set their objective to complete (only for that one player).
The easy way to do it would be using an Array. Arrays are sort of like "Lists" of variables. You set the maximum different items there are in the "List" by change the "Size" parameter of an Array variable. SO , the easier way to do this would be creating One Array variable with the size of 8:
ObjectiveKillZergling[8]
Now, the Huge advantage about arrays is that you can, instead of putting a number between the "[ ]" braces, you can put a variable, or a math equation, or any number. Before, in the example above, I was discussing a Trigger that checks every time a Zergling dies. Imagine if your long Trigger from up there, with 8 IF THEN ELSE statements was changed simply one line of code, this:
Thank you so much. And yes that did work, FenixKissKerrigan - thanks! All of your help, gerudobombshell, is highly appreciated, and I'll be using the tutorials you gave me for some time - thanks!
Rollback Post to RevisionRollBack
I do terrain stuff.
...
And in a Starcraft haiku,
...
That's all I can do!
To post a comment, please login or register a new account.
Hi, I have a question to ask the gods of triggers which relates to objectives. Basically, there are 3 objectives - two primary objectives and one secondary. (NOTE - this is a single player map; the enemy is AI).
Main Objectives:
1: Kill enemy orbital commands (6 of them on the map)
2: Do not let the enemy kill your orbital command (I made it so you cannot lift it off via tech restrictions)
Secondary objective: Collect research items around the map (4 on map)
___________________________
My question is, how would I do the following:
-Make these objectives appear in the top left, like in WoL / HotS
-Make the objectives function, i.e. If the players Orbital dies, the objective is failed and they lose. Or if you kill all the enemy orbitals, it checks off the two primary objectives and you win
-have a functional "out of X" counter beside the two objectives that this applies to, i.e. one objective is "Kill enemy Orbital Commands (0/6)" - the other counts the research items collected.
___________________________
I know that there are tutorials on objectives up already, but many are out of date, and the others I find difficult to comprehend. I would be highly grateful if someone could be so kind as to give a step-by-step guide on how to do this.
If you do decide to help me out, keep in mind that I'm not very savvy with triggers at all; I know this task involves variables, which are complicated to me. The best I could do on my own was make a campaign-style fade / zoom in mission start, set tech restrictions, and other basic region + trigger things.
Orbital Killed Objective: Let's say there are 6 possible players:
As for the rest of the objectives, I don't have my Editor open right now. But, if you need further assistance, I will be glad to give you more help.
Oops, I'm sorry If I wasn't clear (I'll update my post) - this is a single player map, and they alone must kill enemy AI Orbitals (part of a mini campaign I'm toying with). Not sure if the solution you posted works in this case. If not, I'm still extremely grateful you tried to help me.
I attached a map in the style of a single-player campaign map. Open it up, give it a test run, but definitely read through the Triggers. I put a lot of comments in there for you to help you understand the process in how we make these types of objectives, make them compete when certain things happen, and all the rest of it. It really is pretty simple.
Good luck!
Wow, that's really awesome! Thank you so much for being so helpful. Just have one last question to clarify:
in the melee initialization trigger, you mentioned you could use an array to hold the objectives, and simply make them have to kill the specified player.
If I were to make the orbital commands all a single player (say... player 4) - so that only orbitals are in player 4 and player 4 is treated as an ally by the enemy AI (I know how to do this), how would I make the objective complete after destroying all of player 4's structures?
Hydra, does this work?
I've attached another map that has comments in the Code, so go ahead and give that a read - the code works for all types of structures - Orbitals, Infestation Pits, etc. (And I put a few of them on the map).
As far as the bit about arrays:
Imagine you made a map, that had 8 players, and they each had to ... kill One Zergling on the map. Since you now know how to create global objective variables, you might create 8 Individual varaibles like this....
Then, inside your Unit Dies Trigger, you would have to use an If Then Else statements (like 8 of them) to check what player killed a Zergling, and then set their objective to complete (only for that one player).
The easy way to do it would be using an Array. Arrays are sort of like "Lists" of variables. You set the maximum different items there are in the "List" by change the "Size" parameter of an Array variable. SO , the easier way to do this would be creating One Array variable with the size of 8:
Now, the Huge advantage about arrays is that you can, instead of putting a number between the "[ ]" braces, you can put a variable, or a math equation, or any number. Before, in the example above, I was discussing a Trigger that checks every time a Zergling dies. Imagine if your long Trigger from up there, with 8 IF THEN ELSE statements was changed simply one line of code, this:
Much Easier, right?
If you still aren't getting it, just let me know.
Thank you so much. And yes that did work, FenixKissKerrigan - thanks! All of your help, gerudobombshell, is highly appreciated, and I'll be using the tutorials you gave me for some time - thanks!