Page 1 of 1

[Done] cliff-explosives question

Posted: Sat May 19, 2018 10:34 pm
by TheSAguy
How can I detect if a cliff explosion happened?

What is the trigger I should use?
I want to have biters attack if it happens.

Thanks.

Re: cliff-explosives question

Posted: Sun May 20, 2018 5:44 pm
by TheSAguy
How would I insert "trigger_created_entity = true" into the "cliff-explosives" projectile entity?

I thought of doing the below code, just adding it in:
Code
But what if another mod does something with that entity, is there a better way of just inserting the trigger?

Thanks,.

Re: cliff-explosives question

Posted: Sun May 20, 2018 6:28 pm
by Nexela

Code: Select all

local proj = data.raw["projectile"]["cliff-explosives"]
if proj and proj.action then
    local action = proj.action[1].action_deliver.target_effects
    for _, eff in pairs(action) do
        if eff.type == "create-entity" and eff.entity_name == "ground-explosion" then
            eff.trigger_created_entity = true
            break
        end
    end
end

Re: cliff-explosives question

Posted: Sun May 20, 2018 8:47 pm
by TheSAguy
Thanks Nexela!
P.S. Really like your Nanobots: Early Bots Mod.