• 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] Trigger should work but dosnt

Status
Not open for further replies.
Level 1
Joined
Dec 30, 2006
Messages
3
ok i have a simple trigger that does this:

when a unit kills another unit, the killing units max live should increase by 50.,

here is the trigger:

  • KillExperiance
    • Events
      • Unit - A unit Dies
    • Conditions
    • Actions
      • Advanced - For (Killing unit) Increase life maximum by 50
i used world editor unlimited to do this trigger, but in game when one unit kills another unit nothing happens...plz help...
 
Last edited by a moderator:
Level 2
Joined
Dec 31, 2006
Messages
16
why don't you gtry that one?

events:
-a unit dies
conditions:
-none
actions:
-set [killing unit] max hit points = max hp of [killing unit] + 50
 
Level 8
Joined
Sep 13, 2006
Messages
431
There's no such action...

While essentially correct, there is a way by which you can do this. Simply use a manual of health +50, and when a unit dies, create manual at position of killing unit. Then, give last created item to killing unit.

While this is probably not the most efficient way, it works alright, as long as the unit has either the hero inventory ability or a modified version of it.

Hope this helps you, LookAtMyBicepts, Daggoth, paskovich, and anyone else who struggled with this.
 
Level 12
Joined
Aug 7, 2004
Messages
875
Alright here is how you do it...
Before this trigger runs, in any initializing trigger or something else you do
Code:
Set life = (Integer((Life of (Triggering unit))))
Set increment = 1

then in your code do

Code:
Event:
A unit dies

Condition:
blablabla...

Action:
Set (Integer((Life of (Killing Unit)))) = life + (50 x increment)
Set increment = increment + 1

I hope this works for you
 
Level 12
Joined
Aug 7, 2004
Messages
875
DoOs, he wants to increase the units MAXIMUM hp, and not the current... Read!!!
Anyway, what does your trigger supposed to do???

Wait a minute my code is to set a new maximum hp. Since the action trigger Set Set (Integer((Life of (Killing Unit)))) = LIFE + (50 x increment) can extend beyond the unit's original maximum hp right? So for example if a unit's hp is 100 and it's maximum is 150.
Then it's hp will be set to a new one, which is 150+50. If he kills again then 150+100...

The variable LIFE should be set to the units original maximum hp.

Well you should try this trigger and see if it works
 
Level 8
Joined
Sep 13, 2006
Messages
431
Wait a minute my code is to set a new maximum hp. Since the action trigger Set Set (Integer((Life of (Killing Unit)))) = LIFE + (50 x increment) can extend beyond the unit's original maximum hp right? So for example if a unit's hp is 100 and it's maximum is 150.
Then it's hp will be set to a new one, which is 150+50. If he kills again then 150+100...

The variable LIFE should be set to the units original maximum hp.

Well you should try this trigger and see if it works

Well, it doesn't and it shouldn't. You basically used a really complex method to do something really simple. The set life function cannot set a units life to a value that is greater than the max life of the unit. Nice try though.

I still say that manuals of health, as I said above, would be an effective and quick way of solving the problem, but whatever...
 
Level 8
Joined
Sep 13, 2006
Messages
431
Well it should work... if infact you can set the health above the unit's original maximum hp with that line expression.

How so? I know that it has never worked for me, and apparently paskovitch hasn't found any luck with that function either, yet you claim it is possible. If you can get it to work, by all means, tell us so we can use it too, but I think you will find the same amount of success as the rest of us have found...
 
Status
Not open for further replies.
Top