Skip to main content

Overview

The purpose of this page is to provide an overview of all the classes, functions, and types available in the Pathing API. It won't go into detail on how to use them, but can be used as a quick reference for when you need to look up a class, function, or type and aren't sure where it might be.


Script Attributes

Script Attributes are attribute tags used on markers in your pack.xml in order to execute Lua functions. They provide interoperability between your scripts and your markers and trails. That's a fancy way of saying you can use them to interact with your markers and trails in your Lua scripts.

Here's an example of a marker with a Script Attribute:

pack.xml
<POI ... script-once="SaySomething(Woah!)" guid="aWk9ZRjiAUanhexdaUdYWA=="/>

In this example, the script-once attribute is used to call the SaySomething function in the Lua script. The marker parameter is automatically passed to the function, and the message parameter is passed from the script-once attribute.

Every script attribute will execute at different times and have different parameters, making them all useful in different ways depending on what you are trying to accomplish. Below is a list of all script attributes with a brief description. You can click on the attribute name to see more information about it.

Script AttributeDefault ParametersDescription
script-filtermarker(Marker)Executes every frame if it is determined that the attached marker should be visible.
script-focusmarker(Marker), isFocused(boolean)Executes when a marker is focused (the player is within the marker's triggerRange).
script-oncemarker(Marker)Executes once when the marker is loaded.
script-tickmarker(Marker), gameTime(GameTime)Executes once every in-game tick (typically every frame, but potentially less depending on configuration)
script-triggermarker(Marker), isAutoTriggered(boolean)Executes when a marker is triggered (the player is within triggerRange and autoTrigger is on or the player has pressed their interact key).


Globals

The Pathing API provides a number of global classes and functions that you can use in your Lua scripts. These classes and functions are used to interact with the game world, markers, trails, and more.

Global classes are always available and can be used without any special setup. Their functions can be called directly from your Lua scripts by using the class name followed by a colon and the function name, like this:

Debug:Print("Hello, world!")

Below is a list of all global classes and their functions. Clicking on the arrow next to the class name will expand their function list, and clicking on the class itself will take you to its page in the docs.

ClassDescription
DebugProvides access to various debugging functions which are useful for testing and debugging your scripts.
EventProvides the OnTick function used to call functions every tick.
InstanceProvides the ability to create new instances of various pathing types, which can then be used in other functions.
MenuProvides the ability to create and remove menus for script functions in the Pathing UI.
MumbleProvides access to all mumble information, provided in the form of various classes, enums and fields.
PackProvides the ability to execute scripts and create new markers.
UserProvides the ability to set the user's clipboard
WorldProvides access to many utility functions used to access categories and pathables (markers/trails) within the world.


Types

The Pathing API also provides a number of types that you'll need to explore to get information about various things. These types are used to represent various objects in the game world, such as markers, trails, and more. They all have their own fields and helper functions.

For example, if I wanted to get the closest marker's position, I could use the World:GetClosestMarker global function and then reference the returned Marker's Position field, like this:

script.lua
local closestMarker = World:GetClosestMarker()
local closestMarkerPosition = closestMarker.Position

Debug:Print("The closest marker's position is X: " .. closestMarkerPosition.X .. ", Y: " .. closestMarkerPosition.Y .. ", Z: " .. closestMarkerPosition.Z)

Below is a list of all types and any helper functions they may have. Clicking on the arrow next to the type name will expand their function list, and clicking on the type itself will take you to its page in the docs.

ClassDescription
CategoryA marker pack category.
ColorA color.
GameTimeA table containing two timespans.
GuidA unique identifier.
IBehaviorA behavior.
IPathableA pathable.
MarkerA marker pack marker.
TextureA marker pack texture.
TrailA marker pack trail.
Vector3A 3D vector. Has built in functions for vector operations (addition, subtraction, multiplication, etc).