Skip to main content

World

The world class provides access to many utility functions used to access categories and pathables (markers/trails) within the world.

Functions​

FunctionDescription
CategoryByTypeFinds and returns a category based on the provided type.
PathableByGuidReturns a pathable based on the provided guid.
PathablesByGuidReturns a table of pathables based on the provided guid.
MarkerByGuidReturns a marker based on the provided guid.
GetClosestMarkerReturns the closest marker.
GetClosestMarkerReturns the closest marker directly within the specified category.
GetClosestMarkersReturns the specified number of the closest markers to the player.
GetClosestMarkersReturns the specified number of the closest markers to the player within the specified category.
TrailByGuidReturns a trail based on the provided guid.


World:CategoryByType(type)​

Finds and returns a category based on the provided type.

Parameters​

ParameterTypeDescription
typestringThe type of category to find.

Returns | category​

The category found, or nil if not found.

Usage​

local category = World:CategoryByType("example.category.type")


World:PathableByGuid(guid)​

Returns a pathable based on the provided guid.

Parameters​

ParameterTypeDescription
guidstringThe guid of the pathable to find.

Returns | IPathable​

The pathable found, or nil if not found.

Usage​

local pathable = World:PathableByGuid("/RHfDJuymE+/9AfOSjYTsw==")


World:PathablesByGuid(guid)​

Returns a table of pathables based on the provided guid.

Parameters​

ParameterTypeDescription
guidstringThe guid of the pathable to find.

Returns | IPathable[]​

A table of pathables found, or nil.

Usage​

local pathables = World:PathablesByGuid("/RHfDJuymE+/9AfOSjYTsw==")


World:MarkerByGuid(guid)​

Returns a marker based on the provided guid.

Parameters​

ParameterTypeDescription
guidstringThe guid of the marker to find.

Returns | Marker​

The first marker found, or nil.

Usage​

local marker = World:MarkerByGuid("/RHfDJuymE+/9AfOSjYTsw==")


World:GetClosestMarker()​

Returns the closest marker.

Returns | Marker​

The closest marker.

Usage​

local closestMarker = World:GetClosestMarker()


World:GetClosestMarker(category)​

Returns the closest marker directly within the specified category.

Parameters​

ParameterTypeDescription
categoryCategoryThe category to search within.

Returns | Marker​

The closest marker within the specified category.

Usage​

local closestMarker = World:GetClosestMarker(World:CategoryByType("example.category.type"))


World:GetClosestMarkers(quantity)​

Returns the specified number of the closest markers to the player.

Parameters​

ParameterTypeDescription
quantitynumberThe number of markers to return.

Returns | Marker[]​

The closest markers.

Usage​

local closestMarkers = World:GetClosestMarkers(5)


World:GetClosestMarkers(category, quantity)​

Returns the specified number of the closest markers to the player within the specified category.

Parameters​

ParameterTypeDescription
categoryCategoryThe category of markers to search for.
quantitynumberThe number of markers to return.

Returns | Marker[]​

The closest markers within the specified category.

Usage​

local closestMarkers = World:GetClosestMarkers(World:CategoryByType("example.category.type"), 5)


World:TrailByGuid(guid)​

Returns a trail based on the provided guid.

Parameters​

ParameterTypeDescription
guidstringThe guid of the trail to find.

Returns | Trail​

The trail found, or nil if not found.

Usage​

local trail = World:TrailByGuid("/RHfDJuymE+/9AfOSjYTsw==")