• Listen to a special audio message from Bill Roper to the Hive Workshop community (Bill is a former Vice President of Blizzard Entertainment, Producer, Designer, Musician, Voice Actor) 🔗Click here to hear his message!
  • Read Evilhog's interview with Gregory Alper, the original composer of the music for WarCraft: Orcs & Humans 🔗Click here to read the full interview.
  • It's time for the first HD Modeling Contest of 2025. Join the theme discussion for Hive's HD Modeling Contest #7! Click here to post your idea!

Rotate a gate?

Status
Not open for further replies.
Level 15
Joined
Nov 26, 2005
Messages
1,151
I am searching for a way to rotate a building (or at least a unit with pathing and unmvovable.)
It's a gate and I need it to be able to face many angels, not only 270.

Any idea how to rotate it by casting the ability "Rotate [based on channel - no target]"

+Rep for help.
 
Level 17
Joined
Jan 21, 2010
Messages
2,111
Set the building default facing angle in gameplay constant to -1
Then set the building facing angle to -1
After that using trigger unit-make unit face angle
But i cant guarantee that the unit still can walk after the gate is destroyed or opened,
I better using 4 gates and replacing each other if i want to change it's direction rather than make the building to face some angle
 
Level 7
Joined
Jan 29, 2010
Messages
213
  • Untitled Trigger 002
    • Events
      • Unit - A unit Starts the effect of an ability
    • Conditions
      • (Ability being cast) Equal to Channel
    • Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • Rotation Equal to 0
        • Then - Actions
          • Set Rotation = 45
          • Unit - Move (Triggering unit) instantly to (Position of (Triggering unit)), facing 45.00 degrees
          • Skip remaining actions
        • Else - Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • Rotation Equal to 45
        • Then - Actions
          • Set Rotation = 90
          • Unit - Move (Triggering unit) instantly to (Position of (Triggering unit)), facing 90.00 degrees
          • Skip remaining actions
        • Else - Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • Rotation Equal to 90
        • Then - Actions
          • Set Rotation = 135
          • Unit - Move (Triggering unit) instantly to (Position of (Triggering unit)), facing 135.00 degrees
          • Skip remaining actions
        • Else - Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • Rotation Equal to 135
        • Then - Actions
          • Set Rotation = 180
          • Unit - Move (Triggering unit) instantly to (Position of (Triggering unit)), facing 180.00 degrees
          • Skip remaining actions
        • Else - Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • Rotation Equal to 180
        • Then - Actions
          • Set Rotation = 225
          • Unit - Move (Triggering unit) instantly to (Position of (Triggering unit)), facing 225.00 degrees
          • Skip remaining actions
        • Else - Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • Rotation Equal to 225
        • Then - Actions
          • Set Rotation = 270
          • Unit - Move (Triggering unit) instantly to (Position of (Triggering unit)), facing 270.00 degrees
          • Skip remaining actions
        • Else - Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • Rotation Equal to 270
        • Then - Actions
          • Set Rotation = 315
          • Unit - Move (Triggering unit) instantly to (Position of (Triggering unit)), facing 315.00 degrees
          • Skip remaining actions
        • Else - Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • Rotation Equal to 315
        • Then - Actions
          • Set Rotation = 0
          • Unit - Move (Triggering unit) instantly to (Position of (Triggering unit)), facing 0.00 degrees
        • Else - Actions
 
Level 17
Joined
Jan 21, 2010
Messages
2,111
sorry, i forgot, the art - fixed rotation is only for destructible,
But i have another suggestion
Why didn't you use the destructible gate?
to rotate simply replace it, beacuse if you rotate it neither building nor destructible have their appropiate pathing texture, so if we say, your gate has 45 degrees gate path texture, then you rotate it to 90 degrees, then the pathing texture will stay at 45 degrees'
So make another gate is the only way
 
Level 7
Joined
Jan 29, 2010
Messages
213
What about?
  • Set Rotation = Set Rotation + 45
  • Unit - Move (Triggering unit) instantly to (Position of (Triggering unit)), facing Rotation degrees
Because degrees use periodic functions you don't need anything else :)
Example:
810 = 720 + 90 = 2x360 + 90 = 90 degrees

OMG LOL I'm dump :D
(I already know all this, but it seems I need more practice to use it always when its possible :/)

Thanks for spending some time :)
 
Status
Not open for further replies.
Top