Trigger API Reference DCEI Types - funovus/editor-wiki GitHub Wiki
Table of Contents
- [Trigger API Reference\DCEI Types](#trigger-api-referencedcei-types)
* [UnitBehaviorStatus](#unitbehaviorstatus)
* [BehaviorFilter](#behaviorfilter)
* [AbilityFilter](#abilityfilter)
* [WeaponFilter](#weaponfilter)
* [CriticalFilter](#criticalfilter)
* [UnitTagStatus](#unittagstatus)
* [UnitFilter](#unitfilter)
* [Unit](#unit)
* [Region](#region)
* [Float2](#float2)
* [AbilityCost](#abilitycost)
* [BehaviorModifier](#behaviormodifier)
* [Float3](#float3)
* [EffectContext](#effectcontext)
* [UnitLabelOptions](#unitlabeloptions)
* [Offset](#offset)
* [TextOptions](#textoptions)
* [ColorRGBA](#colorrgba)
* [ColorRGB](#colorrgb)
* [WaypointOptions](#waypointoptions)
* [ScreenBackgroundOptions](#screenbackgroundoptions)
* [AreaOffset](#areaoffset)
* [JoystickOptions](#joystickoptions)
* [JoystickButtonOptions](#joystickbuttonoptions)
* [BigHeadMessageOptions](#bigheadmessageoptions)
* [SpawnGroupUnit](#spawngroupunit)
* [SpawnGroup](#spawngroup)
* [SpawnWaveInitialBehavior](#spawnwaveinitialbehavior)
* [SpawnWaveOptions](#spawnwaveoptions)
|
Trigger API Reference\DCEI Types {trigger-api-referencedcei-types}
Type UnitBehaviorStatus
UnitBehaviorStatus
{
string name
int stack_count
}
Unit's behavior stats, including behavior name and stack count.
Type BehaviorFilter
BehaviorFilter
{
string name
string family
}
Usually used to make something on happens with certain behaviors.
Type AbilityFilter
AbilityFilter
{
string name
string family
}
Usually used to make something on happens with certain abilities.
Type WeaponFilter
WeaponFilter
{
string name
string family
}
Usually used to make something on happens with certain weapons.
Type CriticalFilter
CriticalFilter
{
bool critical_only
bool not_critical_only
}
Usually used to make the effect only triggers with only critical or not critical damage events.
Type UnitTagStatus
UnitTagStatus
{
string name
int stack_count
}
Tag status on unit, with name and stack count.
Type UnitFilter
UnitFilter
{
Nullable<int> team
string name
}
Type Unit
Unit
{
Entity UnsafeEntity
UnitFilter filter
}
Type Region
Region
{
Entity UnsafeEntity
}
Type Float2
Float2
{
float x
float y
}
local pos = {x = 1, y = 1}
DCEI.SetUnitPosition2D(unit, pos.x, pos.y)
Type AbilityCost
AbilityCost
{
float health
float mana
float gold
}
function OnAbilityUse()
local id = DCEI.TriggeringAbilityId
local name = DCEI.TriggeringAbilityName
DCEI.LogMessage(name .. " use")
local cost = DCEI.GetAbilityCost(name)
for key, value in pairs(cost) do
DCEI.LogMessage(key .. " : " .. value)
end
end
DCEI.TriggerAddUseAbilityEvent(DCEI.UnitAny, OnAbilityUse)
Type BehaviorModifier
BehaviorModifier
{
float scaled
float unscaled
float additive_factor
float positive_unified_factor
float negative_unified_factor
float multiplier_factor
}
Type Float3
Float3
{
float x
float y
float z
}
Can be used as Position 3D or Scale 3D.
local duration = 1
local ease = "Linear"
local k1 = {x = min_scale, y = min_scale, z = min_scale}
local k2 = {x = max_scale, y = max_scale, z = max_scale}
local anim = DCEI.AnimateFrameScale(layout.Frame, k1, k2, duration, ease)
Type EffectContext
EffectContext
{
unit caster
unit source
unit target
Float2 target_location
string damage_source_type
string damage_source_name
}
Type UnitLabelOptions
UnitLabelOptions
{
Offset offset
bool center_at_unit_origin
bool center_at_unit_top
}
Built in unit label option table.
local label_options = {offset = {right = 1, up = 1, front = 1}, center_at_unit_origin = true, center_at_unit_top = true}
DCEI.ShowUnitLabel(unit, "Unit", label_options)
Type Offset
Offset
{
double right
double up
double front
}
Helper table in some API for offset
local frame = DCEI.NewText(DCEI.GetUiRoot())
DCEI.SetText(frame, "Bob")
local unit = DCEI.CreateUnit(1, 1, "Standard MeleeUnit", 16, 16, 0, -1)
local options = {
offset = {up = 1.2},
center_at_unit_origin = true
}
DCEI.AttachToUnit(frame, unit, options)
Type TextOptions
TextOptions
{
Offset offset
}
Type ColorRGBA
ColorRGBA
{
float r
float g
float b
float a
}
Color table. Notice the float is 01 instead of 0255.
local frame = DCEI.NewFrame(DCEI.GetUiRoot())
DCEI.SetBackgroundImageColor(frame, 251/255, 79/255, 79/255, 1)
DCEI.SetSize(frame, 100, 100)
Type ColorRGB
ColorRGB
{
float r
float g
float b
}
Color table. Notice the float is 01 instead of 0255.
DCEI.SetTextFrameColorRGB(text_frame, { r = 0.5, g = 0.5, b = 0.5 })
Type WaypointOptions
WaypointOptions
{
string waypoint_name
float dispersal
bool use_natural_dispersal
int node_index
}
Type ScreenBackgroundOptions
ScreenBackgroundOptions
{
Color color
float duration
}
Type AreaOffset
AreaOffset
{
float left
float right
float top
float bottom
ColorRGBA debug_draw_color
}
Type JoystickOptions
JoystickOptions
{
Float2 anchor
Float2 offset
bool disable_wasd
bool disable_arrow_keys
int joystick_id
bool dynamic_position
bool always_show
float radius
AreaOffset active_area_offset
string handle_icon
ColorRGBA handle_icon_color
string background_icon
ColorRGBA background_icon_color
bool handle_rotation
Transform parent
JoystickOptions Default
}
All the joystick options for virtual joystick.
Type JoystickButtonOptions
JoystickButtonOptions
{
string icon
bool hide
}
All the joystick button options for virtual joystick.
Type BigHeadMessageOptions
BigHeadMessageOptions
{
bool pause
object on_dismiss
double delay
Color message_box_color
Color title_box_color
}
Type SpawnGroupUnit
SpawnGroupUnit
{
string unit
double delay
double offset
}
Type SpawnGroup
SpawnGroup
{
string name
string route_name
bool hide_wave_indicator
double initial_delay
string group_pattern
string unit
string pattern
int count
List<string> yield_group
}
Type SpawnWaveInitialBehavior
SpawnWaveInitialBehavior
{
string name
int stack
}
Type SpawnWaveOptions
SpawnWaveOptions
{
double total_gold
double bonus_gold
double start_delay
double call_wave_countdown
List<SpawnGroup> groups
List<SpawnWaveInitialBehavior> behaviors
}