Trigger API Reference\DCEI Functions\Custom Data
object GetAllCustomData()
object GetAllCustomData()
Description
Returns a table of all the custom data. To set the data, go to the Custom Data window.
Example Usage
function PrintTable(table)
for key, value in pairs(table) do
if type(value) == "table" then
PrintTable(value) -- Recursively print nested tables
else
DCEI.LogMessage("key: " .. tostring(key))
DCEI.LogMessage("value: " .. tostring(value))
end
end
end
PrintTable(DCEI.GetAllCustomData())
object GetCustomDataByType(string typeName)
object GetCustomDataByType(string typeName)
Description
Returns a table of all the custom data of the given type.
Parameters
- string
typeName
the name of the type.
Example Usage
function PrintTable(table)
for key, value in pairs(table) do
if type(value) == "table" then
PrintTable(value) -- Recursively print nested tables
else
DCEI.LogMessage("key: " .. tostring(key))
DCEI.LogMessage("value: " .. tostring(value))
end
end
end
local talents = DCEI.GetCustomDataByType("Talents")
PrintTable(talents)
object GetDefaultCustomDataByType(string typeName)
object GetDefaultCustomDataByType(string typeName)
Description
Returns a table of all the default custom data of the given type.
Parameters
- string
typeName
the name of the type.
Example Usage
function PrintTable(table)
for key, value in pairs(table) do
if type(value) == "table" then
PrintTable(value) -- Recursively print nested tables
else
DCEI.LogMessage("key: " .. tostring(key))
DCEI.LogMessage("value: " .. tostring(value))
end
end
end
local talent_defaults = DCEI.GetDefaultCustomDataByType("Talents")
PrintTable(talent_defaults)
object GetCustomDataByInstance(string typeName, string instanceName)
object GetCustomDataByInstance(string typeName, string instanceName)
Description
Returns a table of all the custom data of the given type of a specific instance.
Parameters
- string
typeName
the name of the type. - string
instanceName
the name of the instance of an object.
Example Usage
function PrintTable(table)
for key, value in pairs(table) do
if type(value) == "table" then
PrintTable(value) -- Recursively print nested tables
else
DCEI.LogMessage("key: " .. tostring(key))
DCEI.LogMessage("value: " .. tostring(value))
end
end
end
local talent_fireball = DCEI.GetCustomDataByInstance("Talents", "Fireball")
PrintTable(talent_fireball)