Skip to main content

Instance

Instance is a global class that provides the ability to create new instances of various pathing types, which can then be used in other functions.

Functions

FunctionDescription
Vector3Creates a new Vector3.
ColorCreates a new Color.
MarkerCreates a new Marker.
GuidCreates a new Guid.
TextureGets a Texture by Asset ID from the public CDN.
TextureGets a Texture from a marker pack.


I:Vector3(x, y, z)

Creates a new Vector3.

Parameters

ParameterTypeDescription
xnumberThe X coordinate.
ynumberThe Y coordinate.
znumberThe Z coordinate.

Returns | Vector3

A new vector.

Usage

script.lua
-- Create new vector for the map origin
local originPos = I:Vector3(0, 0, 0)
-- Get players location
local characterPosition = Mumble.PlayerCharacter.Position
-- Subtract the two and get the length using the Vector3:Length() function
local distanceFromOrigin = (characterPosition - originPos):Length()

Debug:Print("Player is " .. distanceFromOrigin .. " units from origin")


I:Color(r, g, b, a)

Creates a new Color.

Parameters

ParameterTypeDescription
rintegerThe red component of the color (0 - 255)
gintegerThe green component of the color (0 - 255)
bintegerThe blue component of the color (0 - 255)
aintegerThe alpha component of the color (0 - 255). 255 if no value is provided.

Returns | Color

A new color.

Usage

script.lua
local newColor = I:Color(255, 255, 200)

-- TODO: do something interesting with color here


I:Marker()

Creates a new Marker.
-- TODO: Is there a usecase where this should be used over Pack:CreateMarker()?



I:Guid(base64)

Creates a new Guid.

Parameters

ParameterTypeDescription
base64stringThe base64 encoded Guid.

Returns | Guid

A new Guid.

Usage

script.lua
local newGuid = I:Guid("aWk9ZRjiAUanhexdaUdYWA==")

-- TODO: do something interesting with guid here


I:Texture(textureID)

Gets a Texture by Asset ID from the public CDN.

Parameters

ParameterTypeDescription
textureIDintegerThe ID of the asset

Returns | Texture

A texture.

Usage

script.lua
local iconFromID = I:Texture(156909)

-- TODO: do something interesting with texture here (and below)


I:Texture(pack, texturePath)

Gets a Texture from a marker pack.

Parameters

ParameterTypeDescription
packPackThe current pack
texturePathstringThe relative path to the texture (relative to the root of the marker pack)

Returns | Texture

A texture.

Usage

script.lua
local textureFromPack = I:Texture(Pack, '/Data/MarkerTextures/someIcon.png')