Jump to content

Papyrus problem with function


noctara

Recommended Posts

Hi folks,

 

First, I am a total noob in both the creation kit and programming so please be gentle :ohdear:

 

basically what i want to do:

 

event onactivate (game.getplayer())

 

game.showsleepwaitmenu()

 

end event

 

for some reason i can't get my script to compile. The creation kit keeps saying that the variable sleepwaitmenu is not defined. Does anybody have an idea or experience in how to make this working?

 

Edit: I made the script to extend actor (maybe thats wrong as well )

 

Any help would be appreciated :biggrin:

Edited by noctara
Link to comment
Share on other sites

Ok, basically what i want to do, is to create a new furniture object.. in this case a bed. I thought it'll be possible (or at least is a start) if i can trigger the menu on activate. So i wanted to keep it small and simple for a start.

Right now the script looks like this:

 

Scriptname TestMod02CoffinActivatorScript extends Objectreference

 

import debug

import utility

import game

 

ObjectReference property objSelf auto hidden

 

 

Event OnActivate(ObjectReference akActionRef)

 

if (akActionRef == Game.GetPlayer())

 

Trace("Aktiviert von mir")

game.ShowSleepWaitMenu()

 

endif

 

endEvent

 

The compiler says that "ShowSleepWaitMenu" is not a function and needs to be called on a variable.

If I replace "ShowSleepWaitMenu" with "ShowRaceMenu" it compiles just fine (didn't test it ingame yet).

I have the feeling that its because "ShowSleepWaitMenu" is not a function of the game script... however, where would i find it then? Is it even accessible??

I am a little lost here :whistling:

Link to comment
Share on other sites

I tried that... i wont even be able activate it then... maybe because of the collision??

also just tried the racemenu ingame... works just fine

I got a temporary solution with just hiding a scaled-down bedroll in the coffin... but i would like to do it properly if it can be done.

If u think a little out of the box there are just so many possibilties here :biggrin:

 

Edit: in further steps i want to add some animations before entering the sleepmenu

Edited by noctara
Link to comment
Share on other sites

Where did you find ShowSleepWaitMenu? So far as I can tell (via the CK wiki) there is no such Papyrus function. I'm not aware of any other way to invoke this via a script.

 

One thing you might try is to put a bed nearby your new activator, but somewhere hidden (e.g. under the floor). Then make your OnActivate event activate the bed:

ObjectReference property myRealBed auto ;make sure you connect this to a real bed somewhere

Event OnActivate(ObjectReference akActionRef)
   debug.messagebox("Activated!")
   myRealBed.activate(akActionRef)
endEvent

This pretty much just passes along your activate event straight to the actual bed.

Link to comment
Share on other sites

Thx kromey! ur idea sounds good to me.. i will try it today when i am back from work.

I figured, that "show" is the command to make menus display via script and thought it'll be possible to display the "sleepwaitmenu.swf" with this command.

For me it seems pretty strange that you can literally make any menu display with this command... just not the sleepwaitmenu... why would u exclude this menu???

Link to comment
Share on other sites

  • Recently Browsing   0 members

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