SKKmods Posted August 22, 2020 Share Posted August 22, 2020 `So I got a bit excited about the opportunities with this, but naturally there are inconsistencies. (1) A script attached to the holotape NOTE form: (1.1) Holotape added to player inventory: SKK_testHolotapeScript.OnContainerChanged [Actor < (00000014)>] None (1.2) Holotape loaded into Pipboy SKK_testHolotapeScript.OnEquipped [Actor < (00000014)>] *BUT* this event is not actually generated until the holotape menu is exited/unloaded (because the world is "on hold" in menus ?) (1.3) Holotape removed from PipboyNone. Event OnUnEquipped is NOT generated. (1.4) Holotape inserted into fixed terminal: SKK_testHolotapeScript.OnContainerChanged [workshopobjectscript < (FF00150F)>] SKK_testHolotapeScript.OnHolotapePlay [workshopobjectscript < (FF00150F)>] (1.5) Holotape removed from fixed terminal: SKK_testHolotapeScript.OnContainerChanged [Actor < (00000014)>] [workshopobjectscript < (FF00150F)>] (2.0) A script attached to the Holotape TERM Menu generates zero events during this insert & remove testing. The script Scriptname SKK_testHolotapeScript extends ObjectReference Const Event OnInit() Debug.Trace("SKK_testHolotapeScript.OnInit") EndEvent Event OnContainerChanged(ObjectReference akNewContainer, ObjectReference akOldContainer) Debug.Trace("SKK_testHolotapeScript.OnContainerChanged " + akNewContainer + " " + akOldContainer) EndEvent Event OnEquipped(Actor akActor) Debug.Trace("SKK_testHolotapeScript.OnEquipped " + akActor) EndEvent Event OnUnEquipped(Actor akActor) Debug.Trace("SKK_testHolotapeScript.OnUnEquipped " + akActor) EndEvent Event OnActivate(ObjectReference akActionRef) Debug.Trace("SKK_testHolotapeScript.OnEquipped " + akActionRef) EndEvent Event OnHolotapePlay(ObjectReference akTerminalRef) Debug.Trace("SKK_testHolotapeScript.OnHolotapePlay " + akTerminalRef) EndEvent Link to comment Share on other sites More sharing options...
ajs52698 Posted August 27, 2020 Share Posted August 27, 2020 This doesn't seem to have been mentioned yet but I'd suggest looking into HKX events, you might be able to register for one of them. Link to comment Share on other sites More sharing options...
niston Posted April 25, 2021 Share Posted April 25, 2021 Confirmed: The OnEquipped() event does not occur because the Pipboy menu is pausing the game in vanilla setup.Verified by using FallSouls mod to unpause the PipboyMenu; The event fires right away. Link to comment Share on other sites More sharing options...
LarannKiar Posted April 26, 2021 Share Posted April 26, 2021 (edited) The "holotapeLoaded" animation generates an event when a holotape is inserted to your Pip-Boy (immediatelly). Event OnQuestInit() RegisterForAnimationEvent(Game.GetPlayer(), "holotapeLoaded") endevent Event OnAnimationEvent(ObjectReference akSource, string asEventName) if (asEventName == "holotapeLoaded") debug.notification("holotapeLoaded") endIf endEvent But it does not work if the "insert" animation is skipped (when you load your holotape the second time). I think calling a function on the OnMenuItemRun event is the most reliable. Edited April 26, 2021 by LarannKiar Link to comment Share on other sites More sharing options...
SKKmods Posted April 26, 2021 Share Posted April 26, 2021 Have been using that for some player initiated actions, but there is no autoplay. Note that there can be sequencing issues depending on the functions called: Event OnMenuItemRun(int auiMenuItemID, ObjectReference akTarget) ;Avoids crappy menu fragments. ;(pSKK_COVIDQuest as SKK_COVIDQuestScript).COVIDHolotapePlayed() ; no this is sync does not execute until the menuitem releases and refreshes. (pSKK_COVIDQuest as SKK_COVIDQuestScript).CallFunctionNoWait("COVIDHolotapePlayed", New Var[0]) ; yes this runs fine async. EndEvent Link to comment Share on other sites More sharing options...
niston Posted April 26, 2021 Share Posted April 26, 2021 akTarget will be the Holotape ref? EDIT: Actually, no. akTarget will be the Terminal the menu item is selected from, or <none> for pipboy. *sad noises* Link to comment Share on other sites More sharing options...
niston Posted June 20, 2021 Share Posted June 20, 2021 Ok, so if you're using a custom flash holotape (Type "Program"), there is a way to emulate the OnHolotapePlay() event - By cunningly exploiting the fact that notifyScripts/OnHolotapeChatter is bugged and doesn't work in Terminals! In the Flash Holotape Actionscript, use notifyScripts API after the app setup is complete: BGSCodeObj.notifyScripts("MYSCRIPT:PIPBOY_BOOTSTRAP"); And in the Papyrus script: Event OnHolotapeChatter(string astrChatter, float afNumericData) If (astrChatter == "MYSCRIPT:PIPBOY_BOOTSTRAP") Debug.Trace(Self + ": INFO - Pipboy detected; Commencing BOOTSTRAP...") ; fake OnHolotapePlay event with Terminal reference <none> OnHolotapePlay(none) EndIf EndEvent Works reliably fine on the Pipboy and won't interfere with the regular Terminal "boot" process where OnHolotapePlay() directly fires as expected.More important, it only gets dispatched to the particular Holotape that's actually being played on the Pipboy - Unlike solutions involving OnMenuOpenCloseEvent().The only thing to take care of is, OnHolotapePlay() would normally occur *before* the tape starts playing, whereas with the bootstrap method, it will occur *after* the tape begun playing. My upcoming Papyrus Terminal mod uses this technique, so you will be able to run your Papyrus script Holotapes both on Terminals and in the Pipboy, without having to worry about any of this. Link to comment Share on other sites More sharing options...
Recommended Posts