I'm sorry I create lots of topics...I am just very nooby to sc2 editor. :(
How would I create a mothership and have it fly to the middle of the map, then play the Char Artifact animation that will wipe all units on map if there is over 600 units on map?
I think I would need a local Variable? I know in general what to do, but the triggers are so unorganized, I don't know where to find them. :(
So, I know I would need a local Variable that is a integer with a value of 600. I know how to make the mothership spawn using points. I'm not sure how to do the animation tho...Neither do I know how to wipe all the units from the map. :(
Just try what I said. It's using a unit group which selects all of your units, no matter the number, and then iterates them. Note I just realized this'll also include your mothership so you should instead do the following:
set variable "My Variable" (type: unit group) = Units In Region Matching Condition (use region: entire map)
remove unit from unit group (group is your variable, unit is your mothership)
Pick All Units In Unit Group (group is your variable)
* Actions: Kill Unit (Picked Unit)
Just try to make it happen and if you can't find something let me know.
Sorry you should've seen it by just typing "Pick" but it's "Pick Each Unit In Unit Group" there's only 3 "picks", one for each integer, player, and unit.
And for your code, if you're setting the intial value of the variable at the "local variables" section, you don't need to use the "set variable" command later. Also, remember you'll need to make the remove unit remove your "mothership" not the triggering unit (I don't know if you're preplacing or what for where the mothership is). Finally, the kill unit should be "Picked Unit" not "Triggering Unit" and then moved into the actions of your Pick Each
First youll need to define how the units are counted.
Make a GLOBAL variable that is of Integer type. For this example I will name it tempInt.
If you want the count to include pre placed units then you will need to have the 'pick each unit in region(entire map)'. Then in this loop, have an action SET VARIABLE. Make the left side of the = sign, tempInt. Then on the right side go to the MATH category, select the arithmatic(integer) action. You will want to set this to tempInt + 1. Now you have effectively counted all the units on the map. You can add an IF statement there to make the count specific to a type of unit.
Now everytime a unit is created on the map you will want to add that unit to your count. So make a trigger with the EVENT set to 'Unit is created' This is in the UNIT section of trigger Events. Now again, you can set a condition to make this only react when a neutral or hostile unit is created. If you need explaination on that part, ask. Now in your actions portion of this trigger make the set variable command like before, tempInt = tempInt + 1.
You can also make another trigger that has the EVENT 'Unit Dies' and have the action -> tempInt = tempInt - 1.
Now you will need to make a new action that will send your mothership out. Some may suggest have a period timer Event Trigger to check the value of tempInt, but I would just include an IF statement in your unit created Trigger. Here is what I mean...
After your statements in the trigger that says 'Unit is created' in the EVENT line, set a new action 'IF THEN ELSE'. This action is in the GENERAL section of the trigger actions menu. Once this is selected you will need to set the comparison value. This is done in the 'IF' portion. Right click IF and select 'new element'. Once here you can set any comparison of values. Double click value 1 and set this value to the variable tempInt, by selecting the variables tab/dot at the top of the window, you should see it on the list. Now set the second value to 600. Now the operator, I believe default is the equal sign (=). Set this to ">=". This means, Greater Than Or Equal To. The whole If statement will be, "If *tempInt* is greater than or equal to 600 do..."
Now for the do part, after you setup the comparison, the THEN section of the 'IF' statement is where you put the actions that you want to take place if the statement is true. Now this part you will need someone elses advice. I do not know how to setup an animation, well not well enough to teach.