Custom Data
Posted: Sat Jul 23, 2016 12:30 am
I am trying to add custom data to a particular prototype, so as to carry extra data. It also needs to support multiple mods, for it to work properly.
Approach one is to use a Remote Interface to build a table. However, while it works, I have no idea how to handle mod updates or mod removal. In those cases, the table will no longer be accurate, and unlike data, doesn't get rebuilt. I am unsure how to properly detect and rebuild it correctly, which means it will end up stacking multiple copies of stuff or have entries that should be removed left behind.
Approach two is to use a prototype to carry the information. Since data is global between mods, and easily overwritten, it should work better. However, since you can't just add extra data to prototypes, I would need a dummy prototype which carries this information. It should be possible to, on game load, find all such dummy prototypes and load them into a table to be used. However, I would need a prototype that I can access the proper information for it to work.
Any mod that already handles this kind of problem would be helpful. I looked at treefarm, but I can't figure out how it de-registers or handles updates.
Approach one is to use a Remote Interface to build a table. However, while it works, I have no idea how to handle mod updates or mod removal. In those cases, the table will no longer be accurate, and unlike data, doesn't get rebuilt. I am unsure how to properly detect and rebuild it correctly, which means it will end up stacking multiple copies of stuff or have entries that should be removed left behind.
Approach two is to use a prototype to carry the information. Since data is global between mods, and easily overwritten, it should work better. However, since you can't just add extra data to prototypes, I would need a dummy prototype which carries this information. It should be possible to, on game load, find all such dummy prototypes and load them into a table to be used. However, I would need a prototype that I can access the proper information for it to work.
Any mod that already handles this kind of problem would be helpful. I looked at treefarm, but I can't figure out how it de-registers or handles updates.