Trigger API Reference DCEI Functions Effect0 - funovus/editor-wiki GitHub Wiki
Table of Contents
- [Trigger API Reference\DCEI Functions\Effect](#trigger-api-referencedcei-functionseffect)
* [string GetEffectType(string effectName)](#string-geteffecttypestring-effectname)
* [void CreateEffect(string effectName, unit target)](#void-createeffectstring-effectname-unit-target)
* [void CreateEffectAtUnit(string effectName, unit target)](#void-createeffectatunitstring-effectname-unit-target)
* [void CreateEffect(string effectName, unit caster, unit source, unit target)](#void-createeffectstring-effectname-unit-caster-unit-source-unit-target)
* [void CreateEffectAtUnit(string effectName, unit target, unit caster, unit source)](#void-createeffectatunitstring-effectname-unit-target-unit-caster-unit-source)
* [void CreateEffect(string effectName, unit caster, float x, float z)](#void-createeffectstring-effectname-unit-caster-float-x-float-z)
* [void CreateEffectAtPosition(string effectName, unit caster, float x, float z)](#void-createeffectatpositionstring-effectname-unit-caster-float-x-float-z)
* [double EvaluateEffectHookExpression(string name)](#double-evaluateeffecthookexpressionstring-name)
* [object GetEffectHookFieldValue(String[] path)](#object-geteffecthookfieldvaluestring-path)
* [void SetEffectHookFieldValue(String[] path, object value)](#void-seteffecthookfieldvaluestring-path-object-value)
|
Trigger API Reference\DCEI Functions\Effect {Trigger-API-ReferenceDCEI-FunctionsEffect}
string GetEffectType(string effectName)
Returns the effect type of an effect as a string.
local effect_type = DCEI.GetEffectType("DoNothing")
DCEI.LogMessage(effect_type)
void CreateEffect(string effectName, unit target)
Creates an effect targeting a unit. There is no source or caster unit.
local team_id = 1
local player_id = 1
local unit_type = "Standard MeleeUnit"
local x, y = 16, 16
local test_subject = DCEI.CreateUnitAsync(team_id, player_id, unit_type, x, y)
DCEI.CreateEffect("Kill", test_subject)
void CreateEffectAtUnit(string effectName, unit target) {void-CreateEffectAtUnitstring-effectName-unit-target}
void CreateEffectAtUnit(string effectName, unit target)
Creates an effect targeting a unit. There is no source or caster unit.
local team_id = 1
local player_id = 1
local unit_type = "Standard MeleeUnit"
local x, y = 16, 16
local test_subject = DCEI.CreateUnitAsync(team_id, player_id, unit_type, x, y)
DCEI.CreateEffectAtUnit("Kill", test_subject)
void CreateEffect(string effectName, unit caster, unit source, unit target) {void-CreateEffectstring-effectName-unit-caster-unit-source-unit-target}
void CreateEffect(string effectName, unit caster, unit source, unit target)
Create an effect targeting a unit via a source unit as if cast by another unit.
-
string
effectName
the name of the effect to create. -
unit
caster
the unit that is considered to be the caster of the effect. -
unit
source
the unit to treat as the effect source. -
unit
target
the unit to target with the effect.
local team_id = 1
local player_id = 1
local unit_type = "Standard MeleeUnit"
local x, y = 16, 16
local caster = DCEI.CreateUnitAsync(team_id, player_id, unit_type, x, y)
local source = DCEI.CreateUnitAsync(team_id, player_id, unit_type, x, y)
local target = DCEI.CreateUnitAsync(team_id, player_id, unit_type, x, y)
DCEI.CreateEffect("Kill", caster, source, target)
void CreateEffectAtUnit(string effectName, unit target, unit caster, unit source) {void-CreateEffectAtUnitstring-effectName-unit-target-unit-caster-unit-source}
void CreateEffectAtUnit(string effectName, unit target, unit caster, unit source)
Create an effect targeting a unit via a source unit as if cast by another unit.
-
string
effectName
the name of the effect to create. -
unit
caster
the unit that is considered to be the caster of the effect. -
unit
source
the unit to treat as the effect source. -
unit
target
the unit to target with the effect.
local team_id = 1
local player_id = 1
local unit_type = "Standard MeleeUnit"
local x, y = 16, 16
local caster = DCEI.CreateUnitAsync(team_id, player_id, unit_type, x, y)
local source = DCEI.CreateUnitAsync(team_id, player_id, unit_type, x, y)
local target = DCEI.CreateUnitAsync(team_id, player_id, unit_type, x, y)
DCEI.CreateEffectAtUnit("Kill", caster, source, target)
void CreateEffect(string effectName, unit caster, float x, float z) {void-CreateEffectstring-effectName-unit-caster-float-x-float-z}
void CreateEffect(string effectName, unit caster, float x, float z)
Creates an effect from a unit targeting a point.
-
string
effectName
the name of the effect to create. -
unit
caster
the unit that is considered to be the caster of the effect. -
float
x
the x-axis coordinate to cast the ability at. -
float
z
the z-axis coordinate to cast the ability at.
local team_id = 1
local player_id = 1
local unit_type = "Standard MeleeUnit"
local x, y = 16, 16
local test_subject = DCEI.CreateUnitAsync(team_id, player_id, unit_type, x, y)
DCEI.CreateEffect("Kill", test_subject)
void CreateEffectAtPosition(string effectName, unit caster, float x, float z) {void-CreateEffectAtPositionstring-effectName-unit-caster-float-x-float-z}
void CreateEffectAtPosition(string effectName, unit caster, float x, float z)
Creates an effect from a unit targeting a point.
-
string
effectName
the name of the effect to create. -
unit
caster
the unit that is considered to be the caster of the effect. -
float
x
the x-axis coordinate to cast the ability at. -
float
z
the z-axis coordinate to cast the ability at.
local team_id = 1
local player_id = 1
local unit_type = "Standard MeleeUnit"
local x, y = 16, 16
local test_subject = DCEI.CreateUnitAsync(team_id, player_id, unit_type, x, y)
DCEI.CreateEffectAtPosition("Kill", test_subject)
double EvaluateEffectHookExpression(string name)
Added effect hook trigger APIs that let you customize effect data at runtime for each effect instance.
DCEI.TriggerAddEffectHookEvent(
DCEI.Effect("Standard RangedUnit Weapon Launch"),
function(context)
if DCEI.EvaluateEffectHookExpression("RandomChance 50%") ~= 0 then
local field_path = {"launchMissile", "missileUnit"}
local missile_unit = DCEI.GetUnitType(context.target)
DCEI.SetEffectHookFieldValue(field_path, missile_unit)
end
end
)
object GetEffectHookFieldValue(String[] path)
Added effect hook trigger APIs that let you customize effect data at runtime for each effect instance.
DCEI.TriggerAddEffectHookEvent(
DCEI.Effect("Standard RangedUnit Weapon Launch"),
function(context)
if DCEI.EvaluateEffectHookExpression("RandomChance 50%") ~= 0 then
local field_path = {"launchMissile", "missileUnit"}
local missile_unit = DCEI.GetUnitType(context.target)
DCEI.SetEffectHookFieldValue(field_path, missile_unit)
end
end
)
void SetEffectHookFieldValue(String[] path, object value) {void-SetEffectHookFieldValueString-path-object-value}
void SetEffectHookFieldValue(String[] path, object value)
Added effect hook trigger APIs that let you customize effect data at runtime for each effect instance.
DCEI.TriggerAddEffectHookEvent(
DCEI.Effect("Standard RangedUnit Weapon Launch"),
function(context)
if DCEI.EvaluateEffectHookExpression("RandomChance 50%") ~= 0 then
local field_path = {"launchMissile", "missileUnit"}
local missile_unit = DCEI.GetUnitType(context.target)
DCEI.SetEffectHookFieldValue(field_path, missile_unit)
end
end
)