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)
 
There's an Action like this:

Code:
Unit - Set life (To Value)

Try that.
 
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
 
@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:
 
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
 
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..
 
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
 
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! ;)
 
"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
 
You could just add an inventory and give the unit Permanent Life Bonus items several times...
 
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.
 
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
  • The Helper The Helper:
    It is weird seeing a way more realistic users online number
  • The Helper The Helper:
    Happy Tuesday Night!
    +1
  • V-SNES V-SNES:
    Happy Friday!
    +1
  • The Helper The Helper:
    News portal has been retired. Main page of site goes to Headline News forum now
  • The Helper The Helper:
    I am working on getting access to the old news portal under a different URL for those that would rather use that for news before we get a different news view.
  • Ghan Ghan:
    Easily done
    +1
  • The Helper The Helper:
    https://www.thehelper.net/pages/news/ is a link to the old news portal - i will integrate it into the interface somewhere when i figure it out
  • Ghan Ghan:
    Need to try something
  • Ghan Ghan:
    Hopefully this won't cause problems.
  • Ghan Ghan:
    Hmm
  • Ghan Ghan:
    I have converted the Headline News forum to an Article type forum. It will now show the top 20 threads with more detail of each thread.
  • Ghan Ghan:
    See how we like that.
  • The Helper The Helper:
    I do not see a way to go past the 1st page of posts on the forum though
  • The Helper The Helper:
    It is OK though for the main page to open up on the forum in the view it was before. As long as the portal has its own URL so it can be viewed that way I do want to try it as a regular forum view for a while
  • Ghan Ghan:
    Yeah I'm not sure what the deal is with the pagination.
  • Ghan Ghan:
    It SHOULD be there so I think it might just be an artifact of having an older style.
  • Ghan Ghan:
    I switched it to a "Standard" article forum. This will show the thread list like normal, but the threads themselves will have the first post set up above the rest of the "comments"
  • The Helper The Helper:
    I don't really get that article forum but I think it is because I have never really seen it used on a multi post thread
  • Ghan Ghan:
    RpNation makes more use of it right now as an example: https://www.rpnation.com/news/
  • The Helper The Helper:

      The Helper Discord

      Staff online

      Members online

      Affiliates

      Hive Workshop NUON Dome World Editor Tutorials

      Network Sponsors

      Apex Steel Pipe - Buys and sells Steel Pipe.
      Top