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

Collision Dectection/ Distance Checker GUI

Status
Not open for further replies.
This is my loop trigger I'm trying to make it work like a knock back system to find collision detection for my camera system, and something isn't quite working right The distance is being set to 0 instead of the appropriate real number.


  • CheckLooper
    • Events
      • Time - Every 0.03 seconds of game time
    • Conditions
    • Actions
      • Unit Group - Pick every unit in DistanceCheckerGroup and do (Actions)
        • Loop - Actions
          • Set TempPN = (Player number of (Owner of (Picked unit)))
          • Set TempAngle = (((Facing of PlayerHero[TempPN]) - 180.00) + 0.00)
          • Set TempPoint = ((Position of (Picked unit)) offset by 8.00 towards ((Facing of PlayerHero[TempPN]) + 180.00) degrees)
          • Set CamDisTempPoint = (Position of PlayerHero[TempPN])
          • Unit - Move (Picked unit) instantly to TempPoint
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • ((Picked unit) is in (Units within 1100.00 of CamDisTempPoint)) Equal to False
            • Then - Actions
              • Set PlayerMaxCamDistance[TempPN] = 1150.00
              • Unit - Remove (Picked unit) from the game
            • Else - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • ((Picked unit) is in (Units within 3.00 of TempPoint)) Equal to False
            • Then - Actions
              • Set PlayerMaxCamDistance[TempPN] = (Distance between CamDisTempPoint and TempPoint)
              • Unit - Remove (Picked unit) from the game
            • Else - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • (Number of units in DistanceCheckerGroup) Equal to 0
            • Then - Actions
              • Trigger - Turn off (This trigger)
            • Else - Actions
          • Custom script: call RemoveLocation(udg_TempPoint)
          • Custom script: call RemoveLocation(udg_CamDisTempPoint)
I'm not too worried about leaks right now, I'm going to clean it up when I put it into my map.
 
Status
Not open for further replies.
Top