World
The world class provides access to many utility functions used to access categories and pathables (markers/trails) within the world.
Functions
Function | Description |
---|---|
CategoryByType | Finds and returns a category based on the provided type. |
PathableByGuid | Returns a pathable based on the provided guid. |
PathablesByGuid | Returns a table of pathables based on the provided guid. |
MarkerByGuid | Returns a marker based on the provided guid. |
GetClosestMarker | Returns the closest marker. |
GetClosestMarker | Returns the closest marker directly within the specified category. |
GetClosestMarkers | Returns the specified number of the closest markers to the player. |
GetClosestMarkers | Returns the specified number of the closest markers to the player within the specified category. |
TrailByGuid | Returns a trail based on the provided guid. |
World:CategoryByType(type)
Finds and returns a category based on the provided type.
Parameters
Parameter | Type | Description |
---|---|---|
type | string | The 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
Parameter | Type | Description |
---|---|---|
guid | string | The 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
Parameter | Type | Description |
---|---|---|
guid | string | The 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
Parameter | Type | Description |
---|---|---|
guid | string | The 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
Parameter | Type | Description |
---|---|---|
category | Category | The 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
Parameter | Type | Description |
---|---|---|
quantity | number | The 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
Parameter | Type | Description |
---|---|---|
category | Category | The category of markers to search for. |
quantity | number | The 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
Parameter | Type | Description |
---|---|---|
guid | string | The guid of the trail to find. |
Returns | Trail
The trail found, or nil if not found.
Usage
local trail = World:TrailByGuid("/RHfDJuymE+/9AfOSjYTsw==")