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

Lock camera bounds per player

Status
Not open for further replies.
Level 12
Joined
May 22, 2015
Messages
1,051
Is there a way to / how do you lock a player's camera? It would need to be separate per player (each potentially locked in a different place, some locked, some not).
 
Use GetLocalPlayer() and SetCameraBounds(...)

JASS:
native SetCameraBounds              takes real x1, real y1, real x2, real y2, real x3, real y3, real x4, real y4 returns nothing

//... example
if GetLocalPlayer() == Player(0) then
     call SetCameraBounds(bottomLeftX, bottomLeftY, topRightX, topRightY, topLeftX, topLeftY, bottomRightX, bottomRightY)
endif

I'm not sure if that is the correct ordering for SetCameraBounds. You can check the war3map.j to see how Blizzard does it (check the main function). The order might not matter (untested) since it might just be definitions passed into some rect class that accepts an arbitrary order.

A similar topic:
http://www.hiveworkshop.com/forums/...sible-lock-camera-within-certain-area-257876/
And if you want to learn more about GetLocalPlayer():
http://www.thehelper.net/threads/jass-getlocalplayer.77369/
 
Level 12
Joined
May 22, 2015
Messages
1,051
So I have to reset it to the whole map after I don't want to lock the camera any more? Is there somewhere I can find the coordinates I need for my map?
 
Status
Not open for further replies.
Top