[Done] cliff-explosives question

Place to get help with not working mods / modding interface.
Post Reply
TheSAguy
Smart Inserter
Smart Inserter
Posts: 1449
Joined: Mon Jan 13, 2014 6:17 pm
Contact:

[Done] cliff-explosives question

Post 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.
Last edited by TheSAguy on Sun May 20, 2018 8:47 pm, edited 1 time in total.

TheSAguy
Smart Inserter
Smart Inserter
Posts: 1449
Joined: Mon Jan 13, 2014 6:17 pm
Contact:

Re: cliff-explosives question

Post 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,.

Nexela
Smart Inserter
Smart Inserter
Posts: 1828
Joined: Wed May 25, 2016 11:09 am
Contact:

Re: cliff-explosives question

Post 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
Last edited by Nexela on Sun May 20, 2018 10:07 pm, edited 1 time in total.

TheSAguy
Smart Inserter
Smart Inserter
Posts: 1449
Joined: Mon Jan 13, 2014 6:17 pm
Contact:

Re: cliff-explosives question

Post by TheSAguy »

Thanks Nexela!
P.S. Really like your Nanobots: Early Bots Mod.

Post Reply

Return to “Modding help”