Library hook

Deals with hooks

Functions

add (hookname, name, func) Sets a hook function
remove (hookname, name) Remove a hook
run (hookname, ...) Run a hook
runRemote (recipient, ...) Run a hook remotely.


Functions

hook_library.add (hookname, name, func)
Sets a hook function

Parameters:

  • hookname: Name of the event
  • name: Unique identifier
  • func: Function to run
hook_library.remove (hookname, name)
Remove a hook

Parameters:

  • hookname: The hook name
  • name: The unique name for this hook
hook_library.run (hookname, ...)
Run a hook

Parameters:

  • hookname: The hook name
  • ...: arguments
hook_library.runRemote (recipient, ...)
Run a hook remotely. This will call the hook "remote" on either a specified entity or all instances on the server/client

Parameters:

  • recipient: Starfall entity to call the hook on. Nil to run on every starfall entity
  • ...: Payload. These parameters will be used to call the hook functions

Return value:

    tbl A list of the resultset of each called hook

Valid XHTML 1.0!