Jump to content

Function to detect if Player is in First person?


Hoamaii

Recommended Posts

Hi,

 

Haven't modded for a while but I cant' seem to find any Paryrus function which will let me reliably detect if the player is in First Person mode or in Third.

 

In Skyrim, I used to rely on the function:

If PlayerRef.GetAnimationVariableInt("i1stPerson")

While this compiles in FO4 papyrus, it does not return any value. I've been digging though the CK wiki pages (a bit of a mess), forums, Vanilla scripts, game settings in CK, etc... Couldn't find any answer.

 

Anybody can give me a hint?

 

And while I'm at it, anybody knows of a function which can let me detect if the player is swimming or not?

 

Many thanks in advance!..

 

 

Link to comment
Share on other sites

Use

PlayerRef.GetAnimationVariableBool("IsFirstPerson") 

instead. About swimming detection as I remember there is a conditional function IsSwimming and you can make a scripted magic effect with that condition and add that on player as spell and it will fire when IsSwimming becomes true.

Edited by shavkacagarikia
Link to comment
Share on other sites

Okay, been a while since I modded and I may have forgotten a few stuff, but I seem to remember in Skyrim you could use that one more directly, like "If PlayerRef.IsFirstPerson()". So many little thing have changed in Papyrus between the two games, right? and documentation is unfortunately very thin...

 

Thanks for replying, Shavkacagarikia, and okay I'll try a bool instead of an Int - would you by any chance know if any modder has been listing the various AnimationVariables somewhere?

 

As for IsSwimming, yeah I saw I can use it as a condition on a magicEffect - I'll get down to that if there's no other way.

 

One last question if I may: I would assume "IsOnMount" would refer to the player riding a Vertibird, right?

 

Many thanks for your help :).

 

Cheers!

Link to comment
Share on other sites

No as I know there is a list of animation variables only for skyrim, but you can find them in behavior files.
I dont know if IsOnMount works but I suggest you to use IsBeingRiddenBy, as vertibirds are actors, it will look like this: vertibirdProperty.IsBeingRiddenBy(game.getplayer())

 

Edit:

IsOnMount should work too as it is used in vanilla vertibird scripts.

Edited by shavkacagarikia
Link to comment
Share on other sites

Hey, thanks again!..

 

Behavior files, yep... I was afraid of that. Took a quick look at them and unfortunately the names of them are quite enigmatic in most cases, like "IdleA03_PoseD", which would mean converting all the .hkx files into .kf format and loading them into 3DS to make sure I've got the proper animation... Ahem, modding sure requires dedication and patience, right? And I suspect, like in Skyrim, there are also cases where the AnimationEvent names in the CK differ from their names in behavior files...

 

Thanks for the info about Vertibird too - I'll try both, see how it works.

Link to comment
Share on other sites

  • Recently Browsing   0 members

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