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

[Solved] Dummy abilites question

Status
Not open for further replies.
Level 4
Joined
Sep 28, 2022
Messages
26
Do lots of levels of an dummy ability really affect performance? If i would have, for example, created and used 4 identical dummy abilities with 30 levels each, how much it will affect map performance? If it does, how can i optimize it? (dummy abilities in question are based on Ring of Protection)
 
Last edited:

Uncle

Warcraft Moderator
Level 73
Joined
Aug 10, 2018
Messages
7,875
I've heard it affects loading times. Also, I don't see how these would be considered "Dummy" abilities, they're being used exactly how you would use any ability as far as I understand. Or are you doing something strange with them? In that case I can almost say for certain that there's a better solution.

If you're on a more recent version then it's much easier to modify Stats via triggers and avoid Abilities with high levels:
  • Example
    • Events
      • Unit - A unit Learns a skill
    • Conditions
      • (Learned Hero Skill) Equal to Improved Defenses (Hero)
    • Actions
      • -------- Setup the bonus armor per level: --------
      • Set VariableSet Armor_Per_Lvl[1] = 1
      • Set VariableSet Armor_Per_Lvl[2] = 2
      • Set VariableSet Armor_Per_Lvl[3] = 5
      • Set VariableSet Armor_Per_Lvl[4] = 10
      • -------- --------
      • -------- Setup the item ability. This is a custom ability based on the standard Item - Armor abilities with 2 levels that each add 0 armor: --------
      • Set VariableSet Armor_Ability = Improved Defenses (Item)
      • -------- --------
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Learned skill level) Equal to 1
        • Then - Actions
          • Unit - Add Armor_Ability to (Triggering unit)
        • Else - Actions
      • -------- --------
      • -------- Increase Armor: --------
      • Ability - Set Ability: (Unit: (Triggering unit)'s Ability with Ability Code: Armor_Ability)'s Integer Level Field: Defense Bonus ('Idef') of Level: 0 to Armor_Per_Lvl[(Learned skill level)]
      • Unit - Increase level of Armor_Ability for (Triggering unit)
      • Unit - Decrease level of Armor_Ability for (Triggering unit)
In this example I am adding 1/2/5/10 armor to the hero when it learns the Improved Defenses ability. Note that not every data field can be modified but most seem to work fine.

The increase/decrease of level is necessary to "update" the changes made. This is usually only necessary when modifying a passive data field. Also, it usually makes more sense to handle the Setup stuff in another trigger like after a 0.00 second Elapsed time event.
 
Last edited:
Level 4
Joined
Sep 28, 2022
Messages
26
I've heard it affects loading times. Also, I don't see how these would be considered "Dummy" abilities, they're being used exactly how you would use any ability as far as I understand. Anyway, that's not important.

Are you on a more recent version? Because it's much easier to modify Stats via triggers and avoid Abilities with high levels.
  • Example
    • Events
      • Unit - A unit Learns a skill
    • Conditions
      • (Learned Hero Skill) Equal to Improved Defenses (Hero)
    • Actions
      • -------- Setup the bonus armor per level: --------
      • Set VariableSet Armor_Per_Lvl[1] = 1
      • Set VariableSet Armor_Per_Lvl[2] = 2
      • Set VariableSet Armor_Per_Lvl[3] = 5
      • Set VariableSet Armor_Per_Lvl[4] = 10
      • -------- Setup the bonus armor item ability - this is based on the standard Item - Armor Bonus abilities and has 2 levels that each add 0 armor: --------
      • Set VariableSet Armor_Ability = Improved Defenses (Item)
      • -------- --------
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Learned skill level) Equal to 1
        • Then - Actions
          • Unit - Add Armor_Ability to (Triggering unit)
        • Else - Actions
      • -------- Increase Armor: --------
      • Ability - Set Ability: (Unit: (Triggering unit)'s Ability with Ability Code: Armor_Ability)'s Integer Level Field: Defense Bonus ('Idef') of Level: 0 to Armor_Per_Lvl[(Learned skill level)]
      • Unit - Increase level of Armor_Ability for (Triggering unit)
      • Unit - Decrease level of Armor_Ability for (Triggering unit)
In this example I am adding 1/2/5/10 armor to the hero when it learns the Improved Defenses ability. This is basically a custom passive.

The increase/decrease of level is necessary to "update" the changes made. This is usually only necessary when modifying a passive data field.
no, i'm on 1.26 (my pc is a brick). Also, under "dummy" abilities, i meant that they are only used in triggers (like some kind of mark on unit to later detect him and another units with that mark by using "Units in playable map area matching Level of "dummy" ability for Matching unit equal to 1" etc.) and they do not give units any real benefits. Thanks anyways and sorry if i misunderstood you.
 

Uncle

Warcraft Moderator
Level 73
Joined
Aug 10, 2018
Messages
7,875
no, i'm on 1.26 (my pc is a brick). Also, under "dummy" abilities, i meant that they are only used in triggers (like some kind of mark on unit to later detect him and another units with that mark by using "Units in playable map area matching Level of "dummy" ability for Matching unit equal to 1" etc.) and they do not give units any real benefits. Thanks anyways and sorry if i misunderstood you.
I see, that's a fine way of doing things, but it seems confusing and hard to keep organized.

I would personally use a Unit Indexer or a Hashtable and mark the Units like that. This way you can organize things by variable names:
  • Unit Indexer example
    • Events
      • Unit - A unit dies
    • Conditions
      • Is_A_Boss[(Custom value of (Dying unit)] Equal to True
    • Actions
      • // A boss died!
^ Boolean array variables with self-explanatory names can go a long way in trigger clarity.

But it's entirely up to you. Here's where I read about long loading times associated with ability level: Super Long Load Times
 
Status
Not open for further replies.
Top