So I have 8 types of towers, and 5 lvls of the each tower, all together 40 towers. Im wondering how I can put all of lvl 1 into unitGroupOne, all of lvl 2 into unitGroupTwo, all of lvl 3 into unitGroupThree, all of lvl 4 into unitGroupFour, all of lvl 5 into unitGroupFive.
Im trying to do this before the game has started without any structures being built.
you cant put unit types into a unit group, and you cant put a unit into a unit group until its built
you would have to add a newly built tower into a unit group each time.
and every time you upgrade a tower, remove it from the previous level unit group and add it to the next(im not sure if units stay in a unit group after they morph/upgrade)
I think we described 2 different things
what i described was storing the actual units into a variable
you described storing each type of tower into a variable
Both methods should work, it depends on what he wants to do with it exactly
So I have 8 types of towers, and 5 lvls of the each tower, all together 40 towers. Im wondering how I can put all of lvl 1 into unitGroupOne, all of lvl 2 into unitGroupTwo, all of lvl 3 into unitGroupThree, all of lvl 4 into unitGroupFour, all of lvl 5 into unitGroupFive.
Im trying to do this before the game has started without any structures being built.
any help is appreciated.
you cant put unit types into a unit group, and you cant put a unit into a unit group until its built
you would have to add a newly built tower into a unit group each time.
and every time you upgrade a tower, remove it from the previous level unit group and add it to the next(im not sure if units stay in a unit group after they morph/upgrade)
@gizmachu: Go
If you want to make a group of the types, make an array like this:
TowerLevels[x][y] (variable type: unit type)
where x is the number of levels, and y the number of towers in the level.
Then you add towers of level 1 in TowerLevels[1][y], and level 2 towers in TowerLevels[2][y], giving different values to the y.
Finally, if you want to check the level of a tower, you search it in the array, and if you find it, return the x.
I used something like this to check items before stacking them in Warcraft 3, and it worked fine.
@Lonami:
I think we described 2 different things
what i described was storing the actual units into a variable
you described storing each type of tower into a variable
Both methods should work, it depends on what he wants to do with it exactly
@gizmachu: Go
Actually your wrong entirely, I figured out how to add unit types to a unit group.
@Lonami: Go
Im not really sure that method would work for how I need it but I can give it a shot if what I did doesnt work.