Page 1 of 1

Storage and copy/paste

Posted: Thu Dec 12, 2024 4:11 am
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?

Re: Storage and copy/paste

Posted: Thu Dec 12, 2024 8:33 am
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

Re: Storage and copy/paste

Posted: Thu Dec 12, 2024 11:12 pm
by wizmut
Appreciate the feedback!