Set lvl of ability

Asdfblah1

New Member
Reaction score
10
I'm using Item Life Bonus (Greater) to set the life of a unit by changing the level of said ability. For some reason when I set the ability level, it doesn't change the life, it just stays at the default level 1 ability. I've tried this with the 4 or 5 base abilities for Item Life Bonus but the same problem still occurred.

On the other hand, I'm doing the same thing with Item Damage Bonus (+20), and had no problems at all.
 

grognog

New Member
Reaction score
1
i usually try to stay away from item abilities changed into hero abilities.
(they usually don't work)
 

LurkerAspect

Now officially a Super Lurker
Reaction score
118
It might just be how that is. Some items have inherently different abilities, and when one works, it doesn't always mean the other will.

My suggestion is to make a custom upgrade that increases the life of your hero, make him use that upgrade (in the object editor, techtree - upgrades used) make a dummy ability (like based of moon glaive - it does nothing) then use a trigger to check what level that ability is, and thus what level the upgrade is.

Like this:
Trigger:
  • Tester
    • Events
      • Unit - A unit Learns a skill
    • Conditions
      • (Unit-type of (Triggering unit)) Equal to (your hero)
    • Actions
      • Player - Set the current research level of (your health upgrade for that hero) to (Level of (your health bonus ability) for (Triggering unit)) for (Owner of (Triggering unit))


Alternatively, try basing your skill off attribute bonus, and just convert how much bonus health you want into bonus strength, then yuo can also choose to hide the icon of the ability with the 'data - hide button' field
 

Tom Jones

N/A
Reaction score
437
It's an old known bug. That ability, and all abilities derived from it acts funny.

It will only add the level one bonus to the unit, no matter what level the ability actually is. However it'll actually remove the correct bonus applied by the current level of the ability.

Bonus and UnitProperties exploits this bug, and are both really great systems. I also made a little snippet exploiting the bug, which can be found in the Systems sub forum.
 

Asdfblah1

New Member
Reaction score
10
Thanks tom.

I'll do a bit of lurking to figure out what you mean xD
+rep

Edit: "However it'll actually remove the correct bonus applied by the current level of the ability."
I'm not sure exactly what you mean by this...Could you explain it a little more?

Edit 2: Is there any way of not adding and removing the ability? It seems to cause a sharp spike whereas having the ability attached to the unit by default does not.
 

Tom Jones

N/A
Reaction score
437
I'll try to elaborate, consider this ability:

Ability A
Level 1: +50 hp.
Level 2: +100hp.
Level 3: +200hp.
Level 4: +400hp.

Consider this unit:
Unit X
Hp: 500

We add A to unit X, the unit will get a +50hp bonus and have 550 max hp.
We then remove A from unit X, the unit loses its +50hp bonus and now has its original max hp.

We add A to unit X, set the level of A to 3. The unit is supposed to get +200hp bonus, but it'll only gain +50hp, the bonus added by level 1.
We then remove A from unit X, the unit loses its +200hp bonus, though it originally didn't get it, which will lower its max hp to original hp + hp bonus from level 1 - bonus from current level = 350 or 300, I can't really remember.

Same applies to all other levels.

It spikes because the ability isn't preloaded and have a lot of levels.
 

roXplosive

New Member
Reaction score
15
I'm not sure but I don't think there is an elegant solution . Why don't you just make 4 abilities for life increment and apply the right one . Make their abilcodes to be in sequencial order or memorize them and use "if"s .
 
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