[Trigger] Level of ability doesn't increase

Status
Not open for further replies.

sentrywiz

S

sentrywiz

Hi all.
I can't increase the level of the ability I'm adding to a unit.

The ability is based on Item Life (Greater) and I want to add half of Strength for the hero to the unit being summoned as bonus health.
But the ability always stays to level 1 and I have 30 levels of it.

Anyone know why?
P.S I tried with starts the effect of an ability event as well but same result

  • Ability Ancient Spirit
    • Events
      • Unit - A unit enters (Playable map area)
    • Conditions
      • (Unit-type of (Entering unit)) Equal to Ancient Spirit
    • Actions
      • Set randomNumber = (((Strength of HERO_UNIT (Exclude bonuses)) / 2) - 1)
      • Unit - Add Ancient Spirit HP to (Entering unit)
      • Unit - Set level of Ancient Spirit HP for (Entering unit) to randomNumber
 

sentrywiz

S

sentrywiz

Display your rand number as I believe it is going over 30 and setting it to 1 as default. Also never use entering init use triggering unit.

No it is not.

It is 5 at level 1 Hero, I've tested - it works as it should.

Except the ability stays at level 1.

The event for unit entering region clearly says use entering unit, not triggering unit.
 
Level 4
Joined
Feb 28, 2014
Messages
70
Triggering unit is the unit that fires the event of the trigger, in this case: Trigering unit is Entering unit. However it's the same shit if you only use 3 actions so that's kinda exhagerated to say "NEVER" use entering unit ._.'

Whatever that's not the point, you should try to store the unit in a variable. The unit is entering on the map by what? Just in case, Creating/Buying an unit DOESN'T count as "Entering" in the region AFAIK.
 

sentrywiz

S

sentrywiz

Triggering unit is the unit that fires the event of the trigger, in this case: Trigering unit is Entering unit. However it's the same shit if you only use 3 actions so that's kinda exhagerated to say "NEVER" use entering unit ._.'

Whatever that's not the point, you should try to store the unit in a variable. The unit is entering on the map by what? Just in case, Creating/Buying an unit DOESN'T count as "Entering" in the region AFAIK.

And the unit is a summoning spell, based on Water Elemental I think. So it does count for "entering unit" its not being bought from a shop.

The ability proves it. It is being correctly given to the unit -- but its level isn't set to 5, which it should. It has 30 levels, so its no way 5 > 30

Triggering Unit is a local which is (?) faster to call than globals like GetEnteringUnit and GetAttackedUnit. It also makes something with waits MUI though still inefficient.

GetTriggerUnit calls native just as much as GetEnteringUnit, GetAttackedUnit etc, returns the same unit most of the time tho

Thank you both for explaining it but my question isn't related to the difference and efficiency of triggering versus entering unit.

Use a Game - Message
to display what the RandomNumber is.

Also, have you set HERO_UNIT to a unit?

HERO_UNIT is being stored in a variable. Above I said that the variable equals to 5, since Strength of HERO_UNIT is 12 thus 12 / 2 - 1 = 5

So Ancient Spirit HP ability is being given, but the level of the Ancient Spirit HP remains 1
 
Level 20
Joined
Jul 14, 2011
Messages
877
Entering unit and the other unit event responses are also local, as proved by someone who actually took the time to test it (whose name I cant remember).

Also, is the ability a hero ability? If yes, then you should use the Hero - Level ability for unit , or something of the like. There was also something about adding stats to a unit not working when the ability is added, but only when the ability is removed. Try setting the amount of added health to -1 and adding and removing it as much times as you want bonus health. Not really sure if this applies for health or not, but its worth a try.
 

Dr Super Good

Spell Reviewer
Level 64
Joined
Jan 18, 2005
Messages
27,243
The ability is based on Item Life (Greater) and I want to add half of Strength for the hero to the unit being summoned as bonus health.
But the ability always stays to level 1 and I have 30 levels of it.
I do apologize for the lack of help you received. People seem to have no idea about WC3 modding anymore.

Basically its a Warcraft III bug with that ability. It only ever adds the level 1 bonus as it is missing the level advancement code clearly. However it does remove the correct amount depending on what level it is set to. As such you can exploit this mechanic to permanently modify unit health (and yes it acts just like health tomes!).

Use the item ability in its exploit mode to add the bonus health every time you level up the dummy.

The exploit mode is to add 0 health at level 1 and -X health at level 2 where X is the amount you want to add. You then do the following.
Give the unit the ability. This adds 0 health.
Set the ability level to 2. This removes 0 health due to a bug.
Remove the ability from the unit. This adds X health.
The unit now permanently has +X health.
Repeat as much as you like!

There is an alternative mode of operation where you add X health at level 1 and 0 health at level 2. This is less recommended as the other way allows you to use multiple levels to control the increment (eg powers of 2).

Like all modifications, these are applied twice when the unit undergoes a morph with the Chaos ability. I would recommend you use bear form or other permanent morphs instead to change unit type as they do correctly transfer the bonus stats.
 

Kazeon

Hosted Project: EC
Level 34
Joined
Oct 12, 2011
Messages
3,449
We are here to help people fixing and solving their problems, not telling them to do those damn freaky 0.00000001 second optimizations or even arguing about it here.

@sentrywiz
DSG has explained everything.
But you can always utilize a bonus mod system to manipulate any unit's health pool or any other attributes in ease.
Like this: BonusMod
 

sentrywiz

S

sentrywiz

Entering unit and the other unit event responses are also local, as proved by someone who actually took the time to test it (whose name I cant remember).

Also, is the ability a hero ability? If yes, then you should use the Hero - Level ability for unit , or something of the like. There was also something about adding stats to a unit not working when the ability is added, but only when the ability is removed. Try setting the amount of added health to -1 and adding and removing it as much times as you want bonus health. Not really sure if this applies for health or not, but its worth a try.

The ability is, like I said -- based on Item Life (Greater)
So no, its an item ability not a hero one.

I do apologize for the lack of help you received. People seem to have no idea about WC3 modding anymore.

Basically its a Warcraft III bug with that ability. It only ever adds the level 1 bonus as it is missing the level advancement code clearly. However it does remove the correct amount depending on what level it is set to. As such you can exploit this mechanic to permanently modify unit health (and yes it acts just like health tomes!).

Use the item ability in its exploit mode to add the bonus health every time you level up the dummy.

The exploit mode is to add 0 health at level 1 and -X health at level 2 where X is the amount you want to add. You then do the following.
Give the unit the ability. This adds 0 health.
Set the ability level to 2. This removes 0 health due to a bug.
Remove the ability from the unit. This adds X health.
The unit now permanently has +X health.
Repeat as much as you like!

There is an alternative mode of operation where you add X health at level 1 and 0 health at level 2. This is less recommended as the other way allows you to use multiple levels to control the increment (eg powers of 2).

Like all modifications, these are applied twice when the unit undergoes a morph with the Chaos ability. I would recommend you use bear form or other permanent morphs instead to change unit type as they do correctly transfer the bonus stats.

Yeah, I tested yesterday and it seems that I was wrong. The ability was being set to the correct level, but the amount of health wasn't changed. So its like you said, if you add it once then you cannot modify it even though I increased to level 5 with the ability.

Nice exploit, I will remember that. Thank you. +rep

I also don't know what the chaos ability does. Mind explaining?

We are here to help people fixing and solving their problems, not telling them to do those damn freaky 0.00000001 second optimizations or even arguing about it here.

@sentrywiz
DSG has explained everything.
But you can always utilize a bonus mod system to manipulate any unit's health pool or any other attributes in ease.
Like this: BonusMod

I thought about finding a system, but I thought its dead simple to do it myself. And the concept of it was, but the execution failed. Luckily, DSG explained it well.
 

Dr Super Good

Spell Reviewer
Level 64
Joined
Jan 18, 2005
Messages
27,243
I also don't know what the chaos ability does. Mind explaining?
It changes a unit from one type to another. It does so in such a way all references to the unit remain intact (as opposed to re-creating a new unit and transferring stuff to it).

It was used in the RoC campaign to morph the Orcs to Fel Orcs. I think it may also be used in melee to morph siege engines to their barrage form.

The issue with it is that any attribute modifications (extra HP, hero stats for heroes, extra mana etc) get applied again when changing type using it. This means units can get stat boosts (probably why you remember Fel Ghrom Hellscreem being so powerful as all his tomes were applied twice etc).

The way around it is to use a "temporary" morph ability. As these change unit types except in a way that attribute bonuses are preserved. The common one used is the druid bear form I think. It has some property that allows you to change unit types permanently even after the ability gets removed. I believe the unit changes to the base type when added and when removed it remains that type.
 

sentrywiz

S

sentrywiz

It changes a unit from one type to another. It does so in such a way all references to the unit remain intact (as opposed to re-creating a new unit and transferring stuff to it).

It was used in the RoC campaign to morph the Orcs to Fel Orcs. I think it may also be used in melee to morph siege engines to their barrage form.

The issue with it is that any attribute modifications (extra HP, hero stats for heroes, extra mana etc) get applied again when changing type using it. This means units can get stat boosts (probably why you remember Fel Ghrom Hellscreem being so powerful as all his tomes were applied twice etc).

The way around it is to use a "temporary" morph ability. As these change unit types except in a way that attribute bonuses are preserved. The common one used is the druid bear form I think. It has some property that allows you to change unit types permanently even after the ability gets removed. I believe the unit changes to the base type when added and when removed it remains that type.

I see.

Kind of practical.
 

sentrywiz

S

sentrywiz

You got set the level of ability to the strength? because randomize the strength may become many and many
Like if you have 80 str... and the level of ability have 5 only...
Maybe...

I know you mean well, but have you read the thread?
@Dr Super Good already explained the problem.

Also, I didn't understand a word from what you just said.

Use spell check. Your grammar is horrible
 
Status
Not open for further replies.
Top