How to retrieve current FOV in ACS?

Discuss all aspects of editing for ZDoom.
Forum rules
Before asking on how to use a ZDoom feature, read the ZDoom wiki first. If you still don't understand how to use a feature, then ask here.

How to retrieve current FOV in ACS?

Postby Nash » Wed Jun 13, 2012 8:39 pm

Is there a way to accurately retrieve the player's current FOV in ACS?

GetCVar("fov") doesn't work because, understandably, fov isn't a cvar.
User avatar
Nash
http://twitter.com/ISurvivorGame
 
Joined: 27 Oct 2003
Location: Kuala Lumpur, Malaysia

Re: How to retrieve current FOV in ACS?

Postby Nash » Wed Jun 13, 2012 9:28 pm

Well, I just realized this isn't possible... hacked something together real quick which seems to work...

Code: Select allExpand view

        
// [Nash] get current FOV
        
case ACSF_GetPlayerFOV:
            
actor SingleActorFromTID(args[0], activator);
            if (
actor != NULL)
            {
                if (
actor->player != NULL)
                {
                    return (int)
actor->player->FOV;
                }
            }
            else return 
0;
 


Seems to work. Any hidden problems I need to be aware of?
User avatar
Nash
http://twitter.com/ISurvivorGame
 
Joined: 27 Oct 2003
Location: Kuala Lumpur, Malaysia

Re: How to retrieve current FOV in ACS?

Postby Gez » Thu Jun 14, 2012 3:32 am

Why not make it retrievable like ACS actor properties instead of a new function just for that?

Also, I believe non-players have a FOV of 180 unless they have the LOOKALLAROUND flag in which case it's 360. (I can't check at the moment.)
Gez
 
Joined: 06 Jul 2007

Re: How to retrieve current FOV in ACS?

Postby Graf Zahl » Thu Jun 14, 2012 9:20 am

Monster field ov view can also be changed in A_Look, so the correctness is not guaranteed.
User avatar
Graf Zahl
 
Joined: 19 Jul 2003
Location: Germany

Re: How to retrieve current FOV in ACS?

Postby Nash » Sat Jun 16, 2012 11:57 am

Well I'm apparently too dumb to find the name of the field that stores an actor's FOV... :/

Spoiler:
User avatar
Nash
http://twitter.com/ISurvivorGame
 
Joined: 27 Oct 2003
Location: Kuala Lumpur, Malaysia

Re: How to retrieve current FOV in ACS?

Postby Gez » Sat Jun 16, 2012 12:06 pm

It's not stored, that's why. It's either contained in the A_Look call, 180°, or 360°.
Gez
 
Joined: 06 Jul 2007

Re: How to retrieve current FOV in ACS?

Postby Nash » Sat Jun 16, 2012 12:57 pm

Well then that's too much work for what I intend to use this for anyway. I was only interested in the player's FOV so that 3-d -> 2-d HUD elements scale properly with dynamic FOV...
User avatar
Nash
http://twitter.com/ISurvivorGame
 
Joined: 27 Oct 2003
Location: Kuala Lumpur, Malaysia


Return to Editing

Who is online

Users browsing this forum: Bing [Bot], Ijon Tichy and 1 guest