• 💀 Happy Halloween! 💀 It's time to vote for the best terrain! Check out the entries to Hive's HD Terrain Contest #2 - Vampire Folklore.❗️Poll closes on November 14, 2023. 🔗Click here to cast your vote!
  • 🏆 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!
  • 🏆 HD Level Design Contest #1 is OPEN! Contestants must create a maze with at least one entry point, and at least one exit point. The map should be made in HD mode, and should not be openable in SD. Only custom models from Hive's HD model and texture sections are allowed. The only exceptions are DNC models and omnilights. This is mainly a visual and design oriented contest, not technical. The UI and video walkthrough rules are there to give everyone an equal shot at victory by standardizing how viewers see the terrain. 🔗Click here to enter!

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