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!
I set camera bounds to some region. I make the region as smallest as possible. Then when I go in-game, I notice that even though the region is the smallest, i can still move my camera a little down, left, right and up. Yet I've seen maps in which the camera is unable to move once bound to some region.
Tried chaosy's suggestion - it works, but not where i want it. the no region is locked to somewhere and then i can't apply the camera i want.
Wietlol - what do you mean a 0x0 region? How can you make such a region?
Dr Super Good - i tried that, doesn't work as well. i can still move the camera a bit. also i checked in other rpg maps, they don't reinforce the camera but just have it bound to a region.
A 0x0 region is a region where the topleft, topright, bottomleft and bottomright corner are all on the same coordinate.
In essence, a region with 0 width and 0 height (0x0)
A 0x0 region is a region where the topleft, topright, bottomleft and bottomright corner are all on the same coordinate.
In essence, a region with 0 width and 0 height (0x0)
Anyway, if you have JNGP, you can create a trigger, transform it into custom text (JASS script) and place this script into it (removing all other code from that trigger):
JASS:
library Camera
function ForceCameraOnCoordinate takes real x, real y returns nothing
call SetCameraBounds(x, y, x, y, x, y, x, y)
endfunction
function ForceCameraOnPoint takes location l returns nothing
call ForceCameraOnCoordinate(GetLocationX(l), GetLocationY(l))
endfunction
function ForceCameraOnPointForPlayer takes player p, location l returns nothing
if GetLocalPlayer() == p then
call ForceCameraOnCoordinate(GetLocationX(l), GetLocationY(l))
endif
endfunction
function ForceCameraOnCoordinateForPlayer takes player p, real x, real y returns nothing
if GetLocalPlayer() == p then
call ForceCameraOnCoordinate(x, y)
endif
endfunction
endlibrary
If you dont have JNGP, you just copy the functions (everything except the library Camera and endlibrary tags) and paste it into your header file.
After that you download JNGP 2.0 and praise me for telling you to do so.
Anyway, if you are unfamiliar with GetLocalPlayer() stuff, use ForceCameraOnCoordinateForPlayer() or ForceCameraOnPointForPlayer()
You can use these methods in GUI using a custom script like this:
Test
Events
Player - Player 1 (Red) skips a cinematic sequence
Conditions
Actions
Set TempLocation[0] = (Position of Paladin 0000 <gen>)
You need the player and location/coordinate to force the camera on.
Using the function without the "ForPlayer" will do this for all players.
You can reset the camera to the game camera using the normal Reset to game camera GUI action or you can update the position of the camera using this method if you want to.
Anyway, if you have JNGP, you can create a trigger, transform it into custom text (JASS script) and place this script into it (removing all other code from that trigger):
JASS:
library Camera
function ForceCameraOnCoordinate takes real x, real y returns nothing
call SetCameraBounds(x, y, x, y, x, y, x, y)
endfunction
function ForceCameraOnPoint takes location l returns nothing
call ForceCameraOnCoordinate(GetLocationX(l), GetLocationY(l))
endfunction
function ForceCameraOnPointForPlayer takes player p, location l returns nothing
if GetLocalPlayer() == p then
call ForceCameraOnCoordinate(GetLocationX(l), GetLocationY(l))
endif
endfunction
function ForceCameraOnCoordinateForPlayer takes player p, real x, real y returns nothing
if GetLocalPlayer() == p then
call ForceCameraOnCoordinate(x, y)
endif
endfunction
endlibrary
If you dont have JNGP, you just copy the functions (everything except the library Camera and endlibrary tags) and paste it into your header file.
After that you download JNGP 2.0 and praise me for telling you to do so.
Anyway, if you are unfamiliar with GetLocalPlayer() stuff, use ForceCameraOnCoordinateForPlayer() or ForceCameraOnPointForPlayer()
You can use these methods in GUI using a custom script like this:
Test
Events
Player - Player 1 (Red) skips a cinematic sequence
Conditions
Actions
Set TempLocation[0] = (Position of Paladin 0000 <gen>)
You need the player and location/coordinate to force the camera on.
Using the function without the "ForPlayer" will do this for all players.
You can reset the camera to the game camera using the normal Reset to game camera GUI action or you can update the position of the camera using this method if you want to.
There is solution based on "Lock camera target to unit".
Copy Dummy unit and trigger "Test Trigger", remove "Message for Player" action.
Also config Test Trigger to use my Dummy unit, set his position to needed position and Expiration timer to needed value (you may remove this action and kill unit using triggers also).
There is solution based on "Lock camera target to unit".
Copy Dummy unit and trigger "Test Trigger", remove "Message for Player" action.
Also config Test Trigger to use my Dummy unit, set his position to needed position and Expiration timer to needed value (you may remove this action and kill unit using triggers also).
Yes, since you'd use a "lock camera periodic system" thing, you'd use an invisible dummy.
Yet, if the dummy is removed, the camera will be unlocked.
If the dummy dies, the camera will still be locked because the unit exists, while it is not alive.
Yes, since you'd use a "lock camera periodic system" thing, you'd use an invisible dummy.
Yet, if the dummy is removed, the camera will be unlocked.
If the dummy dies, the camera will still be locked because the unit exists, while it is not alive.
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.