Trigger API Reference DCEI Types - BLKTower/TestWiki GitHub Wiki

Table of Contents

UnitBehaviorStatus

Type UnitBehaviorStatus

Type Structure

UnitBehaviorStatus
{
string name
int stack_count
}

Description

Unit's behavior stats, including behavior name and stack count.

Example Usage

BehaviorFilter

Type BehaviorFilter

Type Structure

BehaviorFilter
{
string name
string family
}

Description

Usually used to make something on happens with certain behaviors.

Example Usage

AbilityFilter

Type AbilityFilter

Type Structure

AbilityFilter
{
string name
string family
}

Description

Usually used to make something on happens with certain abilities.

Example Usage

WeaponFilter

Type WeaponFilter

Type Structure

WeaponFilter
{
string name
string family
}

Description

Usually used to make something on happens with certain weapons.

Example Usage

CriticalFilter

Type CriticalFilter

Type Structure

CriticalFilter
{
bool critical_only
bool not_critical_only
}

Description

Usually used to make the effect only triggers with only critical or not critical damage events.

Example Usage

UnitTagStatus

Type UnitTagStatus

Type Structure

UnitTagStatus
{
string name
int stack_count
}

Description

Tag status on unit, with name and stack count.

Example Usage

UnitFilter

Type UnitFilter

Type Structure

UnitFilter
{
Nullable<int> team
string name
}

Description

Example Usage

Unit

Type Unit

Type Structure

Unit
{
Entity UnsafeEntity
UnitFilter filter
}

Description

Example Usage

Region

Type Region

Type Structure

Region
{
Entity UnsafeEntity
}

Description

Example Usage

Float2

Type Float2

Type Structure

Float2
{
float x
float y
}

Description

Usually use for Position 2D.

Example Usage

local pos = {x = 1, y = 1}
DCEI.SetUnitPosition2D(unit, pos.x, pos.y)

AbilityCost

Type AbilityCost

Type Structure

AbilityCost
{
float health
float mana
float gold
}

Description

Ability cost table.

Example Usage

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)

GetAbilityCost

BehaviorModifier

Type BehaviorModifier

Type Structure

BehaviorModifier
{
float scaled
float unscaled
float additive_factor
float positive_unified_factor
float negative_unified_factor
float multiplier_factor
}

Description

--remove

Example Usage

Float3

Type Float3

Type Structure

Float3
{
float x
float y
float z
}

Description

Can be used as Position 3D or Scale 3D.

Example Usage

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)

EffectContext

Type EffectContext

Type Structure

EffectContext
{
unit caster
unit source
unit target
Float2 target_location
string damage_source_type
string damage_source_name
}

Description

Get effect's context.

Example Usage

UnitLabelOptions

Type UnitLabelOptions

Type Structure

UnitLabelOptions
{
Offset offset
bool center_at_unit_origin
bool center_at_unit_top
}

Description

Built in unit label option table.

Example Usage

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)

ShowUnitLabel HideUnitLabel

Offset

Type Offset

Type Structure

Offset
{
double right
double up
double front
}

Description

Helper table in some API for offset

Example Usage

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)

AttachFrameToUnit

TextOptions

Type TextOptions

Type Structure

TextOptions
{
Offset offset
}

Description

Text option.

Example Usage

ColorRGBA

Type ColorRGBA

Type Structure

ColorRGBA
{
float r
float g
float b
float a
}

Description

Color table. Notice the float is 01 instead of 0255.

Example Usage

local frame = DCEI.NewFrame(DCEI.GetUiRoot())
DCEI.SetBackgroundImageColor(frame, 251/255, 79/255, 79/255, 1)
DCEI.SetSize(frame, 100, 100)

ColorRGB

Type ColorRGB

Type Structure

ColorRGB
{
float r
float g
float b
}

Description

Color table. Notice the float is 01 instead of 0255.

Example Usage

DCEI.SetTextFrameColorRGB(text_frame, { r = 0.5, g = 0.5, b = 0.5 })

WaypointOptions

Type WaypointOptions

Type Structure

WaypointOptions
{
string waypoint_name
float dispersal
bool use_natural_dispersal
int node_index
}

Description

--remove

Example Usage

ScreenBackgroundOptions

Type ScreenBackgroundOptions

Type Structure

ScreenBackgroundOptions
{
Color color
float duration
}

Description

--remove

Example Usage

AreaOffset

Type AreaOffset

Type Structure

AreaOffset
{
float left
float right
float top
float bottom
ColorRGBA debug_draw_color
}

Description

--remove

Example Usage

JoystickOptions

Type JoystickOptions

Type Structure

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
}

Description

All the joystick options for virtual joystick.

Example Usage

JoystickButtonOptions

Type JoystickButtonOptions

Type Structure

JoystickButtonOptions
{
string icon
bool hide
}

Description

All the joystick button options for virtual joystick.

Example Usage

BigHeadMessageOptions

Type BigHeadMessageOptions

Type Structure

BigHeadMessageOptions
{
bool pause
object on_dismiss
double delay
Color message_box_color
Color title_box_color
}

Description

Big head message options

Example Usage

SpawnGroupUnit

Type SpawnGroupUnit

Type Structure

SpawnGroupUnit
{
string unit
double delay
double offset
}

Description

--remove

Example Usage

SpawnGroup

Type SpawnGroup

Type Structure

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
}

Description

--remove

Example Usage

SpawnWaveInitialBehavior

Type SpawnWaveInitialBehavior

Type Structure

SpawnWaveInitialBehavior
{
string name
int stack
}

Description

--remove

Example Usage

SpawnWaveOptions

Type SpawnWaveOptions

Type Structure

SpawnWaveOptions
{
double total_gold
double bonus_gold
double start_delay
double call_wave_countdown
List<SpawnGroup> groups
List<SpawnWaveInitialBehavior> behaviors
}

Description

--remove

Example Usage

⚠️ **GitHub.com Fallback** ⚠️