Possible to open a container while in a menu

Post » Fri May 27, 2011 7:37 am

:topic:

Necessary for the preferred implementation of a mod I'll be working on when NVSE is released.
User avatar
Nana Samboy
 
Posts: 3424
Joined: Thu Sep 14, 2006 4:29 pm

Post » Fri May 27, 2011 12:30 am

Man, only 18 views :sadvaultboy:
User avatar
Causon-Chambers
 
Posts: 3503
Joined: Sun Oct 15, 2006 11:47 pm

Post » Fri May 27, 2011 10:21 am

Man, only 18 views :sadvaultboy:
Yes. That's how FOOK's QA containers work, by summoning a CONT, activating it, then a Disable/MarkForDelete.

One sec and I'll copypasta an example.

Spoiler
scn FookQATestingOptionsSCPTRef rContainerRef rBagOfHoldingInt iMessageBoxInt iButtonInt iCountBegin OnAdd	Set iMessageBox to -1EndBegin MenuMode 1001	If (iMessageBox < 0)		Return	ElseIf rBagOfHolding		rBagOfHolding.RemoveAllItems FookBagOfHoldingREF		rBagOfHolding.Disable		rBagOfHolding.MarkForDelete		Set rBagOfHolding to 0	ElseIf rContainer		rContainer.Disable		rContainer.MarkForDelete		Set rContainer to 0	EndIfEndBegin GameMode	If (iMessageBox > 0)		Set iButton to GetButtonPressed		If (iButton == -1)			Return		Else			Set iMessageBox to (iMessageBox * -1)			If (iMessageBox == -1)				If (iButton == 0) ; QA Containers					Set iMessageBox to -2				ElseIf (iButton == 1) ; Add/Remove Field Salvage Kit					Set iCount to Player.GetItemCount FookFSKToolboxMISC					If iCount						Player.RemoveItem FookFSKToolboxMISC iCount					Else						Player.AddItem FookFSKToolboxMISC 1					EndIf					ElseIf (iButton == 2) ; Add/Remove Power Armor Training Perk					If Player.HasPerk PowerArmorTraining						Player.RemovePerk PowerArmorTraining						ShowMessage FOOKMsgPerkRemoved					Else						Player.AddPerk PowerArmorTraining						ShowMessage FOOKMsgPerkAdded					EndIf				ElseIf (iButton == 3) ; Back					StartQuest FookOptions2QUST					RemoveMe				ElseIf (iButton == 4) ; Done					EnablePlayerControls 1 1 0 0 1 0 0					RemoveMe				EndIf			ElseIf (iMessageBox == -2) ; QA Containers				If (iButton == 0) || (iButton == 1)					If FookQAShelf.GetDisabled						FookQAShelf.Enable					Else						FookQAShelf.Disable					EndIf				ElseIf (iButton == 2) ; Armory					Set iMessageBox to -3				ElseIf (iButton == 3) ; Apparel					Set iMessageBox to -4				ElseIf (iButton == 4) ; Other					Set iMessageBox to -5				ElseIf (iButton == 5) ; Bag of Holding					Set rBagOfHolding to Player.PlaceAtMe FookBagOfHoldingCONT 1 10					FookBagOfHoldingREF.RemoveAllItems rBagOfHolding					rBagOfHolding.SetOwnership					rBagOfHolding.Activate Player				ElseIf (iButton == 6) ; Back					Set iMessageBox to -1				ElseIf (iButton == 7) ; Done (Exit Menu)					EnablePlayerControls 1 1 0 0 1 0 0					RemoveMe				EndIf			ElseIf (iMessageBox == -3) ; Armory				If (iButton == 0) ; Small Guns					Set rContainer to Player.PlaceAtMe FookQASmallGunsCONT 1 10					rContainer.SetOwnership					rContainer.Activate Player				ElseIf (iButton == 1) ; Big Guns					Set rContainer to Player.PlaceAtMe FookQABigGunsCONT 1 10					rContainer.SetOwnership					rContainer.Activate Player				ElseIf (iButton == 2) ; EnergyWeapons					Set rContainer to Player.PlaceAtMe FookQAEnergyWeaponsCONT 1 10					rContainer.SetOwnership					rContainer.Activate Player				ElseIf (iButton == 3) ; Unarmed&Melee					Set rContainer to Player.PlaceAtMe FookQAMeleeUnarmedCONT 1 10					rContainer.SetOwnership					rContainer.Activate Player				ElseIf (iButton == 4) ; Explosives					Set rContainer to Player.PlaceAtMe FookQAExplosivesCONT 1 10					rContainer.SetOwnership					rContainer.Activate Player				ElseIf (iButton == 5) ; Uniques					Set rContainer to Player.PlaceAtMe FookQAUniqueWeaponsCONT 1 10					rContainer.SetOwnership					rContainer.Activate Player				ElseIf (iButton == 6) ; Ammo					Set rContainer to Player.PlaceAtMe FookQAAmmoCONT 1 10					rContainer.SetOwnership					rContainer.Activate Player				ElseIf (iButton == 7) ; Back					Set iMessageBox to -2				ElseIf (iButton == 8) ; Done (Exit Menu)					EnablePlayerControls 1 1 0 0 1 0 0					RemoveMe				EndIf			ElseIf (iMessageBox == -4) ; Apparel				If (iButton == 0) ; Apparel					Set rContainer to Player.PlaceAtMe FookQAApparelCONT 1 10					rContainer.SetOwnership					rContainer.Activate Player				ElseIf (iButton == 1) ; Armor					Set rContainer to Player.PlaceAtMe FookQAArmorCONT 1 10					rContainer.SetOwnership					rContainer.Activate Player				ElseIf (iButton == 2) ; Power Armor					Set rContainer to Player.PlaceAtMe FookQAPowerArmorCONT 1 10					rContainer.SetOwnership					rContainer.Activate Player				ElseIf (iButton == 3) ; Back					Set iMessageBox to -2				ElseIf (iButton == 4) ; Done (Exit Menu)					EnablePlayerControls 1 1 0 0 1 0 0					RemoveMe				EndIf			ElseIf (iMessageBox == -5) ; Other				If (iButton == 0) ; Misc					Set rContainer to Player.PlaceAtMe FookQAMiscCONT 1 10					rContainer.SetOwnership					rContainer.Activate Player				ElseIf (iButton == 1) ; Ingestibles					Set rContainer to Player.PlaceAtMe FookQAIngestiblesCONT 1 10					rContainer.SetOwnership					rContainer.Activate Player				ElseIf (iButton == 2) ; Misc					Set rContainer to Player.PlaceAtMe FookQANotesCONT 1 10					rContainer.SetOwnership					rContainer.Activate Player				ElseIf (iButton == 3) ; Destroyed Power Armor					Set rContainer to player.PlaceAtMe FOOKDestroyedPATestContainer 1 10					rContainer.SetOwnership					rContainer.Activate Player				ElseIf (iButton == 4) ; Back					Set iMessageBox to -2				ElseIf (iButton == 5) ; Done (Exit Menu)					EnablePlayerControls 1 1 0 0 1 0 0					RemoveMe				EndIf			EndIf		EndIf	Else		Set iMessageBox to (iMessageBox * -1)		If (iMessageBox == 1)			ShowMessage FookQATestingOptionsMESG		ElseIf (iMessageBox == 2)			ShowMessage FookQAContainersMESG		ElseIf (iMessageBox == 3)			ShowMessage FookQAArmoryMESG		ElseIf (iMessageBox == 4)			ShowMessage FookQAApparelMESG		ElseIf (iMessageBox == 5)			ShowMessage FookQAOtherMESG		EndIf	EndIfEnd


That's attached to a token, but the code works for quests too minus the OnAdd bit.
User avatar
Susan Elizabeth
 
Posts: 3420
Joined: Sat Oct 21, 2006 4:35 pm

Post » Fri May 27, 2011 11:14 am

I'll be playing around with it in the G.E.C.K. but real quick can you clarify that it works from the pip-boy menu? Just glancing at it, it seems like it's operating/opening from a message box that I guess you open in turn via an item from the pip-boy. If that's the case then I guess I wasn't clear on my question, I want to be able to open a container straight from the pip-boy, like say from clicking on a Stimpack or something (not actually clicking on a Stimpack but you get the idea).
User avatar
Trey Johnson
 
Posts: 3295
Joined: Thu Oct 11, 2007 7:00 pm

Post » Fri May 27, 2011 2:07 pm

Oh, I thought you meant from within an options menu. Still, some of that should an effect script to do the same thing. Would this item open the same container every time, like for storage? If so, you could skip the rContainer and activate a placed, persistent container from anywhere.

Begin ScriptEffectStart	Player.AddItem ContainerAccessALCH 1 1	YourContainerREF.Activate PlayerEnd
I've never set up a menu to work from within the pipboy with an ingestible. Since it'll be an NVSE mod, you could activate it with a hotkey too...
User avatar
Alisha Clarke
 
Posts: 3461
Joined: Tue Jan 16, 2007 2:53 am

Post » Fri May 27, 2011 12:42 am

You should be able to do this by doing an OnEquip block (if it's apparel) - something like this:

Begin OnEquip Player	YourContainerREF.Activate Player	Player.UnequipItem ThisItemBaseIDEnd

User avatar
Scott Clemmons
 
Posts: 3333
Joined: Sun Sep 16, 2007 5:35 pm

Post » Fri May 27, 2011 10:39 am

Oh, I thought you meant from within an options menu. Still, some of that should an effect script to do the same thing. Would this item open the same container every time, like for storage? If so, you could skip the rContainer and activate a placed, persistent container from anywhere.

Begin ScriptEffectStart	Player.AddItem ContainerAccessALCH 1 1	YourContainerREF.Activate PlayerEnd
I've never set up a menu to work from within the pipboy with an ingestible. Since it'll be an NVSE mod, you could activate it with a hotkey too...


Yea I intend to have a persistent container, and IIRC I tried to use ScriptEffectStart scripts and an Ingestible and it didn't work, though I'll give it another shot when I have time. But between both of yall I've realized another way that should for sure work and might be less of a hassle for the user in the end, with hotkeys and such, so thanks for the advice.
User avatar
Lilit Ager
 
Posts: 3444
Joined: Thu Nov 23, 2006 9:06 pm


Return to Fallout: New Vegas