NOTE: I’ve experienced a weird bug on occasion where after compacting FormID’s or editing the mod in xEdit, the tab doesn’t appear in-game. Sometimes the plugin needs to be re-opened in CK and saved from there. You don’t need to make any changes, just re-open it and press save. If you’re 100% sure that you followed the documentation properly and it’s still not working for you, try that out. It should fix that issue.
I’ll update the documentation with this later, not at my computer ATM.
I've figured out how to add click support for specific elements in the tab! here's a code example. Just create a quest, make sure it's start game enabled, and then add a script with this code. Make sure to autofill properties after compiling it.
Group Actors Actor Property PlayerRef Auto EndGroup Group FormLists ; This should be your "FirstList" FormList that's in the PBT .ini FormList Property MYPIPBOYTABFIRSTLIST Auto EndGroup Group Idles ; This is the animation that plays when you equip or consume something in the pipboy Idle Property pipboySelect Auto EndGroup Group Sounds ; This is the sound that plays when you equip or consume something in the pipboy Sound Property UIPipBoyOKPress Auto EndGroup
Function PBT_ItemPressed(String id, int formid) if(id == "MY PIPYBOYTAB ID HERE") ; Do stuff to make it feel normal PlayerRef.PlayIdle(pipboySelect) UIPipBoyOKPress.Play(PlayerRef) PBT:PBT.UpdateMenu() ; Grab the index ActorValue kPBTAV = Game.GetForm(formid) as ActorValue int iIndex = MYPIPBOYTABFIRSTLIST.Find(kPBTAV) if(iIndex == -1) return endif ; Then do whatever you want to do here. iIndex is the index that your element is at. endif PBT:PBT.UpdateMenu() return EndFunction
2 comments
I’ll update the documentation with this later, not at my computer ATM.
Group Actors
Actor Property PlayerRef Auto
EndGroup
Group FormLists
; This should be your "FirstList" FormList that's in the PBT .ini
FormList Property MYPIPBOYTABFIRSTLIST Auto
EndGroup
Group Idles
; This is the animation that plays when you equip or consume something in the pipboy
Idle Property pipboySelect Auto
EndGroup
Group Sounds
; This is the sound that plays when you equip or consume something in the pipboy
Sound Property UIPipBoyOKPress Auto
EndGroup
Function PBT_ItemPressed(String id, int formid)
if(id == "MY PIPYBOYTAB ID HERE")
; Do stuff to make it feel normal
PlayerRef.PlayIdle(pipboySelect)
UIPipBoyOKPress.Play(PlayerRef)
PBT:PBT.UpdateMenu()
; Grab the index
ActorValue kPBTAV = Game.GetForm(formid) as ActorValue
int iIndex = MYPIPBOYTABFIRSTLIST.Find(kPBTAV)
if(iIndex == -1)
return
endif
; Then do whatever you want to do here. iIndex is the index that your element is at.
endif
PBT:PBT.UpdateMenu()
return
EndFunction
;; #### EVENTS ####
;;
Event OnQuestInit()
OnGameLoad()
EndEvent
;;
Event OnQuestShutdown()
UnRegisterForRemoteEvent(PlayerRef, "OnPlayerLoadGame")
UnRegisterForExternalEvent("PBT_ItemPressed")
EndEvent
;;
Event Actor.OnPlayerLoadGame(Actor akSender)
OnGameLoad()
EndEvent
;;
Function OnGameLoad()
RegisterForRemoteEvent(PlayerRef, "OnPlayerLoadGame")
RegisterForExternalEvent("PBT_ItemPressed", "PBT_ItemPressed")
EndFunction
edit: yes you can, but it doesnt seem to really work as pbt doesnt seem to support inventory interfaces