tuxemon.event.actions.pathfind_to_player module

final class tuxemon.event.actions.pathfind_to_player.PathfindToPlayerAction(npc_slug, side=None, distance=None)[source]

Bases: EventAction

Pathfind npc close the player.

Script usage

pathfind_to_player <npc_slug>,[direction],[distance]
Script parameters:
  • npc_slug – Npc slug name (e.g. “npc_maple”).

  • direction – Approaches the player from up, down, left or right.

  • distance – How many tiles (2, 3, 4, etc.)

  • npc_slug (str) –

  • side (str | None) –

  • distance (int | None) –

distance: int | None = None
name: ClassVar[str] = 'pathfind_to_player'
npc_slug: str
side: str | None = None

Called only once, when the action is started.

For all actions, you will need to override this method.

For actions that only need to run one frame you can simply put all the code here. If the action will need to run over several frames, you can init your action here, then override the update method.

Return type:



Called once per frame while action is running.

It is also called on the first frame when EventAction is started.

If you do not override this, then the action will stop after it is started, and live for only one frame.

If you do override this, then this method will be run every frame until EventAction.stop() is called. If you do not ever call stop(), then this action will block all others in the list and will continue to run until the parent EventEngine is stopped.

Return type: