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.
  • Ghan Ghan:
    Howdy
  • Ghan Ghan:
    Still lurking
    +3
  • The Helper The Helper:
    I am great and it is fantastic to see you my friend!
    +1
  • The Helper The Helper:
    If you are new to the site please check out the Recipe and Food Forum https://www.thehelper.net/forums/recipes-and-food.220/
  • Monovertex Monovertex:
    How come you're so into recipes lately? Never saw this much interest in this topic in the old days of TH.net
  • Monovertex Monovertex:
    Hmm, how do I change my signature?
  • tom_mai78101 tom_mai78101:
    Signatures can be edit in your account profile. As for the old stuffs, I'm thinking it's because Blizzard is now under Microsoft, and because of Microsoft Xbox going the way it is, it's dreadful.
  • The Helper The Helper:
    I am not big on the recipes I am just promoting them - I use the site as a practice place promoting stuff
    +2
  • Monovertex Monovertex:
    @tom_mai78101 I must be blind. If I go on my profile I don't see any area to edit the signature; If I go to account details (settings) I don't see any signature area either.
  • The Helper The Helper:
    You can get there if you click the bell icon (alerts) and choose preferences from the bottom, signature will be in the menu on the left there https://www.thehelper.net/account/preferences
  • The Helper The Helper:
    I think I need to split the Sci/Tech news forum into 2 one for Science and one for Tech but I am hating all the moving of posts I would have to do
  • The Helper The Helper:
    What is up Old Mountain Shadow?
  • The Helper The Helper:
    Happy Thursday!
    +1
  • Varine Varine:
    Crazy how much 3d printing has come in the last few years. Sad that it's not as easily modifiable though
  • Varine Varine:
    I bought an Ender 3 during the pandemic and tinkered with it all the time. Just bought a Sovol, not as easy. I'm trying to make it use a different nozzle because I have a fuck ton of Volcanos, and they use what is basically a modified volcano that is just a smidge longer, and almost every part on this thing needs to be redone to make it work
  • Varine Varine:
    Luckily I have a 3d printer for that, I guess. But it's ridiculous. The regular volcanos are 21mm, these Sovol versions are about 23.5mm
  • Varine Varine:
    So, 2.5mm longer. But the thing that measures the bed is about 1.5mm above the nozzle, so if I swap it with a volcano then I'm 1mm behind it. So cool, new bracket to swap that, but THEN the fan shroud to direct air at the part is ALSO going to be .5mm to low, and so I need to redo that, but by doing that it is a little bit off where it should be blowing and it's throwing it at the heating block instead of the part, and fuck man
  • Varine Varine:
    I didn't realize they designed this entire thing to NOT be modded. I would have just got a fucking Bambu if I knew that, the whole point was I could fuck with this. And no one else makes shit for Sovol so I have to go through them, and they have... interesting pricing models. So I have a new extruder altogether that I'm taking apart and going to just design a whole new one to use my nozzles. Dumb design.
  • Varine Varine:
    Can't just buy a new heatblock, you need to get a whole hotend - so block, heater cartridge, thermistor, heatbreak, and nozzle. And they put this fucking paste in there so I can't take the thermistor or cartridge out with any ease, that's 30 dollars. Or you can get the whole extrudor with the direct driver AND that heatblock for like 50, but you still can't get any of it to come apart
  • Varine Varine:
    Partsbuilt has individual parts I found but they're expensive. I think I can get bits swapped around and make this work with generic shit though
  • Ghan Ghan:
    Heard Houston got hit pretty bad by storms last night. Hope all is well with TH.
  • The Helper The Helper:
    Power back on finally - all is good here no damage
    +2
  • V-SNES V-SNES:
    Happy Friday!
    +1

      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