So I have an ability that creates a unit at the position of the target. This unit's position needs to be updated every increment of time to the position of the target so that it follows it. Its basically a buff that is a unit.
First problem is, I want to be able to have 10 max buffs. So when you create an 11th one, the first one should get deleted.
Second problem is, how do I handle each buff storing the unit it is suppose to follow so I can update it every time interval? I was thinking using a couple arrays (one for buffs, another for units to follow in matching order) , but then when units die, the buffs need to be deleted, so there's holes in the array, and new buffs need to fills these holes..... blah blah awful. I was looking into some kind of data attachment using JASS, but I've never touched JASS before. Only thing I can think of is some kind of elaborate homemade GUI vector, but I think that's probably a bad idea.
First problem is, I want to be able to have 10 max buffs. So when you create an 11th one, the first one should get deleted.
Second problem is, how do I handle each buff storing the unit it is suppose to follow so I can update it every time interval? I was thinking using a couple arrays (one for buffs, another for units to follow in matching order) , but then when units die, the buffs need to be deleted, so there's holes in the array, and new buffs need to fills these holes..... blah blah awful. I was looking into some kind of data attachment using JASS, but I've never touched JASS before. Only thing I can think of is some kind of elaborate homemade GUI vector, but I think that's probably a bad idea.