add information to event for fast_replace of entities

Place to ask discuss and request the modding support of Factorio. Don't request mods here.
Post Reply
Jaren Taq
Burner Inserter
Burner Inserter
Posts: 7
Joined: Sat Nov 28, 2020 8:26 am
Contact:

add information to event for fast_replace of entities

Post by Jaren Taq »

Hello,

is it possible to add information to the event table, if an entity is up-/downgraded/fast-replaced?
Something like this:

Code: Select all

-- in on_destroy
event.reason = "fast_replace"
-- in on_create
event.replaced_unit_number = old_entity.unit_number
With this information custom entities, e.g. based on simple-entity-with-*, which store additional information in a global table based on their unit_number can be handled without heuristics based on tick, position and surface.

Thanks,
Jaren

User avatar
Muppet9010
Filter Inserter
Filter Inserter
Posts: 278
Joined: Sat Dec 09, 2017 6:01 pm
Contact:

Re: add information to event for fast_replace of entities

Post by Muppet9010 »

+1
Hit a similar sounding scenario where I use simple-entity-with-force as the player interaction entity, and a bunch of mod placed entities and mod global data around them.
Have to use the pre_build and match up positions and (hopefully correct) player surface against mod global data to detect a fast_upgrade affecting mining and building events.

Post Reply

Return to “Modding interface requests”