on close menu?

Post » Mon Jun 18, 2012 1:05 pm

Okay, so basically, I need a block of code to run after the player has closed a menu (specifically, the alchemy menu). I tried using RegisterForSingleUpdate with OnUpdate, because the wiki said that it basically pauses the timer when the game is in MenuMode. Apparently, the alchemy menu doesn't qualify as "MenuMode", likely because the game world runs in the background.

Is there an alternative? Some script function that can tell me when there's a UI active or something?
User avatar
Leanne Molloy
 
Posts: 3342
Joined: Sat Sep 02, 2006 1:09 am

Post » Mon Jun 18, 2012 12:54 pm

Mousewheel scrolling problem with alchemy item? I hit the same brick wall.

Spoiler
ScriptName BorgAlembicScript extends ObjectReferenceInt iCountImport DebugImport UtilityImport GameArmor Property BorgAlembicARMO AutoObjectReference Property BorgAlembicREF AutoObjectReference Property BorgBagOfHoldingREF AutoObjectReference Property QASmokeAlchemyStationREF AutoQuest Property BorgAlembicQUST AutoEvent OnContainerChanged(ObjectReference akNewContainer, ObjectReference akOldContainer)	If akNewContainer		If akOldContainer			If (akNewContainer == BorgBagOfHoldingREF)			ElseIf (akOldContainer == Game.GetPlayer())				akNewContainer.RemoveItem(BorgAlembicARMO, 1, True, akOldContainer)			EndIf		ElseIf (akNewContainer == Game.GetPlayer())			iCount = akNewContainer.GetItemCount(BorgAlembicARMO)			If (iCount > 1)				iCount -= 1				akNewContainer.RemoveItem(BorgAlembicARMO, iCount, True)			EndIf		EndIf	ElseIf !akNewContainer		Game.GetPlayer().AddItem(BorgAlembicARMO, 1, True)		Disable()		Delete()	EndIfEndEvent;=================================Event OnEquipped(Actor akActor)	If (akActor == Game.GetPlayer())		akActor.EquipItem(BorgAlembicARMO, True, True)		Utility.Wait(0.1)		akActor.UnequipItem(BorgAlembicARMO, False, True)		QASmokeAlchemyStationREF.Activate(Game.GetPlayer())		Game.ForceFirstPerson()		; Would disable player controls here until done crafting, but could not find any way to determine when to re-enable	EndIfEndEvent
User avatar
Julie Serebrekoff
 
Posts: 3359
Joined: Sun Dec 24, 2006 4:41 am

Post » Mon Jun 18, 2012 3:06 pm

Basically I have a script that removes items from the player's inventory after the alchemy menu has been closed. I tried using RegisterForSingleUpdate() with OnUpdate(), but much to my surprise, it ran while the player was still in the middle of alchemying, which is obviously not what I want.
User avatar
Nadia Nad
 
Posts: 3391
Joined: Thu Aug 31, 2006 3:17 pm

Post » Mon Jun 18, 2012 8:15 am

Are these problems because the game menus are in ScaleForm?

This might be me talking nonsense, but before the CK modding the menus (like the improved menu mod) were done with the SKSE ... and the SKSE knows nothing about the CK and all thescripting stuff.

So, is menu-modding even possible with the CK? (I can find no wiki references to the menu systems at all)
User avatar
Nitol Ahmed
 
Posts: 3321
Joined: Thu May 03, 2007 7:35 am

Post » Mon Jun 18, 2012 11:32 am

I think it has more to do with the fact that the game keeps running in the background while the menu is open, than the fact that the menus themselves are in ScaleForm. Game keeps running = game is still in "GameMode".
User avatar
Alyna
 
Posts: 3412
Joined: Wed Aug 30, 2006 4:54 am

Post » Mon Jun 18, 2012 1:19 pm

Since alchemy tables are furniture, can you use http://www.creationkit.com/IsFurnitureInUse_-_ObjectReference ?
User avatar
Roddy
 
Posts: 3564
Joined: Fri Jun 15, 2007 11:50 pm

Post » Mon Jun 18, 2012 3:21 am

I think it has more to do with the fact that the game keeps running in the background while the menu is open, than the fact that the menus themselves are in ScaleForm. Game keeps running = game is still in "GameMode".
That's sort of what I meant, because they are a different system, the game is not effected when they are open (keeps running) ... although, saying that, pressing escape forces the save menu ... AND the game stops while it is up ...

... sry, I dunno :(
User avatar
Amiee Kent
 
Posts: 3447
Joined: Thu Jun 15, 2006 2:25 pm

Post » Mon Jun 18, 2012 6:39 am

Wow, it works now! Thanks so much!

just one more problem, and my mod will be ready for release...
User avatar
I love YOu
 
Posts: 3505
Joined: Wed Aug 09, 2006 12:05 pm


Return to V - Skyrim