Jump to content

Disable Player Controls - Script


A.J.

Recommended Posts

Hello, I'm working on a script involving the Disableplayercontrols. Usually it works but not this time, my supposition is that it is a consequence of MenuMode.

 

Essentially, I eat a ingestible, inside the "effect block" this changes a variable linked to a quest var and the real script starts. There are many things happening in this script, everything works but not the "force 1st person".

 

Essentially, when the ingestible set this variable, this is what happens:

disableplayercontrols 1 1 1 1 1 1 1
do something

Since it wasn't working, I placed an additional control:

            disableplayercontrols 1 1 1 1 1 1 1
        if IsPC1stPerson
            do something
        else
            disableplayercontrols 0 0 0 1
        endif

Everything up there is inside a block that runs depending by an external variable value. That external variable is changed inside the "do something". This means that it can't go out from this script until it "does something", so until it passes the check "IsPC1stPerson".

 

What happening is that it runs the "do something", while my player is still in third person. In game, if I repeat one of those commands by console (disableplayercontrols 1 1 1 1 1 1 1 1 or simply 0 0 0 1) it forces the first person. What I think is that it does that block, so for him the first person is forced, but instead on my screen it isn't in this way. I think it's more of a "screen glitch", if it can make sense, because the rest of the script works perfectly, and it's full of things to do.

If you check my NVSE experiment here (http://www.youtube.com/watch?v=xudHKDLyzTc&feature=youtu.be), when the cam changes and jumps from the player to the little truck I used the same functions: the only difference is that it was triggered by a key with NVSE (so already in GameMode) and not in MenuMode. Any suggestions on how I should avoid MenuMode to cause this glitch?

 

I wish you a nice day.

Link to comment

Introducing a MenuMode condition wasn't working. Introducing a timer (to delay the forced first person of 1-2 seconds) didn't work. The only thing that worked was setting the time of the ingestible effect: it was to 0 since I wanted an instant effect, but it wasn't working and causing de-sync between its block and the GameMode block which it was linked. I had to put a time value to delay that... Desync issues on scripts scare me a lot, I'm glad I solved in this way even if it isn't the most pleased solution.

Link to comment

Archived

This topic is now archived and is closed to further replies.

  • Recently Browsing   0 members

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

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue. For more information, see our Privacy Policy & Terms of Use