From working on my mainhalls, I've obviously been doing a lot with the mainhall.tbl. Currently I have 4 working mainhalls with several more on the way. Ideally, I'd be able to release them as a simple drag and drop VP file.. one for each mainhall. The problem is that the mainhall.tbl isn't modular so that makes it much harder to people to add new mainhalls to any given mod. I'm pretty sure I've had passing discussions about this with various coders, but it's been so long that I can't remember who or what was said. So, I wanted to type out my thoughts on how this might work and see what is or isn't possible from the coders... and hopefully find someone who is willing to try and make it happen (probably after .14 is out).
So, the mainhall table is index based starting with 0 and going up to X (There is a limit to the number of mainhalls that can be loaded and I don't know it off the top of my head). My guess is that is going to be the first hurdle. How do you have FSO organize the indexes without breaking retail while still using modular tables? A solution I thought of was using an optional +Index flag (Required in TBMs but not in TBLs?). Basically, the TBL would parse first and those mainhalls be indexed like normal. Then TBMs are parsed and the mainhalls added to the index number specified. You could use this to override mainhalls in the TBL if necessary. If an index is skipped, the engine should pop up a warning. Then also, an '+Index: -1' (or no +Index?) simply adds the new mainhall from the TBM into the next available Index.
The other hurdle is the mainhall limit. I don't think the limit needs to be removed or extended.. I'm pretty sure that it's high enough that no mod should ever go over it. But the question is, what should FSO do if it encounters enough TBMs that pushes the limit? I'd say throw up a Warning and drop the last mainhall until it's back under the index.EDIT: Looks like the limit is 10. So perhaps bumping that to something like 20 or 25?
Mainhalls are referenced in campaign files by index number so it seems that the challenge is to get FSO to load mainhalls from a tbm and order them into the same index structure.
The way the mainhall.tbl works.. it seems
like the work involved should be similar to ships and weapons tables where it's mostly about adding new entries to the end of the list and the rest of the flags are only important for each individual entry. Except that the mainhalls probably affect a much smaller portion of the engine.
Am I forgetting something? What are some thoughts here? Are there issues I don't know about? Or is there a better way of doing this?
EDIT: Here is an example mainhall.tbl for those not familiar with what it looks like.