Handling moving of a list of units

M4573R

New Member
Reaction score
1
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.
 

Pharaoh_

The epic journey will soon begin... Prepare!
Reaction score
136
For your first question, i think buff detection is way easier in Jass. Because you can remove specific buffs, not any type of buff. You can only remove all the buffs by GUI i think if that 11th is applied. I don't know if this works, try it:
Code:
Set buff[1] = buff[11]

Second question, when the units die, the buff also "dies", so i don't get your problem.
 

M4573R

New Member
Reaction score
1
Well what tried to say is that I'm not using actual wc3 buffs. I'm using a dummy unit being positioned over a unit every time interval. This is so I can make the buff invisible to the enemy.
 

Pharaoh_

The epic journey will soon begin... Prepare!
Reaction score
136
How exactly then the main unit will be affected by the other unit's buff? Remember they are seperate. In order for the other unit to be affected as well, you will need to make it based off an AoE passive, which will also affect other units and will be visible to enemies.
 

M4573R

New Member
Reaction score
1
Let me try to be clear. There is no WC3 buff. The unit doesn't not have a little image at the bottom of the screen. I said that when I say "buff" i mean the dummy unit. Think of Naix's ulti in dota if you know it. It creates a little dummy unit above the creep that follows him around and the enemy can't see it. Its art for a "buff".

As much as this is confusing, it doesn't even matter. My original question is how to handle moving a list of units along with another list of units.

Example: You cast dummy spell on a unit. A dummy unit with some model is placed AT the target unit. This dummy unit must now follow around the target. It will look like a "buff".
Now you cast it again on someone else. Another dummy unit is created on the target and it must follow that target around.

I want it so you can have a maximum of 10 of these "buffs" following people around.
 
General chit-chat
Help Users
  • No one is chatting at the moment.

      The Helper Discord

      Members online

      No members online now.

      Affiliates

      Hive Workshop NUON Dome World Editor Tutorials

      Network Sponsors

      Apex Steel Pipe - Buys and sells Steel Pipe.
      Top