• 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.
  • 💡 We're thrilled to announce that our upcoming texturing contest is in the works, and we're eager to hear your suggestions! Please take this opportunity to share your ideas in this theme discussion thread for the Texturing Contest #34!
  • 🏆 Hive's 7th HD Modeling Contest: Icecrown Creature is now open! The frozen wastes of Icecrown are home to some of Azeroth’s most terrifying and resilient creatures. For this contest, your challenge is to design and model a HD 3D monster that embodies the cold, undead, and sinister essence of Icecrown! 📅 Submissions close on April 13, 2025. Don't miss this opportunity to let your creativity shine! Enter now and show us your frozen masterpiece! 🔗 Click here to enter!

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