Function RegisterEvents(ObjectReference akObjectToRegister)
RegisterForRemoteEvent(akObjectToRegister, "OnPowerOn")
; etc...
EndFunction
Event ObjectReference.OnPowerOn(ObjectReference akSender, ObjectReference akPowerGenerator)
; akSender is the object I registered
if ( bOnlyFireEventOnce )
UnRegisterForRemoteEvent(kObjectToRegister, "OnPowerOn")
endif
; do stuff
EndEvent
RegisterForCustomEvent(WorkshopParent, "WorkshopObjectPowerStageChanged")
Its been a while since I looked at that. IIRC, there is a function on WorkshopParentScript who's sole purpose is to send the custom event. WSFW adds this. Other WSFW scripts call that function to "report" an object who's power state changed It is done this way because a custom event can only be sent from the script it is defined in. I kinda remember reading a comment somewhere in a WSFW script...I'm still not sure what WorkshopObjectPowerStageChanged does.
RegisterForCustomEvent(WorkshopParent, "WorkshopObjectPower[B]State[/B]Changed")
'facepalm' I didn't even notice that... copy/pasta... lolI'm curious. Did that compile? (Oh, I forgot, you aren't using the vanilla compiler... Or are you???)Event ObjectReference.OnPowerOn(ObjectReference akObjectRef)
Event Quest.OnWorkshopObjectDestroyed(ObjectReference akSender, ObjectReference akObjectRef)
Yeah, it did. Thanks a lot Caprica.I'm curious. Did that compile?
That wasn't actually a typo. That's the custom event that WorkshopParentScript sends (interestingly enough, in a function called SendPowerStateChangedEvent).That's the problem with string literals... it lets typos
We use essential cookies to make this site work, and optional cookies to enhance your experience.