Hard Light Productions Forums

Modding, Mission Design, and Coding => FS2 Open Coding - The Source Code Project (SCP) => Test Builds => Topic started by: WMCoolmon on May 25, 2004, 10:57:35 pm

Title: fs2_open_C05242004: Modular ships.tbl and weapons.tbl
Post by: WMCoolmon on May 25, 2004, 10:57:35 pm
Modular ships and weapons tables - especially useful for using multiple mods.

How they work:
Files are essentially the same as ships.tbl or weapons.tbl, except they can have any name and must end with "-shp.tbm" or "-wep.tbm". For example, "Inferno-shp.tbm".

However, each section(ie "#Engine Wash Info") is optional. Moreover, entries with the same name as previous entries in .tbl or other .tbm files will override previous entries' data. This means that if you were to add an entry of "GTF Ulysses" with the model of a Hercules, the Ulysses would show up as a Hercules.

Finally, any modular table files must be placed in data/tables. Enjoy. :)

ZIP file:
http://fs2source.warpcore.org/exes/latest/fs2_open_C05252004.zip

Note- I think module entries take backwards precedence due to replacement. So it goes: .tbm in VP -> .tbm in data/tables -> ships.tbl, with the VP being highest. This isn't (easily) possible without changing them to only add and not replace.
Title: fs2_open_C05242004: Modular ships.tbl and weapons.tbl
Post by: karajorma on May 26, 2004, 04:48:37 am
Wow. This is certainly a surprise.

*Get's out the sissors*
Title: fs2_open_C05242004: Modular ships.tbl and weapons.tbl
Post by: SadisticSid on May 26, 2004, 05:26:28 am
Do the tbms get loaded in alphabetical order? So zxxxx.tbm overrides anything in axxxx.tbm?
Title: fs2_open_C05242004: Modular ships.tbl and weapons.tbl
Post by: Lightspeed on May 26, 2004, 07:56:46 am
WOW.

This is something i've always wanted. Can't wait till all this and Bob's cool stuff make it into one build.
Title: fs2_open_C05242004: Modular ships.tbl and weapons.tbl
Post by: Fineus on May 26, 2004, 08:02:21 am
Agreed, it makes installation of single ships a hell of a lot easier. No more copying/pasting/sifting through stupidly large .tbl files to find the one piece of data you need. BRILLIANT.
Title: fs2_open_C05242004: Modular ships.tbl and weapons.tbl
Post by: SadisticSid on May 26, 2004, 08:14:00 am
Funny, when I suggested this a while ago it got poo-pood. :p

Indeed it's a great thing because it'll make error isolation so much easier, right now we have to rely on debug builds (which sometimes quit before they get to a table error and are fairly cranky to begin with) to point out where the errors occur. If it can isolate it to one or more smaller files then it'll cause much less of a headache.
Title: fs2_open_C05242004: Modular ships.tbl and weapons.tbl
Post by: Hellbender on May 26, 2004, 09:59:26 am
Does this affect the total number of table entries allowed?

Definitely good idea though!
Title: fs2_open_C05242004: Modular ships.tbl and weapons.tbl
Post by: kasperl on May 26, 2004, 12:24:50 pm
yeah, what does it do when it reaches 130 ship entry's?
Title: fs2_open_C05242004: Modular ships.tbl and weapons.tbl
Post by: WMCoolmon on May 26, 2004, 04:15:20 pm
Same thing as it did before; an assert is invoked. :)
Edit: Erm, for non-coders, this means ship/weapon/wash/etc limits are the same.

New build: (http://fs2source.warpcore.org/exes/latest/fs2_open_C05262004.zip)


Edit:
Quote
Do the tbms get loaded in alphabetical order? So zxxxx.tbm overrides anything in axxxx.tbm?

From this point on, no. They now load in reverse order, so that ship info will take precedence in the same way as other files
Title: fs2_open_C05242004: Modular ships.tbl and weapons.tbl
Post by: Goober5000 on May 26, 2004, 05:13:33 pm
Quote
Originally posted by SadisticSid
Funny, when I suggested this a while ago it got poo-pood. :p
I thought it would require a fundamental revision of the loading system.  Looks like WMCoolmon got it to work. :)
Title: fs2_open_C05242004: Modular ships.tbl and weapons.tbl
Post by: WMCoolmon on May 26, 2004, 05:29:14 pm
Okay, I uploaded a slightly newer version. One of my last changes broke the campaign room, no files would display.
Title: fs2_open_C05242004: Modular ships.tbl and weapons.tbl
Post by: CP5670 on May 26, 2004, 11:39:25 pm
This is an awesome enhancement and would make a number of things much easier. In fact, I think we may have to use it in the effects media vp.
Title: fs2_open_C05242004: Modular ships.tbl and weapons.tbl
Post by: Bobboau on May 26, 2004, 11:43:51 pm
can it be made so that the entirety of a table entry is optional, that way you could add a ships table that adds your new weapon to the alowed primaries of an exsisting ship or give them ab trails without altering any other important values that might be altered from defalt.
Title: fs2_open_C05242004: Modular ships.tbl and weapons.tbl
Post by: WMCoolmon on May 28, 2004, 01:29:20 am
If you have an hour or two available, you could do that. In that case, it might just be better to rewrite/add parse functions to include the string name and take a bool to determine whether the value is required or not.

ie
stuff_int(char* string, bool replace, int* value);

Edit: Actually...now that I think about it (again :p), you *might* be able to do this with some sloppy global work. Set a pointer if you replace an item, then set the parse options so if default is specified, it doesn't parse.
Parsing would take longer.
Title: fs2_open_C05242004: Modular ships.tbl and weapons.tbl
Post by: Bobboau on May 28, 2004, 01:44:20 am
yeah but parseing only happens during level load, people arn't going to notice a few milliseconds added on to a minute, and I've got my hands quite full at the moment, I keep thinking I've just about got my decals system working when right before I upload a new mysterius crash happens, and I don't know why!
Title: fs2_open_C05242004: Modular ships.tbl and weapons.tbl
Post by: J3Vr6 on May 28, 2004, 08:28:06 am
I guess people really like this...  To be honest, I really don't know enough about modding to know why I would need this.  But thanks!
Title: fs2_open_C05242004: Modular ships.tbl and weapons.tbl
Post by: karajorma on May 28, 2004, 11:21:45 am
With this we can finally have seperate tables for each modded fighter. Maybe even package up every fighter in a vp all of it's own.
Title: fs2_open_C05242004: Modular ships.tbl and weapons.tbl
Post by: Anaz on May 28, 2004, 04:25:35 pm
This is quite cool...especially for things like high-res effects, so you can delete the ones you don't need. So you could have HighSCP-efc.tbm, MedSCP-efc.tbm, etc... so that people will stop complaining (or will have an easier solution) when their box3s aren't l33t enough to run the really pretty stuff :p
Title: fs2_open_C05242004: Modular ships.tbl and weapons.tbl
Post by: Nuke on June 17, 2004, 10:15:12 pm
did this feature make 3.6? or is it just in an experimental stage at the moment? id like my mod to use this but i dont want to veer too far from 3.6
Title: fs2_open_C05242004: Modular ships.tbl and weapons.tbl
Post by: Bobboau on June 17, 2004, 10:44:49 pm
not in 3.6, new experimental feature like all of the new stuff
Title: fs2_open_C05242004: Modular ships.tbl and weapons.tbl
Post by: WMCoolmon on June 17, 2004, 11:56:14 pm
If you're making a small ship or weapons pack, I'd suggest using it just for convenience and mentioning that a specific build is needed.

For anything else it'd probably be less trouble to just use the old method.

Modular tables will almost for certain be in the next build. Although, I haven't added support for all of them...it can be pretty tedious.
Title: fs2_open_C05242004: Modular ships.tbl and weapons.tbl
Post by: Singh on June 18, 2004, 12:03:48 am
hmmmmm.......you mean that using this build.....I could use the ST ships.......and if I could get them, the SW ships, in the same mission without going through all the .tbl files??

suh-w33t :D
Title: fs2_open_C05242004: Modular ships.tbl and weapons.tbl
Post by: Nuke on June 18, 2004, 05:28:16 pm
i think its a good idea, just to keep my table files smaller.  will it work with all tables or just ship and weapons. i also use custom sound and explosions with some of my weapons so it would be awesome if the weapon_expl.tbl and sounds.tbl are also modular.

another idea (for multiplayer mainly) is to have missions with an allow custom ships option. any mission with the flag set would allow any ships and weapons in modular files will be added to the team loadout.

one more thing, will it work if its in a vp file?