• 🏆 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!
  • 🏆 Hive's 6th HD Modeling Contest: Mechanical is now open! Design and model a mechanical creature, mechanized animal, a futuristic robotic being, or anything else your imagination can tinker with! 📅 Submissions close on June 30, 2024. Don't miss this opportunity to let your creativity shine! Enter now and show us your mechanical masterpiece! 🔗 Click here to enter!

[Solved] What am i missing? Detect behind.

Level 17
Joined
Jun 2, 2009
Messages
1,165
  • Untitled Trigger 001
    • Events
      • Unit - A unit Is attacked
    • Conditions
    • Actions
      • Set TempPoint = (Position of (Attacking unit))
      • Set TempPoint2 = (Position of (Attacked unit))
      • Set TempReal = (Facing of (Attacked unit))
      • Set TempPoint3 = (TempPoint offset by (Facing of (Attacked unit)) towards 0.00 degrees)
      • Unit - Order (Attacked unit) to Move To TempPoint3
      • Cinematic - Ping minimap for (All players) at TempPoint3 for 1.00 seconds
      • Custom script: call RemoveLocation(udg_TempPoint)
      • Custom script: call RemoveLocation(udg_TempPoint2)
      • Custom script: call RemoveLocation(udg_TempPoint3)
If unit takes damage, i want to make it turn back and move few steps. This is my more than 50'th try and still trying to figure it out.
How can i detect behind?
 
Level 39
Joined
Feb 27, 2007
Messages
5,057
This would be correct:
  • Set TempPoint3 = (TempPoint offset by SOME_DISTANCE towards ((Facing of (Triggering Unit)) + 180.00) degrees)
You have used the unit's facing value (an angle) where the polar offset distance argument is, and have left the angle at a hardcoded 0 degrees. It helps to read the argument names and descriptions and put the right stuff in the right places.
 
Level 17
Joined
Jun 2, 2009
Messages
1,165
Yes. Much better but in the opposite, he is running to me instead of back.
Update: Still i haven't solved. I want to make it run back. Not front.
Update 2: Solved. This one is the correct.
  • Set TempPoint3 = (TempPoint2 offset by 1500.00 towards (Angle from (Position of (Attacking unit)) to (Position of (Attacked unit))) degrees)
 
Last edited:
Top