Task (functions)

From PMDOWiki
Revision as of 20:13, 17 January 2026 by Imbion (talk | contribs)
More functions: Script Reference
This article is in need of cleanup to increase its quality. You can help PMDO Wiki by improving it.

TASK:StartEntityTask(RogueEssence.Ground.GroundEntity,NLua.LuaFunction)

Helper function to make an entity run the specified task. Will not replace a running task! Tasks are run interlocked with the script processing and game processing, and characters cannot run multiple tasks at the same time.


Arguments

  • ent: Entity which will run the task.
  • fn: Task coroutine.

TASK:StopEntityTask(RogueEssence.Ground.GroundEntity)

Helper function to force stop an entity's current task.


Arguments

  • ent: Entity running the task to stop.

TASK:WaitStartEntityTask

Makes an entity run a specified task, and waits for it to complete.


Arguments

  • ent: Entity which will run the task.
  • fn: Task coroutine.

Example


TODO

TASK:WaitEntityTask

Waits for the specified entity to finish its task.


Arguments

  • ent: Entity which task we'll wait on.

Example


TASK:WaitEntityTask(player)

TASK:WaitTask

Runs a task and waits for it to complete. Most methods that do not expose themselves to script need to be wrapped with this.


Arguments

  • obj: The task to wait on.

Example


TASK:WaitTask(_DUNGEON:DropMoney(100, RogueElements.Loc(10, 10), RogueElements.Loc(10, 10)))

TASK:StartScriptLocalCoroutine(NLua.LuaFunction,System.Object[])

A wrapper around the StartCoroutine method of the GameManager, so lua coroutines can be executed locally to the script context. AKA, it will block the script execution while its executed.


Arguments

  • fn: None
  • args: None

TASK:BranchCoroutine(System.Object)

Starts a new coroutine to run parallel to the current execution. Useful for performing multiple actions at once.


Arguments

  • obj: The task to run in parallel

Example


local coro1 = TASK:BranchCoroutine(GAME:_FadeIn(60))

TASK:JoinCoroutines

Waits for all specified coroutines to finish before continuing execution. Often used for coroutines created using TASK:BranchCoroutine()


Arguments

  • coroTable: A table of coroutines to wait on.

Example


TASK:JoinCoroutines({coro1})