Some background information first. We recently put in a system for players to build their own ships, similar to the LotJ way in that you create a ship frame from a blueprint and then finish it by adding ship parts, such as hull pieces. We're going a slightly different route though, in that the only parts needed are for the hull, and all other stats are left at 0, then are set based on installed modules. This will allow the players more freedom to mix and match stuff to suit their needs as far as what they want a ship for.
Now the way I've been designing everything is that we have a "module" item, and, depending on how the various object value #'s are set on it, determines what type of module it is, and how much it affects the ships stats. Having gotten to the point where I can pretty much begin putting the various functions in place to handle all of this I've come upon a bit of a stumbling block on my road to modularized ship goodness. How, after a module is installed, and the actual module object is removed from the players inventory, do I keep track of what modules the ship has, and how much they're affecting the stats they modify?
I COULD simply make it so that the objects are simply set as invisible and are reset in a room in the ship, like the engine room. I don't particularly like that method though. So then I thought, why not a new data structure, module_data, that stores the various object values needed, as well as a pointer to the ship it's installed in. The ship would of course have a pointer to the modules that are installed in it as well.
So I went poking around in the code and it seems to me that I'd need to use the CREATE, LINK, UNLINK and DISPOSE(?) macros in order to keep the various module stats saved so that things like modules being damaged in combat, and therefore changing how much they affect the ship they're installed in, are possible.
So, do I actually need to use those macros in order to get this working or is there another way I can save the stats somehow so damage or removal of the modules can affect the ship? And if I do, how exactly would I go about it? Can't quite get my brain wrapped around how that stuff is working from looking at the code...