Trigger API Reference\DCEI Functions\Map
string GetLevel()
string GetLevel()
Description
Get the name of the level being played
Example Usage
function UpgradeCreeps()
if DCEI.GetLevel() ~= "Events/Fire03_Easter/Maryn_Leviathan_Typhoon/Level09" then
DCEI.LogMessage(DCEI.GetLevel())
end
end
string GetLevelName()
string GetLevelName()
Description
Returns the published name of the map.
Example Usage
local level_name = DCEI.GetLevelName()
DCEI.LogMessage(level_name)
void PlayLevel(string path, string projectName, string data = null, object usedUnits = null)
void PlayLevel(string path, string projectName, string data = null, object usedUnits = null)
Description
Loads and plays the given map. The map to load must be within the same project.
Parameters
- string
path
the path to the map, or just the map name if both maps are in the same folder. - string
projectName
the name of the project folder that the map is under. - string
data
any data that is passed to the new level. - object
usedUnits
a table declaring any units used by the new level, if not declared locally already.
Example Usage
local LEVEL_2_MAP = "Maps/Level2"
local PROJECT_NAME = "Zombie Smasher 3"
Core.Timer.Real.New({
duration = 3,
action = function()
DCEI.PlayLevel(LEVEL_2_MAP, PROJECT_NAME, nil, nil)
end,
})
string GetPlayLevelData()
string GetPlayLevelData()
Description
Example Usage
local level_data = DCEI.GetPlayLevelData()
DCEI.LogMessage(level_data)