Jump to content

Wait for Craft Menu (RegisterForMenuOpenCloseEvent)


fffseven

Recommended Posts

For testing I duplicate "CraftingBlacksmithArmorWorkbench" and add this script to duplicated one:

Scriptname DEL_saasddd extends ObjectReference  

;Event OnActivate(ObjectReference akActionRef)  
Function SomeFunction()
  RegisterForMenuOpenCloseEvent("CookingMenu") ; Before we can use OnMenuOpenCloseEvent we must register.
EndFunction
;EndEvent

Event OnMenuOpenCloseEvent(string asMenuName, bool abOpening)
    if (asMenuName== "CookingMenu")
        if (abOpening)
	    Debug.Trace("CookingMenu menu is open!")
        endif
    endif
endEvent

and when I compile compiler throw me "RegisterForMenuOpenCloseEvent is not a function or does not exist".

 

What am i missing here?

Link to comment
Share on other sites

Bethesda should buy SKSE. :smile:

I found some useful ways In case any one needs. But they didn't work for me because i change workbench appearance and remove the markers.

 

"IsInMenuMode" is useful for menus which stop game time. But crafting menu happens in game time so you need to "IsFurnitureInUse" or "IsFurnitureMarkerInUse" and there are "onsit"-"ongetup".

 

All of these did't work for me. So I tried to give player an item at the beginnig of crafting menu but i didn't find a way remove this item back.(I didn't find an event for workbench closing state). Now I am trying to migrate crafting menu codes("workBench.Activate(playerRef)") to end of everything.

 

I am new to papyrus, I don't know maybe states what i am looking for. But I am not new to coding and states looks like "labels and gotos" and everyone should avoid to use them. Is that a correct assumption or can states do the job?

Edited by fffseven
Link to comment
Share on other sites

Thanks for advice but my workbench has no marker model and I change its apparience with a static book. I think It won't trigger OnGetUP event or I am doing something wrong. I attach the player in quest alias and add a script:

Scriptname WorkBenchScript extends ReferenceAlias  

Event OnGetUp(ObjectReference akFurniture)
  Debug.Trace("1We just got up from " + akFurniture)
   Debug.messagebox("2We just got up from " + akFurniture)
    Debug.notification("3We just got up from " + akFurniture)
endEvent

I didn't get anything form it.

Link to comment
Share on other sites

  • Recently Browsing   0 members

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