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

[Trigger] Terrain "Bounce" Trigger

Status
Not open for further replies.
Level 4
Joined
Dec 6, 2007
Messages
78
I'm looking for a trigger that will make a unit "bounce" back in the direction whence it came upon setting foot on a certain type of terrain. In the map, the game is spent on ice. I already have a slide trigger implemented so thats working fine. The area of ice covers most of the map in a big circular shape, where the outside turns to snow before the map ends. What I want to have happen is, when a unit is sliding and makes contact with the snow, it turns them 180 degrees and sends them sliding back in that direction.

Help appreciated, I've tried god knows what and asked various people already to no avail.
 
Level 16
Joined
Oct 12, 2008
Messages
1,570
I'll try to help,, Working on it now ^^
I'll get back to you As soon as i got a (hopefully usefull) trigger

  • Untitled Trigger 001
    • Events
      • Time - Every 0.10 seconds of game time
    • Conditions
    • Actions
      • Unit Group - Pick every unit in (Units in SlideRegion <gen> matching (((Owner of (Matching unit)) controller) Equal to User)) and do (Actions)
        • Loop - Actions
          • Set SlidePoint = (Position of (Picked unit))
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • (Terrain type at SlidePoint) Equal to Northrend - Snow
            • Then - Actions
              • Unit - Make (Picked unit) face ((Facing of (Picked unit)) + 180.00) over 0.50 seconds
            • Else - Actions
          • Custom script: call RemoveLocation(udg_SlidePoint)
Make sure you have a region where the sliding happens. I called it 'SlideRegion'
(The condition is to make sure enemy units dont get turned)
I dont know if making the unit face an angle is enough? Should i make them move a little bit so they are not on the snow anymore?

If you need to move them, you need an other action, not an extra action
It will look like this:
  • Untitled Trigger 001
    • Events
      • Time - Every 0.10 seconds of game time
    • Conditions
    • Actions
      • Unit Group - Pick every unit in (Units in SlideRegion <gen> matching (((Owner of (Matching unit)) controller) Equal to User)) and do (Actions)
        • Loop - Actions
          • Set SlidePoint = (Position of (Picked unit))
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • (Terrain type at (Position of (Picked unit))) Equal to Northrend - Snow
            • Then - Actions
              • Set SlidePoint = ((Position of (Picked unit)) offset by 50.00 towards ((Facing of (Picked unit)) + 180.00) degrees)
              • Unit - Move (Picked unit) instantly to SlidePoint, facing ((Facing of (Picked unit)) + 180.00) degrees
            • Else - Actions
          • Custom script: call RemoveLocation(udg_SlidePoint)
 
Status
Not open for further replies.
Top