Scripts / reset camera back to player after changing it?

Author
Message
Bolt Action Gaming
GameGuru Tool Maker
11
Years of Service
User Offline
Joined: 24th Oct 2013
Location: Harrisburg, PA (USA)
Posted: 24th Jan 2018 18:01
So I have a good system for changing the camera's position but I was wondering if anyone has a method for returning the camera's viewpoint back to the stock player location?
smallg
Community Leader
19
Years of Service
User Offline
Joined: 8th Dec 2005
Location:
Posted: 24th Jan 2018 18:39 Edited at: 24th Jan 2018 18:42
so you're talking about swapping between different camera shots?
store the location before you move it
V = GetCameraPositionX (0) where V is the X coordinate of the camera
V = GetCameraPositionY (0) where V is the Y coordinate of the camera
V = GetCameraPositionZ (0) where V is the Z coordinate of the camera
V = GetCameraAngleX (0) where V is the X angle of the camera
V = GetCameraAngleY (0) where V is the Y angle of the camera
V = GetCameraAngleZ (0) where V is the Z angle of the camera

then when you're done move it back
SetCameraPosition (0, x, y, z ) where XYZ are 3D coordinates
SetCameraAngle ( 0, x, y, z ) where XYZ are euler angles

if the player can move during the "other" camera positions you will need to adjust the new values by also storing the player's angle and position along with the camera then adjust accordingly with the new player position/angle.
so if the player has rotated his Y view by 45 you will need to update the value stored by GetCameraAngleY by 45 too (assuming you want to keep the new rotation but in the original camera).
lua guide for GG
https://steamcommunity.com/sharedfiles/filedetails/?id=398177770
windows 10
i5 @4ghz, 8gb ram, AMD R9 200 series , directx 11
Bolt Action Gaming
GameGuru Tool Maker
11
Years of Service
User Offline
Joined: 24th Oct 2013
Location: Harrisburg, PA (USA)
Posted: 24th Jan 2018 19:13
Ok, that helps. Do you know if setting the override back to off will reset it? I haven't had a chance to test it myself and am not in a position to currently. I.e. I am setting SetCameraOverride to 3, if I set it to 0 (off) will it reset it back to the player -position?

smallg
Community Leader
19
Years of Service
User Offline
Joined: 8th Dec 2005
Location:
Posted: 24th Jan 2018 20:43
i would assume so, seems like that is the point in the command but i haven't used it myself, would certainly be the quickest method if so
lua guide for GG
https://steamcommunity.com/sharedfiles/filedetails/?id=398177770
windows 10
i5 @4ghz, 8gb ram, AMD R9 200 series , directx 11
Bolt Action Gaming
GameGuru Tool Maker
11
Years of Service
User Offline
Joined: 24th Oct 2013
Location: Harrisburg, PA (USA)
Posted: 25th Jan 2018 14:43
So FYI it does work in that fashion, so I'm good now. Thanks!

Login to post a reply

Server time is: 2024-12-22 19:12:24
Your offset time is: 2024-12-22 19:12:24