• 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.

[Solved] Detect Player "Camera" position

Status
Not open for further replies.

Kazeon

Hosted Project: EC
Level 34
Joined
Oct 12, 2011
Messages
3,449
GetCameraTargetPositionX()
No, you don't need to. The function itself returns asynchronous value, depending on who's machine it's called.
For example, player 1 is currently looking at the exact center of the map. So the function will return "0" for player 1.
At the very same moment, player 2 is looking at different location, so it will return different value for player 2 (not "0").
I hope you get what I mean.
 

Kazeon

Hosted Project: EC
Level 34
Joined
Oct 12, 2011
Messages
3,449
So here's the pseudo code:
Code:
    if IsPlayerInForce(GetLocalPlayer(), ThePlayerGroup) and GetCameraPositionX() > RectMinX and GetCameraPositionX() < RectMaxX and GetCameraPositionY() > RectMinY and GetCameraPositionY() < RectMaxY then
        Do whatever here. But do note that everything's done here will be asynchronous. If you are not careful of what you're doing then it will lead you to desync problem.
    endif
 
Status
Not open for further replies.
Top