• 🏆 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!

How to set Life low,unit automaticlly move back

Status
Not open for further replies.
  • Trigger1
  • Events
    • Map Initialization
  • Conditions
  • Actions
    • Set Temp_Group = (Units in (Playable Map Area))
    • Unit Group - Pick up every unit in (Temp_Group) and do (Actions)
      • Loop - Actions
        • Set Unit1 = (Picked unit)
        • Trigger - Add to (Trigger2 <gen>) the event (Unit1's life becomes Less than or Equal to 500.00)
    • Custom script: call DestroyGroup (udg_Temp_Group)
  • Trigger2
  • Events
  • Conditions
  • Actions
    • Set Point[1] = (Position of (Unit1))
    • Set Point[2] = ((Point[1]) offset by 500.00 towards (((Facing of (Unit1)) + 180)
    • Unit - Order (Unit1) to Move to (Point[2])
    • Custom script: call RemoveLocation (udg_Point[1])
    • Custom script: call RemoveLocation (udg_Point[2])
Like this?
 
  • Untitled Trigger 001
    • Events
      • Map initialization
    • Conditions
    • Actions
      • Set unitgroup = (Units in (Playable map area))
      • For each (Integer A) from 1 to (Number of units in unitgroup), do (Actions)
        • Loop - Actions
          • Unit Group - Pick every unit in unitgroup and do (Actions)
            • Loop - Actions
              • Set unit[(Integer A)] = (Picked unit)
              • Trigger - Add to Untitled Trigger 002 <gen> the event (Unit - unit[(Integer A)] Takes damage)
      • Custom script: call DestroyGroup (udg_unitgroup)

This works but X times per unit X= number of units on the map so its still not good
 
WTF!~ i made a damage checking system!!!ON MY OWN!!! I POST IT:
  • Untitled Trigger 001
    • Events
      • Map initialization
    • Conditions
    • Actions
      • Set unitgroup = (Units in (Playable map area))
      • Unit Group - Pick every unit in unitgroup and do (Actions)
        • Loop - Actions
          • For each (Integer A) from 1 to (Number of units in unitgroup), do (Actions)
            • Loop - Actions
              • Set unit[(Integer A)] = (Picked unit)
              • Trigger - Add to Untitled Trigger 002 <gen> the event (Unit - unit[(Integer A)] Takes damage)
              • Trigger - Add to Untitled Trigger 003 <gen> the event (Unit - unit[(Integer A)] Is attacked)
      • Custom script: call DestroyGroup (udg_unitgroup)
  • Untitled Trigger 002
    • Events
    • Conditions
      • (Damage source) Equal to Tauren Chieftain 0001 <gen>
    • Actions
      • Set damaged = (Triggering unit)
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • Attacked Equal to damaged
        • Then - Actions
          • Do nothing
        • Else - Actions
          • Skip remaining actions
      • Game - Display to (All players) the text: yes
      • Trigger - Turn off (This trigger)
      • Wait 0.01 seconds
      • Trigger - Turn on (This trigger)
  • Untitled Trigger 003
    • Events
    • Conditions
      • (Attacking unit) Equal to Tauren Chieftain 0001 <gen>
    • Actions
      • Set Attacked = (Attacked unit)
This will work for ur map if u annalize it , it corently check the damage on a unit that attack so u can change it to unit that is low hp and damaged insted of attacked, it work corently for units around all the map in the game start but u can change it with a trigger that each time he attack right make a new unit group or make it every time u enter new units into the game .
E-N-J-O-Y-!
 
Level 6
Joined
Mar 9, 2009
Messages
175
but i wan to Set (Footman life within 200 then order unit to move back 300distance how should i do??)
 
Level 7
Joined
Mar 8, 2009
Messages
360
I don't understand what you mean , you know what Set means?

If you mean the following:
-when a unit's health goes below a certain value: order unit to move back, distance equal to 500.
Use Pharaoh's trigger except change Unit1 to Triggering Unit in the second trigger.
I think that should work, but i'm not very experienced GUI'er

PS: Ignore best player 88, he's a troll
 
Level 7
Joined
Mar 28, 2009
Messages
210
Status
Not open for further replies.
Top