• Listen to a special audio message from Bill Roper to the Hive Workshop community (Bill is a former Vice President of Blizzard Entertainment, Producer, Designer, Musician, Voice Actor) 🔗Click here to hear his message!
  • Read Evilhog's interview with Gregory Alper, the original composer of the music for WarCraft: Orcs & Humans 🔗Click here to read the full interview.

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