- Trigger API Reference\DCEI Functions\Terrain
- EnableRoute
- GetMapSize
- GetMapCenterPoint
- GetTerrainTypeAtPoint
- GetTerrainHeightAtPoint
- ChangePropLayerDisplay
- LoadPropLayer
- UnloadPropLayer
- GetPropLayerLoadStatus
- GetTerrainChunkPosition
- SetTerrainChunkPosition
- SetTerrainChunkPositionWithInterpolation
- InstantiateTerrainChunk
- DestroyTerrainChunkInstance
- GetTerrainChunkInstancePosition
- SetTerrainChunkInstancePosition
- SetTerrainChunkInstancePositionWithInterpolation
- GetWeather
- SetWeather
- GetTimeOfTheDay
- SetTimeOfTheDay
- GetCurrentLightColor
- SetOverrideLightColor
- SetSkyboxColor
- ResetSkyboxColor
- AddLine
- AddLineWithSprite
- RemoveLine
- MoveLineWithInterpolation
- RemoveAllLines
- ChangeLineColor
- ChangeLineDisplay
- AddGrid
- AddGridWithSprite
- RemoveGrid
- SetBlurredScreenCaptureAsBackground
Trigger API Reference\DCEI Functions\Terrain
void EnableRoute(string routeName, bool enable)
void EnableRoute(string routeName, bool enable)
Description
Enable/disable a waypoints route according to route name.
Parameters
- string
routeName
the name of the route. - bool
enable
if true, enable the route.
Example Usage
local routeName = "test_route"
DCEI.EnableRoute(routeName, true)
Float2 GetMapSize()
Float2 GetMapSize()
Description
Returns the X and Z dimensions of the map.
Example Usage
local map_dim = DCEI.GetMapSize()
DCEI.LogMessage("Map Dim X: " .. map_dim.x .. " Map Dim Z: " .. map_dim.y)
Float2 GetMapCenterPoint()
Float2 GetMapCenterPoint()
Description
Returns the X and Z coordinates of the center of the map.
Example Usage
local map_center = DCEI.GetMapCenterPoint()
DCEI.LogMessage("Map Center X: " .. map_center.x .. " Map Center Z: " .. map_center.y)
int GetTerrainTypeAtPoint(float x, float z)
int GetTerrainTypeAtPoint(float x, float z)
Description
Returns the terrain type at the given point. Returns 0-4 depending on the texture painted at the point, with 0 being the default texture. Ignores terrain features such as cliffs, borders, and water - this returns the texture that would otherwise be painted on the tile.
Parameters
- float
x
the X coordinate of the point. - float
z
the Z coordinate of the point.
Example Usage
local x, y = 16, 16
local terrain_type = DCEI.GetTerrainTypeAtPoint(x, y)
DCEI.LogMessage(terrain_type)
float GetTerrainHeightAtPoint(float x, float z)
float GetTerrainHeightAtPoint(float x, float z)
Description
Returns the terrain height at the given point. Values can range from 5 to -5. Default terrain height is 0, border height defaults to -1. Ignores water height.
Parameters
- float
x
the X coordinate of the point. - float
z
the Z coordinate of the point.
Example Usage
local x, y = 16, 16
local terrain_height = DCEI.GetTerrainHeightAtPoint(x, y)
DCEI.LogMessage(terrain_type)
void ChangePropLayerDisplay(string layerName, bool display)
void ChangePropLayerDisplay(string layerName, bool display)
Description
Enables or disables the display of a prop player.
Parameters
- string
layerName
the name of the layer. - bool
display
if true, display the prop layer, otherwise hide the prop layer.
Example Usage
local button_layout = GMUI.Layout.New({
parent = DCEI.GetUiRootFrame(),
name = "Standard/Button/Button",
})
local layer_name = "layer_1"
DCEI.SetOnClickCallback(button_layout.Button, function()
DCEI.ChangePropLayerDisplay(layer_name, false)
end)
void LoadPropLayer(string layerName, bool initialDisplay)
void LoadPropLayer(string layerName, bool initialDisplay)
Description
Loads the prop layer into memory. If prop layer has already been loaded, does nothing. Layers may need to be unloaded via UnloadPropLayer first.
Parameters
- string
layerName
the name of the layer. - bool
initialDisplay
set to true/false to show or hide the prop layer initially.
Example Usage
function OnRegionEnter()
DCEI.LoadPropLayer("layer_1", true)
end
DCEI.UnloadPropLayer("layer_1")
DCEI.TriggerAddUnitEnterRegionEvent(DCEI.CreateUnitFilter({name = DCEI.Unit("Test Unit")}), DCEI.RegionAny, OnRegionEnter)
void UnloadPropLayer(string layerName)
void UnloadPropLayer(string layerName)
Description
Unloads the given prop layer from memory, preventing it from being displayed. Prop layers unloaded can be reloaded via LoadPropLayer.
Parameters
- string
layerName
the name of the layer.
Example Usage
function OnRegionEnter()
DCEI.LoadPropLayer("layer_1", true)
end
DCEI.UnloadPropLayer("layer_1")
DCEI.TriggerAddUnitEnterRegionEvent(DCEI.CreateUnitFilter({name = DCEI.Unit("Test Unit")}), DCEI.RegionAny, OnRegionEnter)
bool GetPropLayerLoadStatus(string layerName)
bool GetPropLayerLoadStatus(string layerName)
Description
Returns true if given prop layer is loaded.
Parameters
- string
layerName
the name of the layer.
Example Usage
function OnRegionEnter()
DCEI.LoadPropLayer("layer_1", true)
DCEI.LogMessage(tostring(DCEI.GetPropLayerLoadStatus("layer_2")))
end
DCEI.UnloadPropLayer("layer_1")
DCEI.TriggerAddUnitEnterRegionEvent(DCEI.CreateUnitFilter({name = DCEI.Unit("Test Unit")}), DCEI.RegionAny, OnRegionEnter)
Float3 GetTerrainChunkPosition(string chunkName)
Float3 GetTerrainChunkPosition(string chunkName)
Description
Returns the 3D position of a terrain chunk.
Parameters
- string
chunkName
the name of the terrain chunk.
Example Usage
local terrain_chunk_pos = DCEI.GetTerrainChunkPosition("terrain_chunk_0")
DCEI.LogMessage("X: " .. terrain_chunk_pos.x)
DCEI.LogMessage("Y: " .. terrain_chunk_pos.y)
DCEI.LogMessage("Z: " .. terrain_chunk_pos.z)
bool SetTerrainChunkPosition(string chunkName, Float3 pos)
bool SetTerrainChunkPosition(string chunkName, Float3 pos)
Description
Sets the position of a terrain chunk. Returns true if the terrain chunk position was set successfully.
Parameters
- string
chunkName
the name of the terrain chunk. - Float3
pos
the new coordinates for the center of the terrain chunk.
Example Usage
local new_pos = { x = 16, y = -3, z = 16 }
local move_success = DCEI.SetTerrainChunkPosition("terrain_chunk_0", new_pos)
if move_success then
local terrain_chunk_pos = DCEI.GetTerrainChunkPosition("terrain_chunk_0")
DCEI.LogMessage("X: " .. terrain_chunk_pos.x)
DCEI.LogMessage("Y: " .. terrain_chunk_pos.y)
DCEI.LogMessage("Z: " .. terrain_chunk_pos.z)
end
bool SetTerrainChunkPositionWithInterpolation(string chunkName, Float3 pos, float duration)
bool SetTerrainChunkPositionWithInterpolation(string chunkName, Float3 pos, float duration)
Description
Sets the 3D position of a terrain chunk while animating it to that position. Returns true if the position was set successfully.
Parameters
- string
chunkName
the name of the terrain chunk. - Float3
pos
the new coordinates for the center of the terrain chunk. - float
duration
the time taken for the terrain chunk to reach its destination.
Example Usage
local new_pos = { x = 16, y = -3, z = 16 }
local duration = 5
local move_success = DCEI.SetTerrainChunkPositionWithInterpolation("terrain_chunk_0", new_pos, duration)
if move_success then
local terrain_chunk_pos = DCEI.GetTerrainChunkPosition("terrain_chunk_0")
DCEI.LogMessage("X: " .. terrain_chunk_pos.x)
DCEI.LogMessage("Y: " .. terrain_chunk_pos.y)
DCEI.LogMessage("Z: " .. terrain_chunk_pos.z)
end
int InstantiateTerrainChunk(string chunkName, Float3 pos)
int InstantiateTerrainChunk(string chunkName, Float3 pos)
Description
Instantiates a terrain chunk at the given location and returns the instanceId of the terrain chunk instance. Returns 0 on failure.
Parameters
- string
chunkName
the name of the terrain chunk to create an instance of. - Float3
pos
the coordinates for the center of the terrain chunk instance.
Example Usage
local chunk_name = "terrain_chunk_0"
local pos = { x = 16, y = -3, z = 16 }
local chunk_id = DCEI.InstantiateTerrainChunk(chunk_name, pos)
DCEI.LogMessage("Terrain Chunk instance ID: " .. chunk_id)
void DestroyTerrainChunkInstance(int instanceId)
void DestroyTerrainChunkInstance(int instanceId)
Description
Destroys a terrain chunk instance.
Parameters
- int
instanceId
the instanceId assigned to the terrain chunk instance.
Example Usage
local button_layout = GMUI.Layout.New({
parent = DCEI.GetUiRootFrame(),
name = "Standard/Button/Button",
})
local chunk_id = 2
DCEI.SetOnClickCallback(button_layout.Button, function()
DCEI.DestroyTerrainChunkInstance(chunk_id)
end)
Float3 GetTerrainChunkInstancePosition(int instanceId)
Float3 GetTerrainChunkInstancePosition(int instanceId)
Description
Returns the 3D position of a terrain chunk instance.
Parameters
- int
instanceId
the instanceId assigned to the terrain chunk instance.
Example Usage
local chunk_name = "terrain_chunk_0"
local pos = { x = 16, y = -3, z = 16 }
local chunk_id = DCEI.InstantiateTerrainChunk(chunk_name, pos)
local terrain_chunk_pos = DCEI.GetTerrainChunkInstancePosition(chunk_id)
DCEI.LogMessage("X: " .. terrain_chunk_pos.x)
DCEI.LogMessage("Y: " .. terrain_chunk_pos.y)
DCEI.LogMessage("Z: " .. terrain_chunk_pos.z)
bool SetTerrainChunkInstancePosition(int instanceId, Float3 pos)
bool SetTerrainChunkInstancePosition(int instanceId, Float3 pos)
Description
Sets the 3D position of a terrain chunk instance. Returns true if the position was set successfully.
Parameters
- int
instanceId
the instanceId assigned to the terrain chunk instance. - Float3
pos
the new coordinates for the center of the terrain chunk instance.
Example Usage
local chunk_name = "terrain_chunk_0"
local pos = { x = 16, y = -3, z = 16 }
local chunk_id = DCEI.InstantiateTerrainChunk(chunk_name, pos)
local new_pos = { x = 20, y = -3, z = 20 }
local move_success = DCEI.SetTerrainChunkInstancePositionWithInterpolation(chunk_id, new_pos)
if move_success then
DCEI.LogMessage("Success!")
end
bool SetTerrainChunkInstancePositionWithInterpolation(int instanceId, Float3 pos, float duration)
bool SetTerrainChunkInstancePositionWithInterpolation(int instanceId, Float3 pos, float duration)
Description
Sets the 3D position of a terrain chunk instance while animating it to that position. Returns true if the position was set successfully.
Parameters
- int
instanceId
the instanceId assigned to the terrain chunk instance. - Float3
pos
the new coordinates for the center of the terrain chunk instance. - float
duration
the time taken for the terrain chunk instance to reach its destination.
Example Usage
local chunk_name = "terrain_chunk_0"
local pos = { x = 16, y = -3, z = 16 }
local chunk_id = DCEI.InstantiateTerrainChunk(chunk_name, pos)
local new_pos = { x = 20, y = -3, z = 20 }
local duration = 5
local move_success = DCEI.SetTerrainChunkInstancePositionWithInterpolation(chunk_id, new_pos, duration)
if move_success then
DCEI.LogMessage("Success!")
end
int GetWeather()
int GetWeather()
Description
Returns an integer corresponding to the weather. Does not detect the heatwave option.
0 - None
1 - Rain
2 - Snow
Example Usage
local weather = DCEI.GetWeather()
DCEI.LogMessage(weather)
void SetWeather(int weatherStatus, float duration = 4)
void SetWeather(int weatherStatus, float duration = 4)
Description
Changes the weather over the given duration. Use 0 for an instant transition. Cannot set the heatwave option.
In order to use a weather, you'll need to set Has Weather Name
in the weather settings. To find it, go to Project Settings > Map Settings > Weather. Make sure you're in the settings for your map, not a mod that the map is using.
Parameters
- int
weatherStatus
the integer corresponding to a weather status. - float
duration
the transition duration.
Example Usage
local new_weather = 2
local duration = 50
DCEI.SetWeather(new_weather, duration)
local weather = DCEI.GetWeather()
DCEI.LogMessage(weather)
int GetTimeOfTheDay()
int GetTimeOfTheDay()
Description
Returns an integer corresponding to the time of the day.
0 - Noon
1 - Night
2 - Void
Example Usage
local new_time = 1
local duration = 5
DCEI.SetTimeOfTheDay(new_time, duration)
local time = DCEI.GetTimeOfTheDay()
DCEI.LogMessage(time)
void SetTimeOfTheDay(int timeOfTheDay, float duration = 4)
void SetTimeOfTheDay(int timeOfTheDay, float duration = 4)
Description
Sets a time of the day over the given duration. Use 0 for an instant transition.
0 - Noon
1 - Night
2 - Void
Parameters
- int
timeOfTheDay
the integer corresponding to a timeOfTheDay. - float
duration
the transition duration.
Example Usage
local new_time = 1
local duration = 5
DCEI.SetTimeOfTheDay(new_time, duration)
local time = DCEI.GetTimeOfTheDay()
DCEI.LogMessage(time)
ColorRGB GetCurrentLightColor()
ColorRGB GetCurrentLightColor()
Description
Get the current light's RGB value
Example Usage
local light_color = DCEI.GetCurrentLightColor()
DCEI.LogMessage("R: " .. light_color.r)
DCEI.LogMessage("G: " .. light_color.g)
DCEI.LogMessage("B: " .. light_color.b)
Related
void SetOverrideLightColor(ColorRGB color, float duration)
void SetOverrideLightColor(ColorRGB color, float duration)
Description
Set light color RGB value for a period of time
Parameters
- ColorRGB
color
the RGB values for the color. Also accepts hex values such as"#32a852"
- float
duration
duration of time over which the transition from the current color to the new color will occur
Example Usage
local new_color = { r = 0.1, g = 0.1, b = 0.9 }
local duration = 3
DCEI.SetOverrideLightColor(new_color, duration)
void SetSkyboxColor(ColorRGB color, float duration)
void SetSkyboxColor(ColorRGB color, float duration)
Description
Set skybox RGB color value for a period of time.
Parameters
- ColorRGB
color
the RGB values for the color. Also accepts hex values such as"#32a852"
- float
duration
duration of time over which the transition from the current color to the new color will occur
Example Usage
-- Sets the skybox to a new color over 3 seconds
local new_color = { r = 1, g = 0.1, b = 0.5 }
local duration = 3
DCEI.SetSkyboxColor(new_color, duration)
-- Resets it after 5 seconds
local reset_timer = 5
DCEI.TriggerAddTimerEventElapsed(function()
DCEI.ResetSkyboxColor(0)
end, reset_timer)
void ResetSkyboxColor(float duration)
void ResetSkyboxColor(float duration)
Description
Resets the skybox color to the default over the given duration. Use 0 for an instant transition.
Parameters
- float
duration
the transition duration.
Example Usage
-- Sets the skybox to a new color over 3 seconds
local new_color = { r = 1, g = 0.1, b = 0.5 }
local duration = 3
DCEI.SetSkyboxColor(new_color, duration)
-- Resets it after 5 seconds
local reset_timer = 5
DCEI.TriggerAddTimerEventElapsed(function()
DCEI.ResetSkyboxColor(0)
end, reset_timer)
int AddLine(Float3 startPos, Float3 endPos, float width, ColorRGBA color, bool rectCap = False)
int AddLine(Float3 startPos, Float3 endPos, float width, ColorRGBA color, bool rectCap = False)
Description
Draws a line on the terrain, with color! Returns the lineId of the created line if successful.
Parameters
Float3
startPos
the starting coordinates for the line.Float3
endPos
the ending coordinates for the line.float
width
the width of the line, in terms of tiles.ColorRGBA
color
the RGBA values for the line. Also accepts hex codes, such as"#32a852"
bool
rectCap
if true, the ends of the line are rectangular instead of rounded.
Example Usage
-- Creates a line
local start_pos = { x = 10, y = 1, z = 15 }
local end_pos = { x = 20, y = 1, z = 15 }
local width = 1
local color = { r = 1, g = 0.5, b = 0.5, a = 0.5 }
local rect_cap = true
local line_id = DCEI.AddLine(start_pos, end_pos, width, color, rect_cap)
-- Removes it after 2 seconds
local line_duration = 2
DCEI.TriggerAddTimerEventElapsed(function()
DCEI.RemoveLine(line_id)
end, line_duration)
int AddLineWithSprite(Float3 startPos, Float3 endPos, float width, ColorRGBA color, string spriteName, float tex_multiplier = 1)
int AddLineWithSprite(Float3 startPos, Float3 endPos, float width, ColorRGBA color, string spriteName, float tex_multiplier = 1)
Description
Draws a line on the terrain using repeating sprites. Returns the lineId of the created line if successful.
Parameters
- Float3
startPos
the starting coordinates for the line. - Float3
endPos
the ending coordinates for the line. - float
width
the width of the line, in terms of tiles. - ColorRGBA
color
the RGBA values for the line. Also accepts hex codes, such as"#32a852"
- string
spriteName
the name of the sprite to draw. - float
tex_multiplier
the multiplier for sprite scaling.
Example Usage
-- Creates a line
local start_pos = { x = 10, y = 1, z = 15 }
local end_pos = { x = 20, y = 1, z = 15 }
local width = 1
local color = { r = 1, g = 0.5, b = 0.5, a = 0.5 }
local line_sprite = DCEI.Texture("airship_onMap")
local tex_multiplier = 1
local line_id = DCEI.AddLineWithSprite(start_pos, end_pos, width, color, line_sprite, tex_multiplier)
-- Removes it after 2 seconds
local line_duration = 2
DCEI.TriggerAddTimerEventElapsed(function()
DCEI.RemoveLine(line_id)
end, line_duration)
void RemoveLine(int lineId)
void RemoveLine(int lineId)
Description
Parameters
- int
lineId
the ID of the line to remove.
Example Usage
-- Creates a line
local start_pos = { x = 10, y = 1, z = 15 }
local end_pos = { x = 20, y = 1, z = 15 }
local width = 1
local color = { r = 1, g = 0.5, b = 0.5, a = 0.5 }
local rect_cap = true
local line_id = DCEI.AddLine(start_pos, end_pos, width, color, rect_cap)
-- Removes it after 2 seconds
local line_duration = 2
DCEI.TriggerAddTimerEventElapsed(function()
DCEI.RemoveLine(line_id)
end, line_duration)
void MoveLineWithInterpolation(int lineId, Float3 startPos, Float3 endPos, float duration)
void MoveLineWithInterpolation(int lineId, Float3 startPos, Float3 endPos, float duration)
Description
Moves a line's start and end points (and thus the line itself) to new locations over the given duration.
Parameters
- int
lineId
the ID of the line to move. - Float3
startPos
the new starting coordinates for the line. - Float3
endPos
the new ending coordinates for the line. - float
duration
the duration of the line's movement.
Example Usage
-- Creates a line
local start_pos = { x = 10, y = 1, z = 15 }
local end_pos = { x = 20, y = 1, z = 15 }
local width = 1
local color = { r = 1, g = 0.5, b = 0.5, a = 0.5 }
local rect_cap = true
local line_id = DCEI.AddLine(start_pos, end_pos, width, color, rect_cap)
-- Moves it
local new_start_pos = { x = 15, y = 1, z = 15 }
local new_end_pos = { x = 15, y = 1, z = 20 }
local move_duration = 3
DCEI.MoveLineWithInterpolation(line_id, new_start_pos, new_end_pos, move_duration)
void RemoveAllLines()
void RemoveAllLines()
Description
Example Usage
-- Creates a group of lines
for i = 1, 10, 1 do
local start_pos = { x = 10 + i, y = 1, z = 15 }
local end_pos = { x = 10 + i, y = 1, z = 20 }
local width = 0.5
local color = { r = 1, g = 0.5, b = 0.5, a = 0.5 }
local rect_cap = true
DCEI.AddLine(start_pos, end_pos, width, color, rect_cap)
end
-- Removes them after 2 seconds
local line_duration = 2
DCEI.TriggerAddTimerEventElapsed(function()
DCEI.RemoveAllLines()
end, line_duration)
void ChangeLineColor(int lineId, ColorRGBA color)
void ChangeLineColor(int lineId, ColorRGBA color)
Description
Parameters
- int
lineId
the ID of the line. - ColorRGBA
color
the RGBA values for the line. Also accepts hex codes, such as"#32a852"
Example Usage
-- Creates a line
local start_pos = { x = 10, y = 1, z = 15 }
local end_pos = { x = 20, y = 1, z = 15 }
local width = 1
local color = { r = 1, g = 0.5, b = 0.5, a = 0.5 }
local rect_cap = true
local line_id = DCEI.AddLine(start_pos, end_pos, width, color, rect_cap)
-- Changes color after 2 seconds
local line_duration = 2
DCEI.TriggerAddTimerEventElapsed(function()
local new_color = { r = 0.1, g = 0.1, b = 0.75, a = 0.75 }
DCEI.ChangeLineColor(line_id, new_color)
end, line_duration)
void ChangeLineDisplay(int lineId, bool display)
void ChangeLineDisplay(int lineId, bool display)
Description
Toggles the display of a line.
Parameters
- int
lineId
the ID of the line. - bool
display
if true, displays the line.
Example Usage
-- Creates a line
local start_pos = { x = 10, y = 1, z = 15 }
local end_pos = { x = 20, y = 1, z = 15 }
local width = 1
local color = { r = 1, g = 0.5, b = 0.5, a = 0.5 }
local rect_cap = true
local line_id = DCEI.AddLine(start_pos, end_pos, width, color, rect_cap)
-- Hides it after 2 seconds
local line_duration = 2
DCEI.TriggerAddTimerEventElapsed(function()
DCEI.ChangeLineDisplay(line_id, false)
end, line_duration)
int AddGrid(Float3 center, float width, float height, int xCount, int zCount, float lineWidth, ColorRGBA color, bool rectCap = False)
int AddGrid(Float3 center, float width, float height, int xCount, int zCount, float lineWidth, ColorRGBA color, bool rectCap = False)
Description
Draws a grid with lines. Returns a gridId integer if successful.
Parameters
- Float3
center
the coordinates for the center of the grid. - float
width
the width of the grid (in tiles). - float
height
the height of the grid (in tiles). - int
xCount
the number of columns (along the x axis). - int
zCount
the number of rows (along the z axis). - float
lineWidth
the width of the grid lines. - ColorRGBA
color
the RGBA values for the line. Also accepts hex codes, such as"#32a852"
- bool
rectCap
if true, the ends of the grid lines are rectangular instead of rounded.
Example Usage
-- Creates a grid
local center = { x = 16, y = 1, z = 16 }
local width = 5.5
local height = 5.5
local xCount = 5
local zCount = 6
local line_width = 0.1
local color = { r = 1, g = 0.5, b = 0.5, a = 0.5 }
local rect_cap = false
local grid_id = DCEI.AddGrid(center, width, height, xCount, zCount, line_width, color, rect_cap)
-- Removes it after 2 seconds
local line_duration = 2
DCEI.TriggerAddTimerEventElapsed(function()
DCEI.RemoveGrid(grid_id)
end, line_duration)
int AddGridWithSprite(Float3 center, float width, float height, int xCount, int zCount, float lineWidth, ColorRGBA color, string spriteName, float tex_multiplier = 1)
int AddGridWithSprite(Float3 center, float width, float height, int xCount, int zCount, float lineWidth, ColorRGBA color, string spriteName, float tex_multiplier = 1)
Description
Draws a grid with lines made of repeating sprites. Returns a gridId integer if successful.
Parameters
Float3
center
the coordinates for the center of the grid.float
width
the width of the grid (in tiles).float
height
the height of the grid (in tiles).int
xCount
the number of columns (along the x axis).int
zCount
the number of rows (along the z axis).float
lineWidth
the width of the grid lines.ColorRGBA
color
the RGBA values for the line. Also accepts hex codes, such as"#32a852"
string
spriteName
the name of the sprite to draw.float
tex_multiplier
the multiplier for sprite scaling.
Example Usage
-- Creates a grid
local center = { x = 16, y = 1, z = 16 }
local width = 10.5
local height = 10.5
local xCount = 5
local zCount = 6
local line_width = 0.5
local color = { r = 1, g = 0.5, b = 0.5, a = 0.5 }
local sprite = DCEI.Texture("airship_onMap")
local tex_multiplier = 1
local grid_id = DCEI.AddGridWithSprite(center, width, height, xCount, zCount, line_width, color, sprite, tex_multiplier)
-- Removes it after 2 seconds
local line_duration = 2
DCEI.TriggerAddTimerEventElapsed(function()
DCEI.RemoveGrid(grid_id)
end, line_duration)
void RemoveGrid(int gridId)
void RemoveGrid(int gridId)
Description
Parameters
- int
gridId
the ID of the grid to remove.
Example Usage
-- Creates a grid
local center = { x = 16, y = 1, z = 16 }
local width = 5.5
local height = 5.5
local xCount = 5
local zCount = 6
local line_width = 0.1
local color = { r = 1, g = 0.5, b = 0.5, a = 0.5 }
local rect_cap = false
local grid_id = DCEI.AddGrid(center, width, height, xCount, zCount, line_width, color, rect_cap)
-- Removes it after 2 seconds
local line_duration = 2
DCEI.TriggerAddTimerEventElapsed(function()
DCEI.RemoveGrid(grid_id)
end, line_duration)
void SetBlurredScreenCaptureAsBackground(bool set, float duration)
void SetBlurredScreenCaptureAsBackground(bool set, float duration)
Description
Toggles a blurred version of your terrain in the background. Note that this background renders underneath the terrain, so you may need to move your game camera to see it.
Parameters
- bool
set
if true, enables the blurred background. - float
duration
the transition duration of the blur.
Example Usage
-- Creates a button
local button_layout = GMUI.Layout.New({
parent = DCEI.GetUiRootFrame(),
name = "Standard/Button/Button",
})
-- Sets the current screen as the background over 1 second when the button is pressed
DCEI.SetOnClickCallback(button_layout.Button, function()
DCEI.SetBlurredScreenCaptureAsBackground(true, 1)
-- Removes it after 2 seconds
local reset_duration = 2
DCEI.TriggerAddTimerEventElapsed(function()
DCEI.SetBlurredScreenCaptureAsBackground(false, 0)
end, reset_duration)
end)