Task Definition

TaskDef

Description:

Task definition table.

Fields:

  • title: (string) Human readable name of task.
  • description: (string) Description of task.
  • is_complete: (function) (optional) Checks if player has completed task.
  • on_complete: (function) (optional) Called to execute instructions when state is considered complete after call to tasks.set_state.
  • get_log: (function) (optional) Retrieves list of task state descriptors.
  • logic: (function) (optional) Called at every server step. Should NOT be called manually.

Task Definition Functions

TaskDef:is_complete

TaskDef:is_complete(player)

Description:

Checks if player has completed task.

Parameters:

Returns: (bool) true if the task is in a state which is considered to have been completed.

TaskDef:on_complete

TaskDef:on_compete(player)

Description:

Called to execute instructions when state is considered complete after call to tasks.set_state.

Parameters:

TaskDef:get_log

TaskDef:get_log(player)

Description:

Retrieves list of task state descriptors.

Parameters:

Returns: List of state descriptors.

TaskDef:logic

TaskDef:logic(dtime, player)

Description:

Called at every server step. Should NOT be called manually.

Parameters:

  • dtime: (int) Elapsed time since last call in seconds.
  • player: (ObjectRef) Player reference.