Jump to content
Heavy Traffic ×

Change FOV with a script


Recommended Posts

Good evening everybody!

 

So I have recently been playing another game that made you "zoom in a bit" with a key.

I really miss this feature and think something like that would be nice to have in FO4.

 

I already know how to make a script do something when a keyboard key is pushed.

 

But how can I change the FOV value from within a script?

Is that even possible?

Link to comment
Share on other sites

In FO4, you can't call console commands from scripts, sadly ...

 

Yes, you can!

 

Either from Flash TerminalMenu, or directly from Papyrus by using https://www.nexusmods.com/fallout4/mods/51951

 

However, for me, the FOV console command does not work properly and the FOV immediately resets to some default value as soon as console is closed. Probably an ini setting or whatever, idk.

Link to comment
Share on other sites

 

In FO4, you can't call console commands from scripts, sadly ...

 

Yes, you can!

 

Either from Flash TerminalMenu, or directly from Papyrus by using https://www.nexusmods.com/fallout4/mods/51951

 

However, for me, the FOV console command does not work properly and the FOV immediately resets to some default value as soon as console is closed. Probably an ini setting or whatever, idk.

 

Oh my god!

 

There is a way to execute console commands from scripts?!?!

What haven't I found this before?

 

This might also make my "multiple playable characters" idea possible ...

Link to comment
Share on other sites

 

In FO4, you can't call console commands from scripts, sadly ...

 

Yes, you can!

 

Either from Flash TerminalMenu, or directly from Papyrus by using https://www.nexusmods.com/fallout4/mods/51951

 

However, for me, the FOV console command does not work properly and the FOV immediately resets to some default value as soon as console is closed. Probably an ini setting or whatever, idk.

 

 

There it is. I couldn't find the FO4 version earlier.

 

Just using FOV in the console isn't enough. First you need two parameters for fov, one for the pipboy, one for the landscape view. Then you have to push that to the ini file so it stays:

fov 80 110
saveini

Where 80 is for the pipboy, and 110 for the world view.

Edited by aurreth
Link to comment
Share on other sites

  • 2 weeks later...

Ok, so I used the following script to change the FOV as long as the middle mouse button is pushed:

Scriptname ZoomButtonScript extends Quest
{The scirpt that zooms in when a button is clicked
}


Event OnInit()
      RegisterForKey(258)  
endevent

Event OnKeyDown(int keyCode)
    UnregisterForKey(258)
    if (keyCode == 258 )
        ConsoleUtil.ExecuteCommand("fov 10")
    endif
     RegisterForKey(258)
EndEvent

Event OnKeyUp(int keyCode, float time)
    UnregisterForKey(258)
    if (keyCode == 258 )
        ConsoleUtil.ExecuteCommand("fov 0")
    endif
     RegisterForKey(258)
EndEvent

But when I push the middle mouse button, nothing happens.

When I release it, nothing happens.

 

When I then push the middle mouse button agian, the game CTDs.

 

When I manually enter "fov 10" into the console, the fov changes as it should.

(10 is very extreme, I just use it as an example)

Link to comment
Share on other sites

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...