#the mine events and then the build

1 messages · Page 1 of 1 (latest)

frigid nexus
#

I am only getting the mined events

#

i have an event that uses the
defines.events.on_pre_player_mined_item
and
defines.events.on_built_entity

storm birch
#

Do you have all the built events?

frigid nexus
#

but only get the on_pre_player_mined_item triggered

frigid nexus
warped hill
#

just to clarify, what do you mean by upgrade

#

is it a player fast replacing an entity, or a bot fulfilling an order

frigid nexus
#

like you can upgrade a normal inserter, with a fast-inserter

warped hill
#

so fast replacing, got it

#

that normally does fire both mined and build events

storm birch
#

I do recommend listening to all build events anyways:

on_built_entity
on_robot_built_entity
on_space_platform_built_entity
script_raised_built

With on_entity_cloned if you want to be fully thorough
It has a slightly different format for the EventData making it harder to slot in

frigid nexus
#

I do on_built_entity and on_robot_built_entity. I am upadating this mod from 1.0 so i've yet to add space platform

storm birch
#

Have you possibly not updated the code to the new EventData format?

#

I know they changed the created_entity field to just be entity

frigid nexus
#

No it appears to all work

#

and i do get the mined event, just not the subsiquent build event

storm birch
#

Then I have no clue what's happening
Because it should be working

I'm working with very little context here so 🤷

frigid nexus
#

What would help?

storm birch
#

A copy of the not working mod, but honestly I don't have the energy to put that much effort into trying to debug what's happening

#

I hang out in the help channel for things that seem easy to solve 😅
It's my day off and I'm only lightly participating

frigid nexus
#

fair enough. I tried scouring the docs for info on the replace events / what it triggers, but couldn't find anything

storm birch
#

It really should just be a mined event and a built event afaik

#

The specific events being based on which entity did the upgrading of course

fickle olive
#

Maybe you're redefining the same event somewhere else?

frigid nexus
#

i don't think so? unless another mod is hyjacking it

frigid nexus
#
script.on_event(defines.events.on_built_entity, on_double_inserter_built, filters_on_built)
script.on_event(defines.events.on_robot_built_entity, on_double_inserter_built, filters_on_built )
script.on_event({defines.events.script_raised_built, defines.events.script_raised_revive, defines.events.on_entity_cloned}, on_double_inserter_built)

script.on_event(defines.events.on_pre_player_mined_item, on_double_inserter_mined, filters_on_mined )
script.on_event(defines.events.on_robot_pre_mined, on_double_inserter_mined, filters_on_mined )
script.on_event(defines.events.on_entity_died, function(event) on_double_inserter_mined(event, true) end, filters_on_mined )
script.on_event(defines.events.script_raised_destroy, on_double_inserter_mined)

script.on_event(defines.events.on_player_rotated_entity, on_double_inserter_rotated)
#

This is what i have defined

storm birch
#

What's the filters_on_built?

frigid nexus
#
local filters_on_built = {{ filter="type", type="inserter" }}
local filters_on_mined = {{ filter="type", type="inserter" }}
storm birch
#

Yeah okay I don't know why that would be causing you issues then