I asked this question a little bit ago, but I guess the wording was way too confusing, so I'm going to try again.
I have this ability that when you cast it, it makes a dummy unit at the location of the target. This unit must now follow around the target unit. I'm not meaning the WC3 "Follow" command, but every .02 second or something, move the dummy unit to the target unit.
If you need an example, look and Naix's ulti from DotA; it creates a dummy unit above a creeps and it follow it around.
The look I'm trying to go for is like a regular buff. BUT it's actually a dummy unit on top of a regular unit.
Second: I was there be more than one of these. This means that if I cast the spell on another unit, another dummy is created and every .02 seconds is moved to its target.
Third: I was 10 max of these at a time. This means that if you cast an 11th time, the oldest dummy will go away. But the dummy unit will also be removed if another unit gets too close. So the oldest dummy is not always being removed; there are other cases.
My attempt included an array of units for the dummies, and an array of units for the targets. Then every .02 seconds dummy[x] was moved to location of target[x]. This worked, but had the possibly for terrible memory crashes, because it was constantly overrunning the array. This method would need to include a way to removed specific units from the arrays, and resort the arrays. Or, when units are removed, new one are put into the empty spots in the arrays, and a check must be done for the oldest units to be removed when an 11th one needs to be added.
I hope this is somewhat understandable because it is a pretty complicated question. I'm sure this would be much easier in JASS than GUI, and I'm willing to learn JASS to do it. I'm just not looking forwards to having to write a linked list in JASS.
I have this ability that when you cast it, it makes a dummy unit at the location of the target. This unit must now follow around the target unit. I'm not meaning the WC3 "Follow" command, but every .02 second or something, move the dummy unit to the target unit.
If you need an example, look and Naix's ulti from DotA; it creates a dummy unit above a creeps and it follow it around.
The look I'm trying to go for is like a regular buff. BUT it's actually a dummy unit on top of a regular unit.
Second: I was there be more than one of these. This means that if I cast the spell on another unit, another dummy is created and every .02 seconds is moved to its target.
Third: I was 10 max of these at a time. This means that if you cast an 11th time, the oldest dummy will go away. But the dummy unit will also be removed if another unit gets too close. So the oldest dummy is not always being removed; there are other cases.
My attempt included an array of units for the dummies, and an array of units for the targets. Then every .02 seconds dummy[x] was moved to location of target[x]. This worked, but had the possibly for terrible memory crashes, because it was constantly overrunning the array. This method would need to include a way to removed specific units from the arrays, and resort the arrays. Or, when units are removed, new one are put into the empty spots in the arrays, and a check must be done for the oldest units to be removed when an 11th one needs to be added.
I hope this is somewhat understandable because it is a pretty complicated question. I'm sure this would be much easier in JASS than GUI, and I'm willing to learn JASS to do it. I'm just not looking forwards to having to write a linked list in JASS.