Skip to content

Frequently Asked Questions

BlackTower edited this page Jul 28, 2022 · 2 revisions
Table of Contents

What should I do if saving doesn’t work?

The editor can sometimes fail to save if the Terrain Window crashes. You can usually close the Terrain Window (while keeping other windows like Data open) and try saving again.

Why there is a VS code warning pop up when installing the editor?

The editor installation comes with a VS Code plugin for API reference and auto-completion for our Lua scripting system. Feel free to ignore this warning as it won't have any effect on the installation.

How can I get units found by a search effect in Lua?

You can make the area search apply a behavior and add units with the behavior to a list, such as:

function OnUnitBehaviorAdd()
    local u = DCEI.TriggeringUnit
    local b = DCEI.TriggeringBehaviorName

    local search_list = {}
    local search_behavior = "MySearchBehavior"
    if b = search_behavior then
        -- add units with the behavior to the list
        table.insert(search_list, u)

        -- remove the behavior so it can be applied again
        local stack_count = DCEI.GetUnitBehaviorStackCount(u, search_behavior)
        DCEI.RemoveBehavior(u, search_behavior, stack_count)
    end
end

DCEI.TriggerAddBehaviorAddEvent(DCEI.UnitAny, OnUnitBehaviorAdd)

Why is my ranged ability not working?

There are a few reasons an ability may fail to cast:

  • Check if the range is set
  • Check if the arc is set and the caster is able to turn
  • Check if the cost is set and the caster has required resources

If you've checked each of these and your ability still isn't working, let us know and we can take a look.

How do I make a knockback effect?

We often use the Launch Missile effect to create knockbacks. The typical data pattern is

  • Create a launch missile effect and keep the Missile Unit as "None" (this will launch the effect target)
  • Set the Launch Location to "Target Unit"
  • Apply the launch missile effect to the unit you want to knock back

You can also use this pattern to create "jump"-like abilities (setting the Launch Location as "Source Unit").

image

How can I apply multiple effects at the same time?

Use a Set effect.

image

Clone this wiki locally