Open up your map and hit F6 to open the trigger editor. The basics of the system are still the same. Events trigger the actions, as long as all the conditions are met.
First Things you will see different
1) To edit data fields in triggers, you will use the nice little box at the bottom of the window instead of double clicking on the event to edit it.
2) The search box is much more easily accessible now. Its always in the top of the event box.
3) Local Variables!! There is a section for them right under events. These are so nice, but I'll get to them later.
The awesomeness of Local Variables
note- I have been told these were usable in wc3 editor but only through code. This is still helpful info, anyway.
What is a local variable? It is basically a variable just like the ones from wc3, but it is unique to that trigger. So basically, lets say you wanted a trigger that picks 5 units for the triggering player, assigns them to a variable, and then moves them all somewhere. Well in Warcraft 3, if multiple people triggered this, the variable would be assigned a new set of units and mess up the trigger. But if you have a local variable, it is unique to each time the trigger is run. So you could have 10 of the same trigger running at the same time, and only need 1 local variable.
How you can use local variables
You can use them for something as simple as a loop. Make a local variable called X. Then add the event 'for each integer'. You can use X for this integer. This would be a problem back in the days of wc3, because the variable would get reset to 1 if another player ran the trigger half way through.
Records
These are basically a tool to organize your global variables. Global variables (to clarify) are just normal variables, like in wc3. Think of records as a box that hold other variables, like a folder. SO you can put, lets say, 10 integer values in the record 'rec1'. All you have to do to use these is this:
1) Right click on the left half on the window (where the trigger list was in wc3) and click "new record."
2) Select the record and you can add variables to it in the top right part of the window.
3) Right click on the left side again, and hit 'add variable'
4) Set the variable type to Record, nae it rec1
5) it will automatically link the variable and the record together for you if you only have 1 record. otherwise, just select the record you want.
6) To use the record, for example you can use the set variable action. Set variable 'rec1' and member 'your variable here' to 3. By member, I mean any variable inside the record.
How records can help you
They are more of an organization tool. You can do anything without records you can do with them. But say you had 100 integer variables for your TD map. Since variables are now displayed along side triggers, that would be quite a mess.
New actions. Yes, you can make your own actions.
That is correct. You are no longer limited to the pre made actions! Here is how:
1) Right click like before, but choose 'create custom action' Name it "kill X units"
2) Now you have a lot of options in the top right corner. Don't get overwhelmed, its simple. Right click on "parameter" and choose "add new parameter"
3) Parameters are like variables the user can change when he/she uses the action, like the variable in 'set variable' or the words to be used in "send transmission". Set this parameter to an integer value. Here you can set minimum, maximum, and alot of other options for the allowable imput, but leave it for now.
4) Now go the actions part and add an action, just like in a normal trigger. Add "pick each unit in unit group". Set the group to 'units in region matching condition'. Then change "at most any amount" to your parameter. So click on any amount, choose the parameter tab, and pick your parameter.
5) Now add (under the 'pick units and do actions') kill unit (picked unit).
6) IF you want, change the grammar text field to "Kill X units". Then highlight X with your mouse and select your parameter at the bottom. This way, X will be what you click on to pick the number of units to kill. This is optional, but it looks nicer.
7) Thats it! Your action will now let you enter a number, and then it kills up to that many units randomly. Try it! Go to the default melee initialization trigger and add your action. It will be located under the "general" category. Cool, huh?
How actions can actually help you
Lets say you were using a combination of 20 actions over and over in multiple triggers. Just add all those actions into a brand new action, and use the new one in all your triggers. It saves you alot of effort. For example, you could use this custom action we made when ever the player had more than 20 units.
A quick note about what I left out
1)Presets are handy when used to make your own actions. I don't fully understand them yet, but for example, lets say you had pres1. (a preset). Inside it were the values "lol","rofl",and,"brb". You can make the value of a parameter in your action a preset. So the user will choose either lol rofl or brb when they are using the action. Again, I don't fully understand presets yet. I might explain them later when I figure them out..
2) I believe it is also possible to create your own CONDITIONS and EVENTS!!! Now, I have clue how these work, but you create one just like actions. Sorry, again, I'll add them in here if I figure them out.
Closing Remarks
This is almost everything thats new about the trigger editor. It is a bit different than wc3, I know. I hated it at first, but now I'm in love with it. I cant even use wc3 editor any more because of how clunky the trigger editor it is compared to this. Trust me, its a really nice new system. Good Luck!
random fact for this tutorial- Did you know that the most money ever paid for a cow in an auction was $1.3 million. :D
Oh really? lol..I used it a bunch but I dont remember that...hmm...Oh well, I will leave it in my tutorial because its usefull info for newbies anyway.
Rollback Post to RevisionRollBack
Feel free to Send me a PM if you have any questions/concerns!
Transitioning from wc3 editor to sc2 editor
By zeldarules28
Note- you don't have to do part 1 to start this! This is a part 2 to my previous tutorial. This is meant for people who understood the Warcraft 3 World Editor and would like to move on to Galaxy Editor. What will be covered in this part- differences in the new trigger system from the old one part 1- http://forums.sc2mapster.com/resources/tutorials/5868-data-moving-from-world-editor-to-galaxy-editor-part/
part 2- this tutorial
part 3- http://forums.sc2mapster.com/resources/tutorials/6610-data-moving-from-wc3-editor-to-sc2-editor-part-3-abilties/
part 4- http://forums.sc2mapster.com/resources/tutorials/7199-data-moving-from-wc3-editor-to-sc2-editor-part-4-upgrades/
part 5- http://forums.sc2mapster.com/resources/tutorials/8014-data-moving-from-wc3-editor-to-sc2-editor-part-5-custom/
The new Trigger System
Open up your map and hit F6 to open the trigger editor. The basics of the system are still the same. Events trigger the actions, as long as all the conditions are met.
First Things you will see different
1) To edit data fields in triggers, you will use the nice little box at the bottom of the window instead of double clicking on the event to edit it.
2) The search box is much more easily accessible now. Its always in the top of the event box.
3) Local Variables!! There is a section for them right under events. These are so nice, but I'll get to them later.
The awesomeness of Local Variables
note- I have been told these were usable in wc3 editor but only through code. This is still helpful info, anyway.
What is a local variable? It is basically a variable just like the ones from wc3, but it is unique to that trigger. So basically, lets say you wanted a trigger that picks 5 units for the triggering player, assigns them to a variable, and then moves them all somewhere. Well in Warcraft 3, if multiple people triggered this, the variable would be assigned a new set of units and mess up the trigger. But if you have a local variable, it is unique to each time the trigger is run. So you could have 10 of the same trigger running at the same time, and only need 1 local variable.
How you can use local variables
You can use them for something as simple as a loop. Make a local variable called X. Then add the event 'for each integer'. You can use X for this integer. This would be a problem back in the days of wc3, because the variable would get reset to 1 if another player ran the trigger half way through.
Records
These are basically a tool to organize your global variables. Global variables (to clarify) are just normal variables, like in wc3. Think of records as a box that hold other variables, like a folder. SO you can put, lets say, 10 integer values in the record 'rec1'. All you have to do to use these is this: 1) Right click on the left half on the window (where the trigger list was in wc3) and click "new record."
2) Select the record and you can add variables to it in the top right part of the window.
3) Right click on the left side again, and hit 'add variable'
4) Set the variable type to Record, nae it rec1
5) it will automatically link the variable and the record together for you if you only have 1 record. otherwise, just select the record you want.
6) To use the record, for example you can use the set variable action. Set variable 'rec1' and member 'your variable here' to 3. By member, I mean any variable inside the record.
How records can help you
They are more of an organization tool. You can do anything without records you can do with them. But say you had 100 integer variables for your TD map. Since variables are now displayed along side triggers, that would be quite a mess.
New actions. Yes, you can make your own actions.
That is correct. You are no longer limited to the pre made actions! Here is how:
1) Right click like before, but choose 'create custom action' Name it "kill X units"
2) Now you have a lot of options in the top right corner. Don't get overwhelmed, its simple. Right click on "parameter" and choose "add new parameter"
3) Parameters are like variables the user can change when he/she uses the action, like the variable in 'set variable' or the words to be used in "send transmission". Set this parameter to an integer value. Here you can set minimum, maximum, and alot of other options for the allowable imput, but leave it for now.
4) Now go the actions part and add an action, just like in a normal trigger. Add "pick each unit in unit group". Set the group to 'units in region matching condition'. Then change "at most any amount" to your parameter. So click on any amount, choose the parameter tab, and pick your parameter.
5) Now add (under the 'pick units and do actions') kill unit (picked unit).
6) IF you want, change the grammar text field to "Kill X units". Then highlight X with your mouse and select your parameter at the bottom. This way, X will be what you click on to pick the number of units to kill. This is optional, but it looks nicer.
7) Thats it! Your action will now let you enter a number, and then it kills up to that many units randomly. Try it! Go to the default melee initialization trigger and add your action. It will be located under the "general" category. Cool, huh?
How actions can actually help you
Lets say you were using a combination of 20 actions over and over in multiple triggers. Just add all those actions into a brand new action, and use the new one in all your triggers. It saves you alot of effort. For example, you could use this custom action we made when ever the player had more than 20 units.
A quick note about what I left out
1)Presets are handy when used to make your own actions. I don't fully understand them yet, but for example, lets say you had pres1. (a preset). Inside it were the values "lol","rofl",and,"brb". You can make the value of a parameter in your action a preset. So the user will choose either lol rofl or brb when they are using the action. Again, I don't fully understand presets yet. I might explain them later when I figure them out..
2) I believe it is also possible to create your own CONDITIONS and EVENTS!!! Now, I have clue how these work, but you create one just like actions. Sorry, again, I'll add them in here if I figure them out.
Closing Remarks
This is almost everything thats new about the trigger editor. It is a bit different than wc3, I know. I hated it at first, but now I'm in love with it. I cant even use wc3 editor any more because of how clunky the trigger editor it is compared to this. Trust me, its a really nice new system. Good Luck!
random fact for this tutorial- Did you know that the most money ever paid for a cow in an auction was $1.3 million. :D
reseved in case I need more space<<
comments? questions? requests?
Nice, short tutorial. Keep making these and maybe even add their content to the main wiki? These sorts of intro explanations are good.
Thanks! I was fairly confused when I moved from wc3 editor to sc2, so I am making these to help out people who have similar trouble.
I'm pretty sure WC3 had local variables, actually. Not as easy to use as these though.
Oh really? lol..I used it a bunch but I dont remember that...hmm...Oh well, I will leave it in my tutorial because its usefull info for newbies anyway.
Yes, you could use local variables in WC3, but only via Custom Script/JASS.
Anyway, nice tutorial.
good tutorial really helpfull. It will really help me in my mapmaking. thx
:) Glad to Help