Scripts / Restrict viewing angles

Author
Message
Dralel
GameGuru TGC Backer
10
Years of Service
User Offline
Joined: 4th Nov 2013
Location: UK
Posted: 5th Aug 2015 02:02
This is a rather easy request, though I'm not sure if GG currently supports this. But I'm looking for a script on how to restrict the viewing angles of the player. What I mean is, have it so that the player cannot view up and down (y-axis) in full. Maybe only 35 degrees, not the full 45. Is there a way to do this? Thanks.
PM
Bored of the Rings
GameGuru Master
19
Years of Service
User Offline
Joined: 25th Feb 2005
Location: Middle Earth
Posted: 5th Aug 2015 14:43 Edited at: 5th Aug 2015 19:57
for this you could read the g_PlayerAngY var in.

g_PlayerAngY - Returns the players Y angle/rotation

so in the main script you would need to check if the value of g_PlayerAngY > 35 or whatever value you want. The only problem I don't think you can write to this variable, not tried it out myself. This var probably only a read var. I will check see if there is a way of doing this , but at the moment I don't think it's possible. Unless the Y angle values can be stricted in the FPE/entity attribs.
Professional Programmer: Languages- SAS, C++, SQL, PL-SQL, JavaScript, HTML, Darkbasic Pro, Purebasic, others
Hardware: Dell Precision 490; AMD Radeon HD 7570; LG TFT monitor (widescreen).
Dralel
GameGuru TGC Backer
10
Years of Service
User Offline
Joined: 4th Nov 2013
Location: UK
Posted: 6th Aug 2015 12:56
It sounds like it's possible to check the player angle but not actually stop the player from looking beyond that?
PM
Bored of the Rings
GameGuru Master
19
Years of Service
User Offline
Joined: 25th Feb 2005
Location: Middle Earth
Posted: 6th Aug 2015 13:31 Edited at: 6th Aug 2015 13:37
I think that seems to be the case but haven't had much time to check properly, I'll try and find some time tonight as I want to be able to do the same thing.
Meant to ask, is this for 1st person or 3rd person?
[update]- looking at default parameters for 3rd person you can only lock the camera. I don't think this can be done until we have full player camera control. This is one of the feature vote requests I believe.
Professional Programmer: Languages- SAS, C++, SQL, PL-SQL, JavaScript, HTML, Darkbasic Pro, Purebasic, others
Hardware: Dell Precision 490; AMD Radeon HD 7570; LG TFT monitor (widescreen).
Dralel
GameGuru TGC Backer
10
Years of Service
User Offline
Joined: 4th Nov 2013
Location: UK
Posted: 6th Aug 2015 14:05
First person.
PM

Login to post a reply

Server time is: 2024-05-07 00:08:42
Your offset time is: 2024-05-07 00:08:42