[Trigger] Multiple indexes?

Status
Not open for further replies.
Level 5
Joined
May 27, 2008
Messages
62
I need many units in my spell and each unit variable is important but there is a one little problem... I dont know how to make many unit indexes on time and i dont wanna make bout 28 variables for one unit... Could some one help me?

  • Then - Actions
    • Set AB_Point2[AB_Index[2]] = (AB_Point[AB_Index[2]] offset by (400.00 x (Real((Level of Arcanic Barrier for AB_Caster[AB_Index[2]])))) towards 0.00 degrees)
    • Unit - Create 1 AB_Dummy for (Owner of AB_Caster[AB_Index[2]]) at AB_Point2[AB_Index[2]] facing AB_Point[AB_Index[2]]
    • Set AB_Dummy[(AB_Index[2] + 1)] = (Last created unit)
    • Custom script: call RemoveLocation( udg_AB_Point2[udg_AB_Index[2]] )
    • Set AB_Point2[AB_Index[2]] = (AB_Point[AB_Index[2]] offset by (400.00 x (Real((Level of Arcanic Barrier for AB_Caster[AB_Index[2]])))) towards 20.00 degrees)
    • Unit - Create 1 AB_Dummy for (Owner of AB_Caster[AB_Index[2]]) at AB_Point2[AB_Index[2]] facing AB_Point[AB_Index[2]]
    • Set AB_Dummy[(AB_Index[2] + 2)] = (Last created unit)
    • Custom script: call RemoveLocation( udg_AB_Point2[udg_AB_Index[2]] )
    • Set AB_Point2[AB_Index[2]] = (AB_Point[AB_Index[2]] offset by (400.00 x (Real((Level of Arcanic Barrier for AB_Caster[AB_Index[2]])))) towards 40.00 degrees)
    • Unit - Create 1 AB_Dummy for (Owner of AB_Caster[AB_Index[2]]) at AB_Point2[AB_Index[2]] facing AB_Point[AB_Index[2]]
    • Set AB_Dummy[(AB_Index[2] + 3)] = (Last created unit)
    • Custom script: call RemoveLocation( udg_AB_Point2[udg_AB_Index[2]] )
    • Set AB_Point2[AB_Index[2]] = (AB_Point[AB_Index[2]] offset by (400.00 x (Real((Level of Arcanic Barrier for AB_Caster[AB_Index[2]])))) towards 60.00 degrees)
    • Unit - Create 1 AB_Dummy for (Owner of AB_Caster[AB_Index[2]]) at AB_Point2[AB_Index[2]] facing AB_Point[AB_Index[2]]
    • Set AB_Dummy[(AB_Index[2] + 4)] = (Last created unit)
    • Custom script: call RemoveLocation( udg_AB_Point2[udg_AB_Index[2]] )
    • Set AB_Point2[AB_Index[2]] = (AB_Point[AB_Index[2]] offset by (400.00 x (Real((Level of Arcanic Barrier for AB_Caster[AB_Index[2]])))) towards 80.00 degrees)
    • Unit - Create 1 AB_Dummy for (Owner of AB_Caster[AB_Index[2]]) at AB_Point2[AB_Index[2]] facing (Facing of AB_Caster[AB_Index[2]]) degrees
    • Set AB_Dummy[(AB_Index[2] + 5)] = (Last created unit)
    • Custom script: call RemoveLocation( udg_AB_Point2[udg_AB_Index[2]] )
    • Set AB_Point2[AB_Index[2]] = (AB_Point[AB_Index[2]] offset by (400.00 x (Real((Level of Arcanic Barrier for AB_Caster[AB_Index[2]])))) towards 100.00 degrees)
    • Unit - Create 1 AB_Dummy for (Owner of AB_Caster[AB_Index[2]]) at AB_Point2[AB_Index[2]] facing AB_Point[AB_Index[2]]
    • Set AB_Dummy[(AB_Index[2] + 6)] = (Last created unit)
    • Custom script: call RemoveLocation( udg_AB_Point2[udg_AB_Index[2]] )
    • Set AB_Point2[AB_Index[2]] = (AB_Point[AB_Index[2]] offset by (400.00 x (Real((Level of Arcanic Barrier for AB_Caster[AB_Index[2]])))) towards 120.00 degrees)
    • Unit - Create 1 AB_Dummy for (Owner of AB_Caster[AB_Index[2]]) at AB_Point2[AB_Index[2]] facing AB_Point[AB_Index[2]]
    • Set AB_Dummy[(AB_Index[2] + 7)] = (Last created unit)
    • Custom script: call RemoveLocation( udg_AB_Point2[udg_AB_Index[2]] )
    • Set AB_Point2[AB_Index[2]] = (AB_Point[AB_Index[2]] offset by (400.00 x (Real((Level of Arcanic Barrier for AB_Caster[AB_Index[2]])))) towards 140.00 degrees)
    • Unit - Create 1 AB_Dummy for (Owner of AB_Caster[AB_Index[2]]) at AB_Point2[AB_Index[2]] facing AB_Point[AB_Index[2]]
    • Set AB_Dummy[(AB_Index[2] + 8)] = (Last created unit)
    • Custom script: call RemoveLocation( udg_AB_Point2[udg_AB_Index[2]] )
    • Set AB_Point2[AB_Index[2]] = (AB_Point[AB_Index[2]] offset by (400.00 x (Real((Level of Arcanic Barrier for AB_Caster[AB_Index[2]])))) towards 160.00 degrees)
    • Unit - Create 1 AB_Dummy for (Owner of AB_Caster[AB_Index[2]]) at AB_Point2[AB_Index[2]] facing AB_Point[AB_Index[2]]
    • Set AB_Dummy[(AB_Index[2] + 9)] = (Last created unit)
    • Custom script: call RemoveLocation( udg_AB_Point2[udg_AB_Index[2]] )
    • Set AB_Point2[AB_Index[2]] = (AB_Point[AB_Index[2]] offset by (400.00 x (Real((Level of Arcanic Barrier for AB_Caster[AB_Index[2]])))) towards 180.00 degrees)
    • Unit - Create 1 AB_Dummy for (Owner of AB_Caster[AB_Index[2]]) at AB_Point2[AB_Index[2]] facing AB_Point[AB_Index[2]]
    • Set AB_Dummy[(AB_Index[2] + 10)] = (Last created unit)
    • Custom script: call RemoveLocation( udg_AB_Point2[udg_AB_Index[2]] )
    • Set AB_Point2[AB_Index[2]] = (AB_Point[AB_Index[2]] offset by (400.00 x (Real((Level of Arcanic Barrier for AB_Caster[AB_Index[2]])))) towards 200.00 degrees)
    • Unit - Create 1 AB_Dummy for (Owner of AB_Caster[AB_Index[2]]) at AB_Point2[AB_Index[2]] facing AB_Point[AB_Index[2]]
    • Set AB_Dummy[(AB_Index[2] + 11)] = (Last created unit)
    • Custom script: call RemoveLocation( udg_AB_Point2[udg_AB_Index[2]] )
    • Set AB_Point2[AB_Index[2]] = (AB_Point[AB_Index[2]] offset by (400.00 x (Real((Level of Arcanic Barrier for AB_Caster[AB_Index[2]])))) towards 220.00 degrees)
    • Unit - Create 1 AB_Dummy for (Owner of AB_Caster[AB_Index[2]]) at AB_Point2[AB_Index[2]] facing AB_Point[AB_Index[2]]
    • Set AB_Dummy[(AB_Index[2] + 12)] = (Last created unit)
    • Custom script: call RemoveLocation( udg_AB_Point2[udg_AB_Index[2]] )
    • Set AB_Point2[AB_Index[2]] = (AB_Point[AB_Index[2]] offset by (400.00 x (Real((Level of Arcanic Barrier for AB_Caster[AB_Index[2]])))) towards 240.00 degrees)
    • Unit - Create 1 AB_Dummy for (Owner of AB_Caster[AB_Index[2]]) at AB_Point2[AB_Index[2]] facing AB_Point[AB_Index[2]]
    • Set AB_Dummy[(AB_Index[2] + 13)] = (Last created unit)
    • Custom script: call RemoveLocation( udg_AB_Point2[udg_AB_Index[2]] )
    • Set AB_Point2[AB_Index[2]] = (AB_Point[AB_Index[2]] offset by (400.00 x (Real((Level of Arcanic Barrier for AB_Caster[AB_Index[2]])))) towards 260.00 degrees)
    • Unit - Create 1 AB_Dummy for (Owner of AB_Caster[AB_Index[2]]) at AB_Point2[AB_Index[2]] facing AB_Point[AB_Index[2]]
    • Set AB_Dummy[(AB_Index[2] + 14)] = (Last created unit)
    • Custom script: call RemoveLocation( udg_AB_Point2[udg_AB_Index[2]] )
    • Set AB_Point2[AB_Index[2]] = (AB_Point[AB_Index[2]] offset by (400.00 x (Real((Level of Arcanic Barrier for AB_Caster[AB_Index[2]])))) towards 280.00 degrees)
    • Unit - Create 1 AB_Dummy for (Owner of AB_Caster[AB_Index[2]]) at AB_Point2[AB_Index[2]] facing AB_Point[AB_Index[2]]
    • Set AB_Dummy[(AB_Index[2] + 15)] = (Last created unit)
    • Custom script: call RemoveLocation( udg_AB_Point2[udg_AB_Index[2]] )
    • Set AB_Point2[AB_Index[2]] = (AB_Point[AB_Index[2]] offset by (400.00 x (Real((Level of Arcanic Barrier for AB_Caster[AB_Index[2]])))) towards 300.00 degrees)
    • Unit - Create 1 AB_Dummy for (Owner of AB_Caster[AB_Index[2]]) at AB_Point2[AB_Index[2]] facing AB_Point[AB_Index[2]]
    • Set AB_Dummy[(AB_Index[2] + 16)] = (Last created unit)
    • Custom script: call RemoveLocation( udg_AB_Point2[udg_AB_Index[2]] )
    • Set AB_Point2[AB_Index[2]] = (AB_Point[AB_Index[2]] offset by (400.00 x (Real((Level of Arcanic Barrier for AB_Caster[AB_Index[2]])))) towards 320.00 degrees)
    • Unit - Create 1 AB_Dummy for (Owner of AB_Caster[AB_Index[2]]) at AB_Point2[AB_Index[2]] facing AB_Point[AB_Index[2]]
    • Set AB_Dummy[(AB_Index[2] + 17)] = (Last created unit)
    • Custom script: call RemoveLocation( udg_AB_Point2[udg_AB_Index[2]] )
    • Set AB_Point2[AB_Index[2]] = (AB_Point[AB_Index[2]] offset by (400.00 x (Real((Level of Arcanic Barrier for AB_Caster[AB_Index[2]])))) towards 340.00 degrees)
    • Unit - Create 1 AB_Dummy for (Owner of AB_Caster[AB_Index[2]]) at AB_Point2[AB_Index[2]] facing AB_Point[AB_Index[2]]
    • Set AB_Dummy[(AB_Index[2] + 18)] = (Last created unit)
    • Custom script: call RemoveLocation( udg_AB_Point2[udg_AB_Index[2]] )
And there is a problem in loops... This is what i tryed but those Index + numbers doesnt seem to work... Could anyone help me?

And as you can see, it would be a BIG waist for making everyone their own variable...
 
Level 28
Joined
Mar 25, 2008
Messages
2,955
  • For each Integer A from 1 to 18 do:
    • Set AB_Point2[AB_Index[2]] = (AB_Point[AB_Index[2]] offset by (400.00 x (Real((Level of Arcanic Barrier for AB_Caster[AB_Index[2]])))) towards (Integer A x 20) degrees)
    • Unit - Create 1 AB_Dummy for (Owner of AB_Caster[AB_Index[2]]) at AB_Point2[AB_Index[2]] facing AB_Point[AB_Index[2]]
    • Set AB_Dummy[(AB_Index[2] + Integer A)] = (Last created unit)
    • Custom script: call RemoveLocation( udg_AB_Point2[udg_AB_Index[2]] )
?
 
Level 5
Joined
May 27, 2008
Messages
62
Oooh! Genious! how i didnt think about that? :D


But how to use it later? o_O

Here is crappy example:
  • Channeling
    • Events
      • Time - Every 1.00 seconds of game time
    • Conditions
    • Actions
      • Set AB_Point[AB_Index[2]] = (Position of AB_Dummy[(AB_Index[2] + 1)])
      • Unit - Create 1 Footman for Player 1 (Red) at AB_Point[AB_Index[2]] facing Default building facing degrees
 
Last edited:
Level 5
Joined
May 27, 2008
Messages
62
Oh, I found away to make this right. look what i did wrong:
  • Then - Actions
    • Set AB_Index[1] = (AB_Index[1] + 1)
    • Set AB_Index[2] = (AB_Index[2] + 1)
    • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
      • If - Conditions
        • AB_Index[1] Not equal to 1
      • Then - Actions
        • Trigger - Turn on Channeling <gen>
      • Else - Actions
Epic faillllll
 
Status
Not open for further replies.
Top