• 🏆 Texturing Contest #33 is OPEN! Contestants must re-texture a SD unit model found in-game (Warcraft 3 Classic), recreating the unit into a peaceful NPC version. 🔗Click here to enter!
  • 🏆 Hive's 6th HD Modeling Contest: Mechanical is now open! Design and model a mechanical creature, mechanized animal, a futuristic robotic being, or anything else your imagination can tinker with! 📅 Submissions close on June 30, 2024. Don't miss this opportunity to let your creativity shine! Enter now and show us your mechanical masterpiece! 🔗 Click here to enter!

[Trigger] Ability won't lvl up

Status
Not open for further replies.
Level 2
Joined
Mar 22, 2010
Messages
9
Hello, I am having problems making this skill, let's say I got 3 custom abillities:

- Constitution (Hero skill, which he lvls up and runs the trigger)
- Health bonus (Unit skill, giving +10 max HP each level of constitution)
- Armor bonus (Unit skill, giving +1 armor each 2 levels of constitution)

This is the trigger I'm trying to use, thought I've used many many other options:

  • Constitution
    • Events
      • Unit - A unit Learns a skill
    • Conditions
      • (Learned Hero Skill) Equal to Constitution
    • Actions
      • Set ConsCounter[(Player number of (Owner of (Triggering unit)))] = (ConsCounter[(Player number of (Owner of (Triggering unit)))] + 1)
      • Set ConsLevel[(Player number of (Owner of (Triggering unit)))] = (ConsLevel[(Player number of (Owner of (Triggering unit)))] + 1)
      • Quest - Display to (Player group((Owner of (Triggering unit)))) the Hint message: (Your Constitution is now Level + (String(ConsLevel[(Player number of (Owner of (Triggering unit)))])))
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Level of Constitution for (Triggering unit)) Equal to 1
        • Then - Actions
          • Unit - Add Health bonus to (Triggering unit)
        • Else - Actions
          • Unit - Set level of Health bonus for (Triggering unit) to ConsLevel[(Player number of (Owner of (Triggering unit)))]
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • ConsCounter[(Player number of (Owner of (Triggering unit)))] Equal to 2
        • Then - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • ConsLevel[(Player number of (Owner of (Triggering unit)))] Equal to 2
            • Then - Actions
              • Unit - Add Armor bonus to (Triggering unit)
            • Else - Actions
              • Unit - Set level of Armor bonus for (Triggering unit) to (ConsLevel[(Player number of (Owner of (Triggering unit)))] / 2)
          • Set ConsCounter[(Player number of (Triggering player))] = 0
        • Else - Actions
The armor bonus is correct and also is the game message showing the current level, so the variables "ConsCounter" and "ConsLevel" are ok. The health bonus skill is added at first level of Consitution, but is not leveling up. I've tried with othr intger options for setting ability level, tried using "Unit - Increase level of ability for unit" and also tried using no "If/Then/Else" checker.

I've got same problem with another spell called Wisdom which should increase max mana and I've even tried with stat bonuses (strenght bonus/intelligence bonus) and also not stacking/lvling up.

Can anyone help me?
 
Last edited:
Level 26
Joined
Aug 18, 2009
Messages
4,097
That's an issue with the specific ability. It does level up but it does not update the level's bonus correctly. However, we are fortunate that it is this way because we can abuse this bug. Setting the level of the ability won't update correctly but removing the ability from the unit on the new level will remove the bonus of this new level. So, the unit can have another max life amount than before without keeping the ability and this can be repeated to stack the bonuses.

Other than that, you can also use different ability instances.
 
Level 2
Joined
Mar 22, 2010
Messages
9
I don't know if I understand you correctly, you mean I remove the ability ach lvl up, and add again with increased lvl? This is what I get:
  • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
    • If - Conditions
      • (Level of Constitution for (Triggering unit)) Equal to 1
    • Then - Actions
      • Unit - Add Health bonus to (Triggering unit)
    • Else - Actions
      • Unit - Remove Health bonus from (Triggering unit)
      • Unit - Add Health bonus to (Triggering unit)
      • Unit - Set level of Health bonus for (Triggering unit) to ConsLevel[(Player number of (Owner of (Triggering unit)))]
Am I wrong?
 
Level 26
Joined
Aug 18, 2009
Messages
4,097
No, lets say the ability has the following bonuses:

Level 1 - 100
Level 2 - 400

When you add the ability, the unit obtains 100 life, when you change the ability to level 2, the unit still has 100 life, when you remove it now, the unit loses the 400 life from level 2, so overall the unit has lost 300 hp. This also works with negative values to add life points. Usually, you'd set the bonus of level 1 to zero to simplify the calculation, so it's only the reversed number of this level you want to add.

It's not a "Set bonus life to x"-method (the game doesn't know anymore, what of that unit's life was bonus when you remove the ability) but rather a "Add x life"-method.

When you wanted level 1 to grant 50 hp and level 2 raising it to 150 hp (meaning the unit will get 100 hp from level 1 to 2), you could use

Level 1 - 0
Level 2 - -50
Level 3 - -100

Constitution is learnt on first level --> add life bonus, set to level 2 and remove it again
Constitution progresses to second level --> add life bonus, set it to level 3 and remove it again

Normally, one would not create life bonus instances with custom values for each different ability/occasion you want to add/set life. They would create a header function where you could type in what amount of life you want. And this function would calculate which levels are needed therefore.
 
Status
Not open for further replies.
Top