-
-
Notifications
You must be signed in to change notification settings - Fork 11
Lua Support
Dade Lamkins edited this page Oct 15, 2022
·
1 revision
The Pathing module supports running Lua scripts found within marker packs. These Lua scripts are provided an API to directly interact with markers allowing for dynamic features.
Marker packs that wish to include a Lua script, must do so by including a Pack.lua
file. If this file is found within the pack and the user has Lua scripts enabled, the script will be executed on map change.
There are multiple execution triggers which can be taken advantage of:
- Initial execution - Code that is executed when the pack is first loaded.
- OnTick - Code that is executed every in-game tick (typically every frame, but potentially less depending on configuration).
- Menu Triggered - Code that is executed when a user selects a menu option that the script created.
Markers themselves can trigger scripts in multiple ways via an attribute. In all cases, reference to the marker is passed along when executing the script to allow the execution to perform tasks specific to that marker:
- script-tick - Code that is executed in the same way that OnTick code is, but with the context of a specific marker.
- script-focus - Code that is executed when a marker is focused (player is within triggerRange).
- script-trigger - Code that is executed when a marker is triggered (player is within triggerRange and autoTrigger is on or the player has pressed their interact key).
- script-filter - Code that is executed every frame which returns if the marker should be visible.
- script-once - Code that is triggered once with the context of the specific marker.