CompGuyJMB Posted February 22, 2018 Posted February 22, 2018 Hey Everyone, I have an Enable / Disable marker, which is toggled between Enabled and Disabled by a push button (RedR_ButtonBox). I want to set up a Register for a Remove Event for when that marker is enabled / disabled. What Event fires on that marker when it is Enabled or Disabled? I'm looking for the equivalent of:Event ObjectReference.OnEnable() ; Do stuff when the marker becomes enabled EndEvent Event ObjectReference.OnDisable() ; Do different stuff when marker becomes disabled EndEventI don't see that event in the Creation Kit documentation. It might be a simple stuipd answer, but I new to Papyrus. Thanks for the input!
shavkacagarikia Posted February 23, 2018 Posted February 23, 2018 You need to send custom event from your script when you enable or disable object. Then register handler quest for that event and receive. This article will help.https://www.creationkit.com/fallout4/index.php?title=Custom_Papyrus_Events
ThoraldGM Posted February 23, 2018 Posted February 23, 2018 If event timing precision is not a factor, you could also remotely register for the button's OnActivate. Otherwise, custom events are the way to go.RegisterForRemoteEvent(RedR_ButtonBox, "OnActivate") Event ObjectReference.OnActivate(ObjectReference akSender, ObjectReference akActionRef) If akActionRef == Game.GetPlayer() ; Player pushed the red button (red button is akSender) If MY_MARKER_PROPERTY.IsEnabled() ; Replace allcaps with marker name from code or CK ; The marker was enabled Else ; The marker was disabled EndIf EndIf EndEvent
CompGuyJMB Posted February 24, 2018 Author Posted February 24, 2018 Thanks guys, I'll take a look at those suggestions!
Recommended Posts