Best way to keep track of individual objects?
Posted: 28 Mar 2018, 14:08
Hi all, I've been working on a project based on OpenMW, and I'm wondering the best way to keep track of references that might travel between cells a lot.
I've been messing with AI schedules (engine side not script side), so the NPCs have been travelling to and fro cells a lot more than intended in Morrowind. Keeping track of them is tricky.
Ptrs seem to be the engines de facto way to reference individual objects, but those can easily become outdated when NPCs change cells.
There is a string ID look up, but that only works if that object is the ONLY object with that ID (so I couldn't reference a particular loaf of bread). Also it is slow performance wise
I might make my own sort of class, which I can register an object I want to keep track of, and it keeps track of the object's refnum and homecell (the original cell an object appears in seems to keep track of wherever that object ends up outside of the cell), which could likely be used to quickly find them wherever they end up (so I would call this class and it would make a nice updated ptr when I need it... the question is what to call it with)
but before I do that, was wondering everyone's opinion on the matter?
Thanks,
I've been messing with AI schedules (engine side not script side), so the NPCs have been travelling to and fro cells a lot more than intended in Morrowind. Keeping track of them is tricky.
Ptrs seem to be the engines de facto way to reference individual objects, but those can easily become outdated when NPCs change cells.
There is a string ID look up, but that only works if that object is the ONLY object with that ID (so I couldn't reference a particular loaf of bread). Also it is slow performance wise
I might make my own sort of class, which I can register an object I want to keep track of, and it keeps track of the object's refnum and homecell (the original cell an object appears in seems to keep track of wherever that object ends up outside of the cell), which could likely be used to quickly find them wherever they end up (so I would call this class and it would make a nice updated ptr when I need it... the question is what to call it with)
but before I do that, was wondering everyone's opinion on the matter?
Thanks,