What event fires when player explode cliff?

Place to get help with not working mods / modding interface.
Post Reply
x2605
Inserter
Inserter
Posts: 41
Joined: Fri Jul 31, 2020 4:08 pm
Contact:

What event fires when player explode cliff?

Post by x2605 »

I can't find it from API site.
I can't find it anyone asking about that on this forum.
English is not my native language. Sorry for bad English.
My mods :
Lua API global Variable Viewer (mod portal)
Lua API Event Trace (mod portal)
My tools :
Locale String Editor (github.io webapp)

User avatar
eradicator
Smart Inserter
Smart Inserter
Posts: 5206
Joined: Tue Jul 12, 2016 9:03 am
Contact:

Re: What event fires when player explode cliff?

Post by eradicator »

When i'm unsure what events are firing i just have them printed to console:

Code: Select all

/c
local rev = function(a,b) for k,v in pairs(a) do b[v]=k end return b end
local del = function(a,b) for _,k in pairs(a) do b[k]=nil end return b end
local nam = rev(del({'on_tick','on_chunk_generated'},defines.events),{})
script.on_event(rev(nam,{}),function(e) game.print(e.tick..': '..nam[e.name]) end)
Looks like there is no event for cliffs exploding.
Author of: Belt Planner, Hand Crank Generator, Screenshot Maker, /sudo and more.
Mod support languages: 日本語, Deutsch, English
My code in the post above is dedicated to the public domain under CC0.

x2605
Inserter
Inserter
Posts: 41
Joined: Fri Jul 31, 2020 4:08 pm
Contact:

Re: What event fires when player explode cliff?

Post by x2605 »

eradicator wrote:
Mon Aug 03, 2020 3:23 pm
When i'm unsure what events are firing i just have them printed to console:

Code: Select all

/c
local rev = function(a,b) for k,v in pairs(a) do b[v]=k end return b end
local del = function(a,b) for _,k in pairs(a) do b[k]=nil end return b end
local nam = rev(del({'on_tick','on_chunk_generated'},defines.events),{})
script.on_event(rev(nam,{}),function(e) game.print(e.tick..': '..nam[e.name]) end)
Looks like there is no event for cliffs exploding.
thanks! this code is so useful, but unfortunately i couldn't found any events but only on_player_used_capsule fires.
may be cliffs affected by throwing can be determined by combining some informations...
English is not my native language. Sorry for bad English.
My mods :
Lua API global Variable Viewer (mod portal)
Lua API Event Trace (mod portal)
My tools :
Locale String Editor (github.io webapp)

User avatar
ickputzdirwech
Filter Inserter
Filter Inserter
Posts: 768
Joined: Sun May 07, 2017 10:16 am
Contact:

Re: What event fires when player explode cliff?

Post by ickputzdirwech »

x2605 wrote:
Sat Aug 22, 2020 2:11 pm

thanks! this code is so useful, but unfortunately i couldn't found any events but only on_player_used_capsule fires.
may be cliffs affected by throwing can be determined by combining some informations...
Keep in mind that robots can blow up cliffs as well.

I once tried to give the player an item if they blow up a cliff. In the end I implemented a entity similar to item on ground and expanded the following table to create one of it:

Code: Select all

data.raw.capsule[„cliff-explosives“].robot_action.action_delivery.target_effects = ...
There were two major issues with this however. It doesn’t take in to account how many cliffs you blew up with the one cliff explosion and it only works when a robot throws the cliff explosion. I could get the latter to work by expanding

Code: Select all

 data.raw.projectile[„cliff-explosives“].action.action_delivery.target_effects = ...
Strange thing about this is that it only works for the player and none of it worked if I tried to implement both at the same time.
Mods: Shortcuts for 1.1, ick's Sea Block, ick's vanilla tweaks
Tools: Atom language pack
Text quickly seems cold and unfriendly. Be careful how you write and interpret what others have written.
- A reminder for me and all who read what I write

Post Reply

Return to “Modding help”