HomeUser Control Panel (unavailable in archive)ForumsTutorialsArt GalleryResourcesMaps

Max HP Manipulation

06-19-2005, 09:37 PM#1
Tim.
Im using the HP display ( XX / XXX ) to display the ammount of bullets remaing for your gun. Thats all well and good, easy to manipulate. The only issue is, when you change guns, the Max HP needs to change to the ammount of bullets you have, and once again, shrink once more when you reload.

Is there a way using a trigger to manipulate a unit's max HP in-game?
06-19-2005, 11:15 PM#2
Anitarf
Yes, using bonus hp abilities based on the abilities items such as gem of health use.
06-20-2005, 04:29 AM#3
Ant
To make it even simpler, from the start give the unit 1 hp and the ability for Bonus HP, and give the ability multiple levels, so when you switch weapon all you have to do is change the level of the ability. So let's say Level 1 gives +11 and level 2 gives +3 hp, so when he switches from the pistol to rocket launcher, change the ability from lvl 1 to lvl 2. I prefer this rather than using a new ability for every weapon.
06-20-2005, 05:25 AM#4
EdwardSwolenToe
Ive tried using multi-leveled hp abilities, although im afraid they dont work (or at least for me)

Best if you would use the bonus mod.
06-20-2005, 01:21 PM#5
Tim.
If I do as you suggest, I would need an ability with 999 levels, with +1 hp at each level. That would be quite insane to do. Is there a way to manipulate a statistic of an ability in-game perhaps?
06-20-2005, 01:35 PM#6
Ant
No you don't need 999 levels, just a different level for every clip size. The HP Bonus does not have to be in any strict order. You can have level 1 +9, level 2 +4, level 3 +29, and so on. You can have one level for every corresponding weapon clip size.

But if changing levels doesn't work then just add/remove a different ability for each weapon change. Works as well, I prefer working with changing ability levels, but adding/removing abilities is perfectly fine.
06-20-2005, 03:40 PM#7
Tim.
I understand that, however I think you missunderstood the system Im attempting to aquire.

Quote:
20 / 64

20 = Bullets remaining in clip
64 = Bullets remaing in all other clips

So if I were to do this, and the max bullets possible was 999, I would need 999 levels.
06-20-2005, 03:46 PM#8
Anitarf
Quote:
Originally Posted by Tim.
I understand that, however I think you missunderstood the system Im attempting to aquire.



20 = Bullets remaining in clip
64 = Bullets remaing in all other clips

So if I were to do this, and the max bullets possible was 999, I would need 999 levels.
No need, if you use a smart system (although, with auto fill, there's no problem to make an ability with 999 levels... but that's just not the proper way of doing things).

You can combine multiple single level abilities using a binary system to achieve any hp bonus. A hp bonus of 205 would be equal to 128 + 64 + 8 + 4 + 1. With only 10 abilities you can achieve any hp bonus from 1 to 1023.
06-20-2005, 04:42 PM#9
Vexorian
No, no no, not like that.

Use Bonus mod. For health better use my bonus mod.

It is on InvX , someone should make a map with bonusmod separated on it. WEU implements a version of bonus mod I think.

If you dislike JASS you should be able to make such a similar thing with gui.

This is the idea you have let's say 7 abilities (one level each)

+5 hp
+ 10 hp
+ 20hp
+40 hp
+80 p
+160 hp
+320 hp
+640 hp

To makes it short, combining these abilities you can get a bonus of any number from 5 and 1275 that is a multiple of 5.

for example 35 = 20 +10 + 5

You would need a trigger that sets the health bonus of a (Unit Variable) to (integer variable)

the trigger would first convert the integer variable to closest five.

Then remove all the bonus hp abilities

Then check if it is higher than 640 then substract it from the number and add the +640 abilitym do so with all the bonuses from 640 to 5.

And it would be done.

You can make it so another trigger checks if a unit has any of those abilities and changes the value of a variable to a number that matches the current hp bonus.

So when you need to increase a unit's health you combine both triggers. Or make one trigger that uses the unit variable and an integer variable to just add life and it combines the other two triggers.

At the end it is better to use bonusmod though, since it does the job for you
06-20-2005, 04:45 PM#10
Guest
why not make
20=bullets in clip
64=number of clips?
06-20-2005, 06:00 PM#11
Ant
Huh what where? Am I the only one who doesn't get Negativity's point?

Anyway I sort of viewed it as only needing to change the maximum hp, since the actual current hp can be easily modified, and most games display ammo as something like (currentammo/maxammo) so I didn't think along the lines that you'd want to only display the currentammo, because using a resource to display that would be more efficient (but I presume either your resource slots are all already used for some other purposes, or you just want to make the remaining ammo more conspicuous).
06-20-2005, 07:34 PM#12
Guest
wouldn't it be easier if you just used MP for bullets? :o or are you using mana for something else?
06-20-2005, 07:37 PM#13
Guest
Using mana is stupido because you need mana to cast stuff foo.
06-20-2005, 07:38 PM#14
Tim.
Mana's Max is also unalterable via normal trigger functions.

Anyway, Thanks Vex. Your mod (or shall I say your version of the mod) makes much more sence than GUI. I only have one issue. When testing, I used this:

Code:
HP Test
    Events
        Time - Elapsed game time is 5.00 seconds
    Conditions
    Actions
        Custom script:    function UnitSetBonus takes unit gg_unit_zcso_0013, integer 2, integer 100 returns boolean

I got an error "Expected a Code Statemnt"

I also tried:

Code:
HP Test
    Events
        Time - Elapsed game time is 5.00 seconds
    Conditions
    Actions
        Custom script:    function UnitSetBonus takes gg_unit_zcso_0013, 2, 100 returns boolean

Sorry, Im not great with JASS. Mind letting me know what I did wrong?
06-20-2005, 07:54 PM#15
shadow1500
to call a function u use call: "call UnitSetBonus( gg_unit_zcso_0013, 2, 100 )"