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

[Trigger] Hp trigger

Status
Not open for further replies.
Level 4
Joined
Jan 5, 2009
Messages
53
Hello.
Here is my problem
%D0%9D%D0%BE%D0%B2%D1%8B%D0%B9%20%D1%82%D0%BE%D1%87%D0%B5%D1%87%D0%BD%D1%8B%D0%B9%20%D1%80%D0%B8%D1%81%D1%83%D0%BD%D0%BE%D0%BA.bmp.jpg

I dont get it how to increase maximum hp of unit in trigger-way without using strength attribute.
p.s sory for non-english editor
 
Level 11
Joined
Sep 12, 2008
Messages
657
you cant.. theres a hugh code in vjass that allows that, but it requires a hell load of abilities,
and 1 hell of a code..
and its vjass :p which i supose you dont want to use..

and besides, ,another way is to use item abilities, but it will be bad later, cuz you'll have lots of spells, item abilities are inivislble spells that gives buffs (dmg, str, life, move speed, attack speed, etc).. just make dummy spell with all levels of the spell, and add it for X time, then remove it later.
 
Level 33
Joined
Mar 27, 2008
Messages
8,035
You can use Item Life Bonus as base ability to increase a unit's HP
BUT, the increase of HP is pre-set in Object Editor, not by formula in Trigger Editor like:
Bonus HP Gain = STR * 100
Test map attached

EDIT:
Dang, am I just rephrasing what wolfman said ?
 

Attachments

  • HP Bonus Gain Ability.w3x
    14.1 KB · Views: 97
Level 37
Joined
Mar 6, 2006
Messages
9,243
Create (item) abilities based on item life bonus with levels, set values to 0,1,2,4,8,16,32,64,128,256,512,1024,2048...

Abilities for both negative and positive values.

To add one max hp, add, set the level to 2 and instantly remove the -1 max hp bonus ability. To decrease one max hp, add, set the level to 2 and instantly remove the +1 max hp bonus ability.

If you want to add 200 max hp, use a simple looping trigger.
Add/remove 128,64 and 8.

If you want to add 377 max hp, add/remove 256,64,32,16,8,1.
 
Last edited:
you cant.. theres a hugh code in vjass that allows that, but it requires a hell load of abilities,
and 1 hell of a code..
and its vjass :p which i supose you dont want to use..

and besides, ,another way is to use item abilities, but it will be bad later, cuz you'll have lots of spells, item abilities are inivislble spells that gives buffs (dmg, str, life, move speed, attack speed, etc).. just make dummy spell with all levels of the spell, and add it for X time, then remove it later.

wrong

Well, you can use the item health bonus ability.
But you wouldnt be able to change the health difference much because you would have to create one ability for each bonus amount

wrong

You can use Item Life Bonus as base ability to increase a unit's HP
BUT, the increase of HP is pre-set in Object Editor, not by formula in Trigger Editor like:
Bonus HP Gain = STR * 100
Test map attached

EDIT:
Dang, am I just rephrasing what wolfman said ?

wrong again



makers solution is the most stable one but there is a nice bug to abuse
do the following:

make a health bonus ability with this data: level 1: x bonus hp, level 2: 0 bonus hp
add life bonus ability to a unit
set level to 2
remove ability
the unit will lose 0 bonus hp (because level 2 provides 0 bonus hp)
now you can do the same again

if you want to know more you can search for "bonus mod"
 
Level 11
Joined
May 31, 2008
Messages
698
If i understand d4rks method correctly, couldnt you do this using only 2 abilities? One that gives +1 health, one the gives -1 health, and each of them have lvl 2 as 0 health
So you could set a real variable to whatever health bonus you want to give, then convert that real to an integer, lets say "I" and then loop.
Loop from 0 - I
Unit add ability Health+1
Set level of Health+1 to level 2 (makes it give 0 bonus while unit still retains health?)
Remove ability Health+1 from unit
endloop

So it will loop the amount of times that you want its health to increase, which would allow you to increase/decrease health by any specific amount using only 2 abilities with 2 levels.
To decrease you would do the same but use Health-1 to take away health.
Idk if this works, its just based off what i understood that d4rk said.
 
Level 37
Joined
Mar 6, 2006
Messages
9,243
If i understand d4rks method correctly, couldnt you do this using only 2 abilities?

Well, you wouldn't want to make the loop run 1500 times if you want to add 1500 hp.

With my method you can add the ability, set the level to 12, remove ability. Level 12 gives 1024 hp. Then you need 1500-1024=476 hp more. Add the ability, set level to 10. Level 10 gives 256 hp. Then you need 476-256=220 hp more. Repeat the procedure.

1024, 256, 128, 64, 16, 8, 4

Overall you need to add/set level/remove the ability 7 times to give +1500 hp. Better than giving +1 1500 times.
 
Status
Not open for further replies.
Top