• 🏆 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!
  • It's time for the first HD Modeling Contest of 2024. Join the theme discussion for Hive's HD Modeling Contest #6! Click here to post your idea!

[Trigger] Bounce Angle Formula

Status
Not open for further replies.
Level 8
Joined
Dec 16, 2007
Messages
252
Okey. I tried with this formula but didn't work. I'm trying to make a bounce angle.

  • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
    • If - Conditions
      • (Facing of Unit1[(Integer A)]) Greater than or equal to 180.00
    • Then - Actions
      • Set RM_Angle[(Integer A)] = (540.00 - (Facing of Unit1[(Integer A)]))
    • Else - Actions
      • Set RM_Angle[(Integer A)] = (360.00 - (Facing of Unit1[(Integer A)]))

This trigger works great. Except in some cases, it can't check if the wall is either south or north, west or right. Example with this code, let's say the red line is 45 degrees, which means it's reflection should be 315 degrees. And in this case it works great.

bamd1.png


But when I use this formula and try to bounce to the south direction, it went like this.

bacf5.png


The red line is still 45 degrees, but this time it also reflect 315 degrees, right in the wall, the black line. But it should have bounced 135 degrees, the white line. I can solve this by doing 180-Facing of unit, then the south wall will work, but then the right wall will be messed up. So I need to find a way to somehow check where I hit.
 
Level 8
Joined
Dec 16, 2007
Messages
252
That's what I'm doing right now.. Read the problem.

If you shoot a ball at 45 degrees, it can either bounce 315 degrees OR 135 degrees depending which side you throw it of the wall.. My formula only support 315 degrees. And I can't seem to find a way to make it support both 135 and 315 degrees depending where the wall is.
 
Status
Not open for further replies.
Top