#the mine events and then the build
1 messages · Page 1 of 1 (latest)
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
Do you have all the built events?
but only get the on_pre_player_mined_item triggered
which ones does the upgrade functionality use?
just to clarify, what do you mean by upgrade
is it a player fast replacing an entity, or a bot fulfilling an order
like you can upgrade a normal inserter, with a fast-inserter
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
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
Have you possibly not updated the code to the new EventData format?
I know they changed the created_entity field to just be entity
No it appears to all work
and i do get the mined event, just not the subsiquent build event
Then I have no clue what's happening
Because it should be working
I'm working with very little context here so 🤷
What would help?
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
fair enough. I tried scouring the docs for info on the replace events / what it triggers, but couldn't find anything
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
Maybe you're redefining the same event somewhere else?
i don't think so? unless another mod is hyjacking it
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
What's the filters_on_built?
local filters_on_built = {{ filter="type", type="inserter" }}
local filters_on_mined = {{ filter="type", type="inserter" }}
Yeah okay I don't know why that would be causing you issues then