Jump to content

Scripting with Quests Question


FireFlickerFlak

Recommended Posts

If I have a function on a quest script that registers for an event, for example:

Function registerForEvent()
   registerForSingleUpdate(0.5)
EndFunction

And I then call this function from another script, for example:

Event OnLoad()

   myQuestScriptName.registerForEvent()

EndEvent

Which script is being registered for events by this function, the quest script holding the function or the script referencing the quest script?

 

(The reason I ask is I would like to be able to register/unregister my quest script for events via other scripts and I am not sure how to do that.)

 

Thanks

Edited by FireFlickerFlak
Link to comment
Share on other sites

The script holding the function will register for that update, UNLESS the function is Global, in which case the script calling the function will register.

 

It's a useful method which I've used on multiple occasions such as calling functions from the quest script when the player loads the game with an alias, etc.

Link to comment
Share on other sites

  • Recently Browsing   0 members

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