• 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.

Changing an ability but only for a unit

Status
Not open for further replies.
Level 4
Joined
Jun 23, 2016
Messages
65
I'd like to change an ability, but only for a particular unit. This can easily be done with items, but I can't find a way to do it with abilities. With objects I create the item, assign a variable to it and then I'm free to modify the unit's particular item whenever I want.

A workaround would be to manually create copies of the same ability in the ability editor, but that's not very convenient as I'm going to need a ton of them.


Any suggestions? Thank you in advance.
 
Level 7
Joined
Sep 4, 2016
Messages
116
I have two things that come to mind. One is off of your comment on the items. You could have abilities set up to simply be done through items. The other option I know is to use a trigger to detect when a specific unit or unit-type uses the ability, and make an event specific to that.
 

Uncle

Warcraft Moderator
Level 73
Joined
Aug 10, 2018
Messages
7,877
In 1.31+ you can modify abilities through triggers.
 
Level 33
Joined
Mar 27, 2008
Messages
8,035
You mean, more than 1 units share the same ability, but you only want to change how the ability behaves (stats, damage, duration, etc) for a specific unit ?

For example, 2 units share the same Devotion Aura ability (+5 Armor to nearby allies), but one of the unit (the unit that you want to modify its ability) will have its ability change in behaviour to now give +10 Armor now, instead of +5. Is this what you meant ?

For more precise, just give us example on what you are trying to achieve, I would create a test map for you if it's possible, following you exact example.

The way I see it, if the ability is fully-triggered, then it's easier to modify them. But if the effect of the ability comes directly from Object Editor stats, you really need to make each copies of it, separately.
 
Level 4
Joined
Jun 23, 2016
Messages
65
You mean, more than 1 units share the same ability, but you only want to change how the ability behaves (stats, damage, duration, etc) for a specific unit ?

For example, 2 units share the same Devotion Aura ability (+5 Armor to nearby allies), but one of the unit (the unit that you want to modify its ability) will have its ability change in behaviour to now give +10 Armor now, instead of +5. Is this what you meant ?

For more precise, just give us example on what you are trying to achieve, I would create a test map for you if it's possible, following you exact example.

The way I see it, if the ability is fully-triggered, then it's easier to modify them. But if the effect of the ability comes directly from Object Editor stats, you really need to make each copies of it, separately.
Yes, I want to create different effects (and different descriptions) for the same ability. I've managed to change the descriptions with particular items, as you can give it to a unit and then assign this specific item to a variable, but I can't manage to do the same with abilities.

What I'm trying to do is that each unit will have data such as gold, wage, job, happiness, etc. associated to it, and I want a way to display said data.
This item shows the values of other variables that I've associated with the unit, and each time one of these values change, there's an action that re-reads all these values again, updating the item description. Now, I don't like using items because it occupies an inventory slot, and it doesn't make much sense either.

fca75c74c0067d97cb5a38a027b95b4e.png


You don't need to make separate copies of the ability unless you're using an older version.
How would you do a similar thing but with an ability?


Thanks everyone for your answers
 
Level 29
Joined
Sep 26, 2009
Messages
2,596
How would you do a similar thing but with an ability?
In latest versions there are new trigger actions for that - they are under 'Ability' section, but they are clunky and hard to use.
For example the following will update Devotion Aura level 3 for specific Paladin unit to give 10.0 bonus armor instead of default bonus of 4.5 armor
  • Untitled Trigger 001
    • Events
      • Player - Player 1 (Red) skips a cinematic sequence
    • Conditions
    • Actions
      • Ability - Set Ability: (Unit: Paladin 0000 <gen>'s Ability with Ability Code: Devotion Aura)'s Real Level Field: Armor Bonus ('Had1') of Level: 2 to 10.00
      • Unit - Decrease level of Devotion Aura for Paladin 0000 <gen>
      • Unit - Increase level of Devotion Aura for Paladin 0000 <gen>
The trigger action is called "Ability - Set Ability Real Level Field".
Why is it hard to use:
  • Notice in the "Ability - Set Ability ... " trigger action that the "Level" field is actually set to 2, but it affects level 3 of the ability - that is because zero-based indexing is used here, meaning you start from number 0, so number 0 affects level 1, number 1 affects level 2 and so on.
  • In the "Ability - Set Ability ..." trigger action the "Real Level Field" is a nightmare to set, because
    • It contains a large list of possible Real fields and the list is not ordered
    • The list has no search field, the only way to search is by pressing keyboard equal to the first letter of the field's name
    • The list contains duplicate field names (but each has its own unique code in the brackets - e.g. 'Had1')
    • Usually only one from the duplicates works, others do not
      • In this case, there are two "Armor Bonus" fields - one has 'Had1' code and the other has 'Ufa2' - only the 'Had1' works for Devotion Aura
  • You have to refresh the ability for the change to take effect (In the trigger above it's done by decreasing the level of the ability and then increasing it back)
 
Level 4
Joined
Jun 23, 2016
Messages
65
In latest versions there are new trigger actions for that - they are under 'Ability' section, but they are clunky and hard to use.
For example the following will update Devotion Aura level 3 for specific Paladin unit to give 10.0 bonus armor instead of default bonus of 4.5 armor
  • Untitled Trigger 001
    • Events
      • Player - Player 1 (Red) skips a cinematic sequence
    • Conditions
    • Actions
      • Ability - Set Ability: (Unit: Paladin 0000 <gen>'s Ability with Ability Code: Devotion Aura)'s Real Level Field: Armor Bonus ('Had1') of Level: 2 to 10.00
      • Unit - Decrease level of Devotion Aura for Paladin 0000 <gen>
      • Unit - Increase level of Devotion Aura for Paladin 0000 <gen>
The trigger action is called "Ability - Set Ability Real Level Field".
Why is it hard to use:
  • Notice in the "Ability - Set Ability ... " trigger action that the "Level" field is actually set to 2, but it affects level 3 of the ability - that is because zero-based indexing is used here, meaning you start from number 0, so number 0 affects level 1, number 1 affects level 2 and so on.
  • In the "Ability - Set Ability ..." trigger action the "Real Level Field" is a nightmare to set, because
    • It contains a large list of possible Real fields and the list is not ordered
    • The list has no search field, the only way to search is by pressing keyboard equal to the first letter of the field's name
    • The list contains duplicate field names (but each has its own unique code in the brackets - e.g. 'Had1')
    • Usually only one from the duplicates works, others do not
      • In this case, there are two "Armor Bonus" fields - one has 'Had1' code and the other has 'Ufa2' - only the 'Had1' works for Devotion Aura
  • You have to refresh the ability for the change to take effect (In the trigger above it's done by decreasing the level of the ability and then increasing it back)
Thanks for the detailed explanation👍 Although I think I'll end up making multiple copies of the same ability, it really is tedious to manage
 

Uncle

Warcraft Moderator
Level 73
Joined
Aug 10, 2018
Messages
7,877
It's a lot easier to work with these ability fields in Jass/Lua since you don't have to scroll through a massive list of data fields and can simply type in the exact field you need.

Also, you don't ALWAYS have to refresh an ability for the effect to update. That's just the case for "passive" effects as far as I know. I know for a fact an ability like Shockwave can be updated in response to "A unit Starts the effect of an ability" without the need for updating the level.

I'd argue that making multiple copies of the same ability is a lot more tedious than using those new fields but do whatever you're comfortable with.
 
Last edited:
Status
Not open for further replies.
Top