# [Trigger]Multiple indexes?

Status
Not open for further replies.

#### Kazemaru

Level 5
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...

#### GhostWolf

Level 29
There are no problems with loops. There were problems with your code.

#### Kazemaru

Level 5
Well that was what i was trying to say but 26 hours without sleep is kinda hard xD Well, how to make codes "right" ?

#### Squiggy

Level 28
• 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]] )
?

#### Kazemaru

Level 5
Oooh! Genious! how i didnt think about that?

But how to use it later?

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:

#### Squiggy

Level 28
• Set AB_Point[AB_Index[2]] = (Position of AB_Dummy[(AB_Index[2] + INDEX)])
• Set INDEX = INDEX + 1
Like this?
I think it will count up the array indexes and do the appropriate stuff - if I'm not mistaken

On a side note:
2000 POSTS!

#### Kazemaru

Level 5
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

#### Squiggy

Level 28
Umm.. if you're referring to that indexing system.. I'm out ^.^

#### Kazemaru

Level 5
Well i fixed it long time ago and now it works perfectly. Now what i have to do is multiple leveling and when user stops channeling ^^

Status
Not open for further replies.

Replies
12
Views
899
Replies
13
Views
898
[Trigger] Cooldown Bug
Replies
6
Views
632
[Trigger] Spell Trouble
Replies
2
Views
467
Replies
5
Views
419