• Listen to a special audio message from Bill Roper to the Hive Workshop community (Bill is a former Vice President of Blizzard Entertainment, Producer, Designer, Musician, Voice Actor) 🔗Click here to hear his message!
  • Read Evilhog's interview with Gregory Alper, the original composer of the music for WarCraft: Orcs & Humans 🔗Click here to read the full interview.

How to prevent abilities from overlapping the position of deleted abilities??

Level 1
Joined
Dec 14, 2024
Messages
4
I add abilities to a unit, and when I delete the first ability, the other abilities automatically move to the position of the deleted ability. How can I prevent the other abilities from moving when one is deleted?
 

Attachments

  • Untitled.png
    Untitled.png
    35.1 KB · Views: 6
  • Untitled2.png
    Untitled2.png
    23.6 KB · Views: 7

Uncle

Warcraft Moderator
Level 73
Joined
Aug 10, 2018
Messages
7,866
Abilities will be positioned based on their Art - Button Position - XY values. This can be changed in the Object Editor under the Abilities section for every single ability. Note how ultimate abilities like Earthquake have an Art - Button Position - X of 3, this means that they move 3 tiles to the right.

If two abilities share the same position then they will "fight" for that position. Whichever ability appears in the Abilities list first will take priority and shove the others away.

X,Y values:
0,0 is the top left, 3,0 is the top right.
1,1 is the middle left, 3,1 is the middle right.
0,2 is the bottom left, 3,2 is bottom right.
 
Level 1
Joined
Dec 14, 2024
Messages
4
Abilities will be positioned based on their Art - Button Position - XY values. This can be changed in the Object Editor under the Abilities section for every single ability. Note how ultimate abilities like Earthquake have an Art - Button Position - X of 3, this means that they move 3 tiles to the right.

If two abilities share the same position then they will "fight" for that position. Whichever ability appears in the Abilities list first will take priority and shove the others away.

X,Y values:
0,0 is the top left, 3,0 is the top right.
1,1 is the middle left, 3,1 is the middle right.
0,2 is the bottom left, 3,2 is bottom right.
that's not it. I add random abilities like in the Tower Survivors map, and each time I press, they don't move and overlap
 

Uncle

Warcraft Moderator
Level 73
Joined
Aug 10, 2018
Messages
7,866
that's not it. I add random abilities like in the Tower Survivors map, and each time I press, they don't move and overlap
No, that's exactly it. They're always going to move to wherever you set their X/Y values - or at least try to.

You can try to change the Button positions using triggers, there's an Action for it but I remember it having issues.
 
Last edited:
Level 1
Joined
Dec 14, 2024
Messages
4
No, that's exactly it. They're always going to move to wherever you set their X/Y values - or at least try to.

You can try to change the Button positions using triggers, there's an Action for it but I remember it having issues.
Can you watch the Tower Survivors map video, when pressed it doesn't overlap. How to do that? Or do I have to make 8 items like that, each with a button position?
 

Uncle

Warcraft Moderator
Level 73
Joined
Aug 10, 2018
Messages
7,866
Can you watch the Tower Survivors map video, when pressed it doesn't overlap. How to do that? Or do I have to make 8 items like that, each with a button position?
What do you mean by pressed? Does pressing the ability delete it? In other words, when you cast the ability it's removed from the unit.

Anyway, you can give each ability a different X/Y value, that's how all Hero abilities work in Warcraft 3.

But if the abilities are added randomly with triggers then it becomes difficult since some will likely share the same x/y values.

In that case you can try to use the Action I mentioned before to reposition them. It's not too difficult to keep track of what Abilities a unit has in a Hashtable for example. Making 8 versions of each ability (or item?) could work as well but that's a pain in the ass.
 
Last edited:
Level 1
Joined
Dec 14, 2024
Messages
4
Yes, I have tried adding items, units, and abilities. When pressed, they will be deleted. But everything moves and overlaps. Can you show me how to assign X/Y coordinates for each ability?
 

Uncle

Warcraft Moderator
Level 73
Joined
Aug 10, 2018
Messages
7,866
Yes, I have tried adding items, units, and abilities. When pressed, they will be deleted. But everything moves and overlaps. Can you show me how to assign X/Y coordinates for each ability?
Object Editor -> Abilities -> Find your ability -> Change the Art - Button Positions.
 
Top