Hi !
I got a trigger triggered by an unit die
I got an array of unit type
I want to increase the player score with the index of the unit type dying
But how i can get the index of an array, i'm not realy good in english so i probably missed it.
Thanks !
Hi ! I got a trigger triggered by an unit die I got an array of unit type I want to increase the player score with the index of the unit type dying But how i can get the index of an array, i'm not realy good in english so i probably missed it. Thanks !
Run a loop through the array to see if the unit type of the triggering unit matches the index of the array, when it does add that index.
Still alive and kicking, just busy.
My guide to the trigger editor (still a work in progress)
thanks ! Tought there was some built-in function to do that :<.
But why do you use array index for it? Running loop every time will cost a lot of perfomance...
I have a array of unit type, the index of the unit type represent his "level"
So, you can write level in custom value of unit or in cost of unit type (custom resource cost for example, if others is used).