Best way to add notes that can persist through blueprints
Posted: Wed Jan 25, 2017 6:31 pm
StickyNotes is a great mod, but I really want to be able to annotate my combinators with notes, and have those notes persist through blueprint creation/deployment. Since StickyNotes uses a global table to link entities to notes, it cannot know where to put the notes when a blueprint is placed, since a newly-placed entity has no reference to the original annotated entity.
So far my best idea is:
Create an invisible non-operable entity based on constant-combinator;
When the user wants to create a note, the text is encoded in the contents of the invisible combinator. 4 bytes per signal*15 slots is enough characters for me, and signal types can add a few more bits to each slot. The invisible combinator is placed at the same coordinates as the entity to be annotated;
When a blueprint is made the invisible note should come with it by virtue of it's location;
When entities are created/destroyed the corresponding note entity if it exists is shown/destroyed/etc.
Can someone tell me that this is crazy and there's a simpler solution? I'm new to modding factorio, so I'm hoping I overlooked a more sane approach. Or else, if there's something about my approach that won't work.
So far my best idea is:
Create an invisible non-operable entity based on constant-combinator;
When the user wants to create a note, the text is encoded in the contents of the invisible combinator. 4 bytes per signal*15 slots is enough characters for me, and signal types can add a few more bits to each slot. The invisible combinator is placed at the same coordinates as the entity to be annotated;
When a blueprint is made the invisible note should come with it by virtue of it's location;
When entities are created/destroyed the corresponding note entity if it exists is shown/destroyed/etc.
Can someone tell me that this is crazy and there's a simpler solution? I'm new to modding factorio, so I'm hoping I overlooked a more sane approach. Or else, if there's something about my approach that won't work.