• 🏆 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 do i make unit spin?

Status
Not open for further replies.
Level 5
Joined
Apr 16, 2005
Messages
153
Here use this trigger:
  • Turning
    • Events
      • Time - Every 0.10 seconds of game time
    • Conditions
    • Actions
      • Set TurningAngle = (Facing of (Triggering unit))
      • Set TurningAngle = (TurningAngle + 10.00)
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • TurningAngle Greater than 360.00
        • Then - Actions
          • Set TurningAngle = (TurningAngle - 360.00)
        • Else - Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • TurningAngle Less than 0.00
        • Then - Actions
          • Set TurningAngle = (TurningAngle + 360.00)
        • Else - Actions
      • Unit - Make (Triggering unit) face TurningAngle over 0.10 seconds
Set triggering unit to the unit that you want to spin.

Let me know if you need anything else, or if something doesnt work.
 
Level 9
Joined
Jun 26, 2005
Messages
511
thanks it works, is there a way to make the unit move to target of ability being cast? since the unit is facing random position i cant use facing triggering unit, now am creating a dummy unit and move triggering unit to it every .10 second.
 
Level 5
Joined
Apr 16, 2005
Messages
153
Yea, add this trigger
  • Start
    • Events
      • Unit - A unit Starts the effect of an ability
    • Conditions
      • (Ability being cast) Equal to Cyclone
    • Actions
      • Set TurningUnit = (Target unit of ability being cast)
      • Trigger - Turn on Turning <gen>
      • Wait 1.00 seconds
      • Trigger - Turn off Turning <gen>
Just changed triggering unit to the Turning Unit variable
 
Level 9
Joined
Jun 26, 2005
Messages
511
ooo eh this is a little offtopic but i dont wanna make a new one for a small quest, so bear with me :), i wanted to ask that is there away to detect the back of triggering unit, i tried facing triggering unit -50 but it doesnt work.
 
Level 5
Joined
Apr 16, 2005
Messages
153
k, I made a rough trigger for you
  • If its behind
    • Events
    • Conditions
    • Actions
      • Unit - Order (Triggering unit) to Stop
      • Unit - Make (Triggering unit) face (Target unit of ability being cast) over 0.00 seconds
      • Set FacingAngleCaster = (Facing of (Triggering unit))
      • Set FacingAngleTar = (Facing of (Target unit of ability being cast))
      • Set FacingAngleTar = (FacingAngleCaster - FacingAngleTar)
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • Or - Any (Conditions) are true
            • Conditions
              • FacingAngleTar Greater than or equal to 90.00
              • FacingAngleTar Less than or equal to -90.00
        • Then - Actions
          • Unit - Reset ability cooldowns for (Triggering unit)
        • Else - Actions
          • Skip remaining actions
Lemme know if you need anything else

Note: the reset ability cooldowns is just an example of where the effects go.
 
Last edited:
Level 5
Joined
Apr 16, 2005
Messages
153
Alright, well basically. It has to make the unit stop first, so then the trigger can make the unit face in a direction. After it make it face the unit it can run the calculation by finding both the facing angles and subtracting them. If the number that they make are greater than 90degrees or less than -90 degrees then the unit is behind him. Heres ill draw a quick drawing for you. I hope its right cause its kinda late... When i log on in the morning i may make corrections to the trigger or drawing as needed
 

Attachments

  • Angles.bmp
    199.7 KB · Views: 109
Level 9
Joined
Jun 26, 2005
Messages
511
oh i see, well am doing a looping trigger so its pretty big if i use a trigger like that, but ok thanks again ill sleep too.

EDIT: hmm btw in those knock back spells, you move the unit back, so i guess theres a location for it?
 
Level 5
Joined
Apr 16, 2005
Messages
153
Shouldnt need to use a loc for this trigger unless you wanted to use regions. Oh, and now that I'm a little bit more awake... I realised that I made a trigger to see if the caster is infront of the unit, Ill fix the trigger for you.
 
Status
Not open for further replies.
Top