Temporary vars don't need arraysfor temporary vars, use arrays.
Define temporary...for temporary vars, use arrays.
Temporary vars don't need arrays
Temporary vars don't need arrays
For the most part, I only use arrays when they are needed (if I needed to store a bundle of strings for randomized death messages, or something) - if variables are only being used temporarily, arrays aren't really needed since you're not going to overwrite values unless you fool around with waits
p1 and 2
Events
Unit - A unit enters Region 005 Copy 2 <gen>
Conditions
(Custom value of (Triggering unit)) Equal to 1
(Owner of (Triggering unit)) Equal to Player 9 (Gray)
Actions
Set temp_int[9] = (Random integer number between 3 and 8)
Set temp_int[10] = 0
For each (Integer A) from 1 to 8, do (Actions)
Loop - Actions
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
((Player((Integer A))) slot status) Equal to Is playing
Then - Actions
Set temp_int[(Integer A)] = (Integer A)
Else - Actions
Set temp_int[(Integer A)] = 0
For each (Integer B) from 1 to 8, do (Actions)
Loop - Actions
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
temp_int[9] Equal to temp_int[(Integer B)]
Then - Actions
Set temp_int[10] = 1
Else - Actions
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
And - All (Conditions) are true
Conditions
(Integer B) Equal to 8
temp_int[10] Not equal to 1
Then - Actions
Set temp_int[9] = (Random integer number between 3 and 8)
Trigger - Run (This trigger) (ignoring conditions)
Skip remaining actions
Else - Actions
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
temp_int[9] Equal to 2
Then - Actions
Set temp_int[9] = 1
Else - Actions
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
temp_int[9] Equal to 1
Then - Actions
Set temp_int[9] = 1
Else - Actions
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
temp_int[9] Equal to 3
Then - Actions
Set temp_int[9] = 2
Else - Actions
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
temp_int[9] Equal to 4
Then - Actions
Set temp_int[9] = 2
Else - Actions
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
temp_int[9] Equal to 5
Then - Actions
Set temp_int[9] = 3
Else - Actions
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
temp_int[9] Equal to 6
Then - Actions
Set temp_int[9] = 3
Else - Actions
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
temp_int[9] Equal to 7
Then - Actions
Set temp_int[9] = 4
Else - Actions
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
temp_int[9] Equal to 8
Then - Actions
Set temp_int[9] = 4
Else - Actions
Unit - Move (Triggering unit) instantly to (Center of tel_1_reg[temp_int[9]]), facing (90.00 x ((Real(temp_int[9])) + 2.00)) degrees
Set temp_point[1] = (Position of (Triggering unit))
Special Effect - Create a special effect at temp_point[1] using Abilities\Spells\Human\MassTeleport\MassTeleportCaster.mdl
Special Effect - Destroy (Last created special effect)
Custom script: call RemoveLocation(udg_temp_point[1])
Wait (Random real number between 1.00 and 5.00) seconds
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
((Triggering unit) is alive) Equal to True
Then - Actions
Set temp_point[1] = (Position of (Triggering unit))
Special Effect - Create a special effect attached to the origin of (Triggering unit) using Abilities\Spells\Other\Doom\DoomTarget.mdl
Special Effect - Destroy (Last created special effect)
Unit - Set life of (Triggering unit) to ((Percentage life of (Triggering unit)) + 7.50)%
Custom script: call RemoveLocation(udg_temp_point[1])
Unit - Set the custom value of (Triggering unit) to 10
Else - Actions
Set TempLoc = Position of (Triggering Unit)
Create 1 Dummy for (Owner of (Triggering Unit)) at TempLoc facing (Default building facing) degrees
Order (Last Created Unit) to Human Mountain King - Storm Bolt (Target Unit of Ability Being Cast)
Add a 3.00 second Generic expiration timer to (Last Created Unit)
Custom script: call RemoveLocation (udg_TempLoc)
(In most cases) the size specified doesn't make a difference - that only determines how many of the array indexes are initialized to a value, and that doesn't really matter with most types other than unit groups (if you are using the groups for 'long-term' storage), timers (since they have to be created before being used, and if you don't specify an adequate array size you will be starting non-existant timers) and, possibly, player groups (not sure about these)i usually make my temp's arrays of size 100
Set unitgroup[3523] = (Units in (Playable map area))
Unit Group - Pick every unit in (Units in (Playable map area)) and do (Unit Group - Add (Picked unit) to unitgroup[232])