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

Check a player's camera position

Status
Not open for further replies.
Level 7
Joined
Apr 17, 2017
Messages
316
After checking GUI equivalents, here's what you should do:
  • init
    • Events
      • Time - Elapsed game time is 0.01 seconds
    • Conditions
    • Actions
      • Countdown Timer - Start timer as a Repeating timer that will expire in 0.30 seconds
  • camtest
    • Events
      • Time - timer expires
    • Conditions
    • Actions
      • Set location = (Target of current camera view)
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Region 000 <gen> contains location) Equal to True
        • Then - Actions
          • Camera - Set Player 1 (Red)'s camera Distance to target to 200.00 over 0.00 seconds
        • Else - Actions
      • Custom script: call RemoveLocation(udg_location)
 
Level 39
Joined
Feb 27, 2007
Messages
5,013
@Aeryn there's no real reason to add the event that way instead of just giving camtest the periodic event: Time - Every 0.30 seconds of game-time. Even though the timer cannot be accessed directly the trigger can still be turned off to pause its execution.
 
Status
Not open for further replies.
Top