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
| Function | Description | 
|---|---|
| Vector3 | Creates a new Vector3. | 
| Color | Creates a new Color. | 
| Marker | Creates a new Marker. | 
| Guid | Creates a new Guid. | 
| Texture | Gets a Textureby Asset ID from the public CDN. | 
| Texture | Gets a Texturefrom a marker pack. | 
I:Vector3(x, y, z)
Creates a new Vector3.
Parameters
| Parameter | Type | Description | 
|---|---|---|
| x | number | The X coordinate. | 
| y | number | The Y coordinate. | 
| z | number | The 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
| Parameter | Type | Description | 
|---|---|---|
| r | integer | The red component of the color (0 - 255) | 
| g | integer | The green component of the color (0 - 255) | 
| b | integer | The blue component of the color (0 - 255) | 
| a | integer | The 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
| Parameter | Type | Description | 
|---|---|---|
| base64 | string | The 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
| Parameter | Type | Description | 
|---|---|---|
| textureID | integer | The 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
| Parameter | Type | Description | 
|---|---|---|
| pack | Pack | The current pack | 
| texturePath | string | The 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')