Reverse Ice

Gummi_Bears

New Member
Reaction score
5
Im making an ice escape map where theres different kinds of ice. If you're on reverse ice, then if you target a point you should turn to the opposite direction you clicked. My trigger for this doesnt work...help. Not sure why, but if I spam click on reverse ice I dont turn straight but on random angles. Any way to prevent this? Or change my code so reverse ice works? Help appreciated.

Code:
Basic Settings
    Events
        Map initialization
    Conditions
    Actions
        Set S_Terrain[1] = Northrend - Snow
        Set S_Terrain[2] = Northrend - Ice
        Set S_Terrain[3] = Icecrown Glacier - Dark Ice
        Set S_Terrain[4] = Icecrown Glacier - Ice


Code:
Sliding
    Events
        Time - Every 0.02 seconds of game time
    Conditions
    Actions
        Unit Group - Pick every unit in (Units of type Demon Hunter) and do (Actions)
            Loop - Actions
                Set S_Pos = (Position of (Picked unit))
                If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                    If - Conditions
                        Or - Any (Conditions) are true
                            Conditions
                                (Terrain type at S_Pos) Equal to S_Terrain[2]
                                (Terrain type at S_Pos) Equal to S_Terrain[3]
                                (Terrain type at S_Pos) Equal to S_Terrain[4]
                        ((Picked unit) is alive) Equal to True
                    Then - Actions
                        Unit Group - Add (Picked unit) to SlidingGroup
                        Set S_Pos = (Position of (Picked unit))
                        Set S_Point = (S_Pos offset by 7.00 towards (Facing of (Picked unit)) degrees)
                        Unit - Move (Picked unit) instantly to S_Point
                        Custom script:   call RemoveLocation( udg_S_Point )
                    Else - Actions
                        If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                            If - Conditions
                                (Terrain type at S_Pos) Equal to S_Terrain[1]
                            Then - Actions
                                Unit - Kill (Picked unit)
                                Unit Group - Remove (Picked unit) from SlidingGroup
                            Else - Actions
        Custom script:   call RemoveLocation( udg_S_Pos )

Code:
Slide Turn Reverse
    Events
        Unit - A unit Is issued an order targeting a point
    Conditions
        ((Triggering unit) is in SlidingGroup) Equal to True
        (Terrain type at (Position of (Triggering unit))) Equal to S_Terrain[4]
    Actions
        Unit - Order (Triggering unit) to Stop
        Unit - Make (Triggering unit) face ((Angle from (Position of (Triggering unit)) to (Target point of issued order)) + 180.00) over 0.00 seconds
 

Music Man

Cool Member
Reaction score
3
This only happens when you spam click?

Perhaps if you try pausing the unit for the duration of the turn, or throw in a "wait condition" setting the condition to facing the opposite direction it may stop the trigger from overloading on commands. Because what might be happening is it might be taking the position while its turning and that's why those random angles occur.
 

Azylaminaz

Vox Populi
Reaction score
91
Use GUI tags...
Why change the direction the unit is facing opposed to just making it slide backwards?
Trigger:
  • Sliding
    • Events
      • Time - Every 0.03 seconds of game time
    • Conditions
    • Actions
      • Unit Group - Pick every unit in (Units of type Demon Hunter) and do (Actions)
        • Loop - Actions
          • Set S_Pos = (Position of (Picked unit))
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • Or - Any (Conditions) are true
                • Conditions
                  • (Terrain type at S_Pos) Equal to S_Terrain[2]
                  • (Terrain type at S_Pos) Equal to S_Terrain[3]
                  • (Terrain type at S_Pos) Equal to S_Terrain[4]
              • ((Picked unit) is alive) Equal to True
            • Then - Actions
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • (Terrain type at S_Pos) Equal to S_Terrain[4]
                • Then - Actions
                  • Set S_Point = (S_Pos offset by 7.00 towards ((Facing of (Picked unit)) + 180) degrees)
                • Else - Actions
                  • Set S_Point = (S_Pos offset by 7.00 towards (Facing of (Picked unit)) degrees)
              • Unit - Move (Picked unit) instantly to S_Point
              • Custom script: call RemoveLocation( udg_S_Point )
            • Else - Actions
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • (Terrain type at S_Pos) Equal to S_Terrain[1]
                • Then - Actions
                  • Unit - Kill (Picked unit)
                • Else - Actions
      • Custom script: call RemoveLocation( udg_S_Pos )
 
General chit-chat
Help Users
  • No one is chatting at the moment.

      The Helper Discord

      Members online

      No members online now.

      Affiliates

      Hive Workshop NUON Dome World Editor Tutorials

      Network Sponsors

      Apex Steel Pipe - Buys and sells Steel Pipe.
      Top