Storage and copy/paste

Place to get help with not working mods / modding interface.
wizmut
Burner Inserter
Burner Inserter
Posts: 7
Joined: Fri Apr 26, 2019 3:46 am
Contact:

Storage and copy/paste

Post by wizmut »

Right now I have some custom entities that use filters. The filters don't exist as part of any normal prototype's behavior. They're set by a custom GUI and indicated by manually drawing a sprite. The state of each filter is tracked in storage.my_cool_entity_filters[my_entity.unit_number] . And there are other custom variables in storage, associated with various custom entities.

This method of storing entity info doesn't cooperate with copy/paste, or blueprints, or shift-right-click. And there's probably other ways entity info is copied that I'm forgetting.

Is there a natural way to store custom status info about an entity? I can see LuaEntity has custom_status but that seems clunky, and it displays the info to the player. What do people use?
Natha
Fast Inserter
Fast Inserter
Posts: 229
Joined: Sun Mar 15, 2015 1:48 pm
Contact:

Re: Storage and copy/paste

Post by Natha »

Paste is an event that you can use.
Blueprints can store tags in their entities which can be accessed in the built event
Shift-right can be assigned a custom input event
wizmut
Burner Inserter
Burner Inserter
Posts: 7
Joined: Fri Apr 26, 2019 3:46 am
Contact:

Re: Storage and copy/paste

Post by wizmut »

Appreciate the feedback!
Post Reply

Return to “Modding help”