• 🏆 Texturing Contest #33 is OPEN! Contestants must re-texture a SD unit model found in-game (Warcraft 3 Classic), recreating the unit into a peaceful NPC version. 🔗Click here to enter!

How in the World do I do This!?

Status
Not open for further replies.
Level 10
Joined
Feb 22, 2008
Messages
619
SOLVED BY -HellBreed-
Okay so basically what I want to do is take a units life (Unit - Life - Value) at
one time and then make the units life into that value at another. Confusing...

Let me give you an example. I have a footman, he has 100 health points (that
is pretty much a random number and doesn't matter) at 10 seconds, I want
him to have that amount at 20 seconds, even if he gets healed to max or gets
damaged to 1.

Let me give you a kind of different type of example... There's a footman
fighting at 10 seconds, he has 200 health, he gets hit a few times, then healed
once or twice, now he has 170 health. Oh look it's 20 seconds, now he has 200
health again.

Here's a trigger example:
  • Actions
  • Unit - Save (Unit) health as Value
  • Wait 10.00 seconds
  • Unit - Set life of (Triggering unit) to (Saved Value)
I'd be fine if you linked me to some sort of tutorial or something, and you
will get +REP even if you do that, (you'll get +REP if you help in any way).
Thanks! :smile:
SOLVED BY -HellBreed-
 
Last edited:
Level 2
Joined
Jun 6, 2010
Messages
17
?

You mean something like this?

ward9e6f6.jpg
 
Level 10
Joined
Feb 22, 2008
Messages
619
Uhm..?

[trigger=Life]Life
Events
Unit - A unit Is attacked
Conditions
Actions
Set Life = (Integer((Life of (Attacked unit))))
Wait 20.00 seconds
Unit - Set life of (Attacked unit) to (Real(Life))
[/trigger]

Thanks, exactly what I was looking for. But I must ask, why did you use (Integer((Life of (Attacked unit)))) instead of using (Life of (Attacked Unit))? I used (Life of (Attacked Unit)), and it worked.
 
Status
Not open for further replies.
Top