• 🏆 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!
  • It's time for the first HD Modeling Contest of 2024. Join the theme discussion for Hive's HD Modeling Contest #6! Click here to post your idea!

Unit lose health over time (when in region)

Status
Not open for further replies.
Level 25
Joined
Mar 23, 2008
Messages
1,813
You know how to handle variables, right?:Set Group = All units in Region thats setting the units in region as "Group". :Custom Script: call DestroyForce(udg_Group)= Thats the custom script destroying the group. :Unit Group - Pick Every unit in Group (<--your newly created variable)and do actions. Unit sets units health<-- you gotta find this, right? ;). Did this help you?
 
Level 9
Joined
Aug 11, 2007
Messages
429
Look:

trigger2.jpg


It doesn't work..
 
Level 12
Joined
Mar 26, 2005
Messages
790
the last action is bad

unit-set life of PICKED UNIT, not triggering, try it


and its bad also, becouse u make the unit to have -1HP, and I think thats cannot be done, HP can be only a positive number

make it unit-set life of picked unit to (life of picked unit)-1


  • Untitled Trigger 001
    • Events
      • Time - Every 2.00 seconds of game time
    • Conditions
    • Actions
      • Unit Group - Pick every unit in (Units in Region 000 <gen>) and do (Actions)
        • Loop - Actions
      • Unit - Set life of (Picked unit) to ((Life of (Picked unit)) - 1.00)
the last action, Set life of (Picked unit) to ((Life of (Picked unit)) - 1.00) can be problem, so when you make "set life of picked" and want to make second part, you will get "set life of triggering unit to life of triggering unit, click on the right one, you will get the window with many options, roll to the top and there you will find "arithmetic", then you will get "1 + 1", click on the left "1" and you will get same window, find unit-property, and there make it like "life of picked unit" and make from "+" to minus (aka -) and the right "1" can be just like that
 
Level 9
Joined
Aug 11, 2007
Messages
429
Alright, it STILL doesn't work... nothing happends...?
EDIT: GOT IT! You had the thing not in the looping section!

Thanks much guys! +rep!
 
Status
Not open for further replies.
Top