Jump to content

DisablePlayerControls and tfc or photomode


RavenKZP

Recommended Posts

Hi all,

I'm asking for some help regarding script improvements.

Script is playing an animation on player, then wait a given time next animation and so on. To prevent player from moving I've tried the following functions:

  • DisablePlayerControls()
  • Game.GetPlayer().SetDontMove()
  • Game.GetPlayer().SetRestrained()

So I'm disabling movement at very beginning and enabling it at very end of script.

 

But the issue is that if we enter tfc, tfc 1 or photomode during the animation sequence, after exiting tfc player will not be able to move.

 

I will try find a solution, but if someone have some idea or solution please put a comment, it will be very appreciated.

Link to comment
Share on other sites

From what I can tell, the SetRestrained() function should handle both stopping movement, and afaik player controls <<<not so sure after all.

 

from https://skyrimck.uesp.net/wiki/SetRestrained_-_Actor#Examples

 

Using SetRestrained on the player disables player movement, camera switching, and camera rotating, but keeps the full HUD displayed (unlike Game.DisablePlayerControls()).

Restrained Actors can still be moved with functions that invoke movement, such as KeepOffsetFromActor().
Actors cannot be restrained and unconscious in the same time - flaging the actor as restrained unflags it as unconscious, and vice versa.

 

Are you firing a Game.GetPlayer().SetRestrained(false) prior to exiting your script, or are you expecting some other housekeeping to automatically fire it? if the latter, I'd suggest the former.

 

(And if the other commands are also actually necessary, then forcing their resets too, prior to exiting your script.)

 

Although I'm not sure how you programmatically query if the player has actually regained controls to validate/confirm...

 

nvm. that seems covered by GetPlayercontrols(), but there doesn't seem to be a complimentary Get() for SetRestrained(). Maybe IsArrested() (true if, false if not) gets toggled when SetRestrained is fired and could be used as a test, idk.

 

The mod Defeat has something about arrested, although maybe that only applies to guards..no clue really, just speculating

Link to comment
Share on other sites

For a 'photo mode' you could consider self-porting Screenshot Hotkeys - SHOT from LE to SE (there is a post in the comment section which explains what to do). It has been a long time since I tested / looked at the code. I cannot speak to its continued effectiveness. Still there may be some useful information.

Link to comment
Share on other sites

  • Recently Browsing   0 members

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