Jump to content

Enable / Disable Marker Event


CompGuyJMB

Recommended Posts

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
EndEvent

I 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!

Link to comment
Share on other sites

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

Link to comment
Share on other sites

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...