Jump to content

Open the SleepMenu from a papyrus script


Recommended Posts

Posted

 

Hello

 

Does anybody know how to open the Sleepmenu from within a papyrus script ?

I have already tried it the usual way  with

 

UI.OpenMenu ("SleepWaitMenu")

 

but doing so - by default ? - the waitmenu is shown !! At first the difference seem only small, but the waitmenu

does not fire the OnSleepstart and Onsleepstop events and is therefore unusable.

 

I do not have knowledge about scaleform, AS3 scripts and the HUDmenus.

The only thing i have found so far is a public function setsleeping in the  as3 script.

Anyway I do not know how to call thh function, my trial


      UI.OpenMenu ("SleepWaitMenu")       ; TEST opens always the wait menu

        Var [] args = new Var[1]
        args [0] = True
        UI.Invoke("SleepWaitMenu", "root1.menu_mc.SetSleeping", args)

 

does not work. Maybe only the path is wrong ?

 

Any help is welcome ?

 

Regards

 
Posted
On 7/27/2022 at 9:16 PM, Monoman1 said:

perhaps a 'low tech' approach?

 

Activate a bed in a hidden cell ?

 

I want to make a FO4 mod similar to "Go to bed" in skyrim.

 

After a few tries, I managed to run an AI package on the player that lets the player go to bed and then plays the lying down animation.

If you now activate the bed, the "sleep menu" no longer opens as before instead the game engine automatically plays an animation in which the player gets up again.

Therefore, another way to open the sleep menu was necessary.

After the simple approach didn't work, I had already thought of a trick like this and moved an empty bed to the player.

 
;/
   objectreference testbed = game.getformfromfile (0x01e636, "Gotosleep.esp") as objectreference
   testbed.MoveTo (pl_ref)
   testbed.activate (pl_ref)
/;

 

But this trial lets the player standup also.?

Posted
1 hour ago, Kanlaon said:

But this trial lets the player standup also.

Hmm. Is that standard fallout behavior? (sorry I'm a skyrim modder mostly)

 

Perhaps some combination of: 

SetVehicle

SetRestrained

SetDontMove

 

SetVehicle would be my best bet. Provide the bed as an argument. 

 

(not sure if fallout has these equivalents)

Posted
3 hours ago, Monoman1 said:

Hmm. Is that standard fallout behavior? (sorry I'm a skyrim modder mostly)

 

Perhaps some combination of: 

SetVehicle

SetRestrained

SetDontMove

 

SetVehicle would be my best bet. Provide the bed as an argument. 

 

(not sure if fallout has these equivalents)

 

Ok, I will try something with Setvehicle and Setrestarined. Setdontmove is not listed in the FO4 CK wiki (but sometimes functions are forgotten there !) 

If i could find out how the game does the call to the sleepwaitmenu.swf I would try it this way, somewhere in the EXE you can find the string "Setsleeping".

 

Posted (edited)

ah crap you're right. I had fallout 4's version of that site bookmarked b4 but i just had to re-image my machine so i lost all my bookmarks :S

 

One more problem it may be then is the furniture object your using may not have the proper tag. There's a "nowait" keyword that is applied to bed objects. that's the only other thing i can think of

Edited by AKawaiiTent
  • 2 weeks later...
Posted

Finally I have found a workaround doing something in papyrus while a blackscreen is shown.

Not the best solution but a working solution.

If someone has a practicable good idea, I can replace it in future

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

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