Define life of created unit?

_markone_

New Member
Reaction score
0
Events
Unit - A unit enters (Playable map area)
Conditions
(Unit-type of (Entering unit)) == My_Unit
Actions
Unit - Set Level of Life(Greater) for (Entering unit) to something

ogre life is based on Item Bonus life 100 levels,
unfortunally this doesnt work. i guess that Item Bonus Life cant be leveled...

is there any other way to define HPs of created unit?:banghead:
(ofc define value is should be bigger then hp MAX value for that unit)
 

Exide

I am amazingly focused right now!
Reaction score
448
There's an Action like this:

Code:
Unit - Set life (To Value)

Try that.
 

~GaLs~

† Ғσſ ŧħə ѕαĸε Φƒ ~Ğ䣚~ †
Reaction score
180
did u modified the "LIFE" spell in the object editor?

You need to set the lvl option there to 100 and edit all the data
 

_markone_

New Member
Reaction score
0
@exide set life doesnt work cause i want to define 10000 hps and unit have a lot less then it

@gals ofc that i did. for god sake...:nuts:
 

Doomhammer

Bob Kotick - Gamers' corporate spoilsport No. 1
Reaction score
67
setting hit points and setting life (max hit points) are two different things.
you can easily set the current hit points below the max value, as in your trigger script. you can't however set the max hitpoints that easily.

2 options to set the maxhitpoints:
1) add a customized item hit points bonus ability to the unit
to add a constant value

2) if you want to add a non-constant value, e.g. +33% of 640hp, then this little script might help you along http://www.wc3campaigns.net/showthread.php?t=80490
 

Exide

I am amazingly focused right now!
Reaction score
448
Or you could set the unit's hp in the Object Editor to a lot, and then set their hp by trigger.. but that looks ugly..
 

_markone_

New Member
Reaction score
0
setting hit points and setting life (max hit points) are two different things.
you can easily set the current hit points below the max value, as in your trigger script. you can't however set the max hitpoints that easily.

2 options to set the maxhitpoints:
1) add a customized item hit points bonus ability to the unit
to add a constant value

2) if you want to add a non-constant value, e.g. +33% of 640hp, then this little script might help you along http://www.wc3campaigns.net/showthread.php?t=80490

i tryed 1st way, but as i said its not working with much levels, and there is no way that i will make so much spells
i will try 2nd thing, but i kinda dont like those "sistems"


Or you could set the unit's hp in the Object Editor to a lot, and then set their hp by trigger.. but that looks ugly..

ye its very ugly, and unit can be healed to full, and cause overpower
 

Doomhammer

Bob Kotick - Gamers' corporate spoilsport No. 1
Reaction score
67
i tryed 1st way, but as i said its not working with much levels, and there is no way that i will make so much spells
i will try 2nd thing, but i kinda dont like those "sistems"

it's not that hard to implement. If it doesn't work, just post the problems you encountered in the jass zone. This maxlife-"system" works very well. I'm using it myself. If you want to set the maximum hitpoints in game to a custom value, then this is the only practicable solution. Give it a go! ;)
 

_markone_

New Member
Reaction score
0
"Give it an invisible spellbook ability that increases HP, then level it with triggers"
dude what im saying over here is that abilty which inc HPs do not work when u uplevel it.................

@doom ok thx
 

Weyrling

New Member
Reaction score
25
You could just add an inventory and give the unit Permanent Life Bonus items several times...
 

Narks

Vastly intelligent whale-like being from the stars
Reaction score
90
Alright. Basically, you have to create a binary lifeadd system.

Firstly, you need different life abilities:

Life Gain [1]
Life Gain [2]
Life Gain [4]
Life Gain [8]
Life Gain [16]
Life Gain [32]
Life Gain [64]
Life Gain [128]

etc. and so on and so forth



Next, when you wish to add life, you make a trigger. Basically, you get the number of life you want to add. Say this is... 175.

The trigger should work like this. It should work from bottom to top, looking at the Life Gain abilities, and checking:
1. Is the Life Gain ability greater then how much life I want to add?
2. Is the Life Gain ability greater then how much life I've added already? If not, add the ability to the unit.

I'll give an example, with {175.}

[x] = Life Gain bonus of ability.
{x} = Life that you want to gain.
(x) = Life you have already gained from the loop.

Looks at [256]. Bigger then {175}. Ignore.
Looks at [128]. Smaller then {175}, and fits into {175} - (0). Adds this ability to unit.
Looks at [64]. Smaller then {175}, but does not fit into {175} - (128). Ignore.
Looks at [32]. Smaller then {175}, and fits into {175} - (128). Adds this ability to unit.
Looks at [16]. Smaller then {175}, but does not fit into {175} - (160). Ignore.
Looks at [8]. Smaller then {175}, and fits into {175} - (160). Adds this ability to unit.
Looks at [4]. Smaller then {175}, and fits into {175} - (168). Adds this ability to unit.
Looks at [2]. Smaller then {175}, and fits into {175} - (172). Adds this ability to unit.
Looks at [1]. Smaller then {175}, and fits into {175} - (174). Adds this ability to unit.

Abilities added:
Life Gain [1]
Life Gain [2]
Life Gain [4]
Life Gain [8]
Life Gain [32]
Life Gain [128]


Get how it works? Now you just have to create a trigger for it.
 

_markone_

New Member
Reaction score
0
well sry for late answer, on my luck i know what are binary numbers, and idea is very good, tnx

infact its very easy to implement

2^12 = 4096, so max added life would be 8191
make integer array L with 13 numbers

L[1] will be assigned for bonuslife 2^0
L[2] will be assigned for bonuslife 2^1
L[3] will be assigned for bonuslife 2^2
...
L[13] will be assigned for bonuslife 2^12

x will be our life need

for i = 1 to 12 do
{
L = X mod 2
x = x div 2
}

and when this for ends
simply go and if value is 1 add corresponding LifeBonus

*im like 99% sure that this is good, i wrote it from head
 
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