Hard Light Productions Forums

Modding, Mission Design, and Coding => The Modding Workshop => Topic started by: T-Man on September 12, 2010, 04:14:47 pm

Title: Struggling with tbms. Can anyone help?
Post by: T-Man on September 12, 2010, 04:14:47 pm
Was hoping those of you with .tbm experience might be able to help me out for a minute;

I'm trying to create as an experiment a small mini-mod that runs off of the newer FSPort, and when active makes modifications to Port's ship.tbl using a .tbm file (Sol0-shp.tbm, which contains only a #ship entries section with entires and an #end tag). It mostly moves around the order of ships on the list and gives them new tech descriptions (using +nocreate where applicable), but also renames a few (by making copied entries under the new name; I left the old entries in too to try and ensure compatibility) and changes the loadout options or turret weapons on ships. I set it up in its own folder with a mod.ini that sets the following multimod entries:

primarylist = fsport_mediavps;
secondarylist = fsport,mediavps_3612;


Alas, when I try to run the mod I get no errors, but my changes seem to be ignored by the system and it uses the normal FSPort ships order and loadouts.

I have an understanding of .tbl coding and was using the .tbm wiki article and other mod's tbms as examples, so I'm feeling confident that its not a problem in the file (though perhaps i'm wrong) and suspect I've either missed a step in the tbm process or my multi mod settings above are wrongly orderd.

Can anyone see or think where I've goofed (knowing me its probably something blindingly obvious :lol:)? I'd appreciate any help.

Cheers
Title: Re: Struggling with tbms. Can anyone help?
Post by: FUBAR-BDHR on September 12, 2010, 05:04:31 pm
.tbm files do not change the order things are loaded in.  Table entries will always appear first followed by .tbm entries determined by load hierarchy. 

As for renaming ships why not just use alt name (or alt class or whatever that is) in the mission?
Title: Re: Struggling with tbms. Can anyone help?
Post by: T-Man on September 12, 2010, 05:38:31 pm
.tbm files do not change the order things are loaded in.  Table entries will always appear first followed by .tbm entries determined by load hierarchy.  
I'm afraid you've lost me a bit there. What i want to change is the order the ships are listed in the tech room database or in FRED (so the Faustus for example appears lower down on the list, and so new entries can be between existing ones if they are arranged such in the tbm). Is that what you mean? If that's the case then i'll probably need to have a whole table file instead of a tbm in the campaign.

Quote
As for renaming ships why not just use alt name (or alt class or whatever that is) in the mission?
Because i wanted the different name to appear on entries in the tech room (for example, i wanted to call the Medical Faustus "GTM Deadelus", which if i remember right Dark had its name as on his website when he made the model).
Title: Re: Struggling with tbms. Can anyone help?
Post by: FUBAR-BDHR on September 12, 2010, 05:53:15 pm
You cannot change the order they appear in FRED or the tech room without making your own table.  That order is determined by the order ships are loaded.  ships.tbl first then .tbm files so .tbm entries always appear either in the place of the original ship if it's a replacement or at then end if it's a new entry. 
Title: Re: Struggling with tbms. Can anyone help?
Post by: headdie on September 12, 2010, 06:46:14 pm
.tbm files do not change the order things are loaded in.  Table entries will always appear first followed by .tbm entries determined by load hierarchy.  
I'm afraid you've lost me a bit there. What i want to change is the order the ships are listed in the tech room database or in FRED (so the Faustus for example appears lower down on the list, and so new entries can be between existing ones if they are arranged such in the tbm). Is that what you mean? If that's the case then i'll probably need to have a whole table file instead of a tbm in the campaign.

Quote
As for renaming ships why not just use alt name (or alt class or whatever that is) in the mission?
Because i wanted the different name to appear on entries in the tech room (for example, i wanted to call the Medical Faustus "GTM Deadelus", which if i remember right Dark had its name as on his website when he made the model).

If all you are doing is changing the name for the ship class in mission then you need to be doing what FUBAR-BDHR is trying to get at which is instead of using tbl/tbm what you want to do is place a Medical Faustus into your mission in FRED-> double click the ship to bring up the ship editor -> click the alt ship class button under the assist %, and player ship controls and use that editor to set up the alternative class in mission.

If it's critical to get the tech room entry and that it is in a certain position then you need to
1- create your own mod folder (\Freespace 2\T-Mans Port Mod\data\tables),
2- copy port's ship table into the tables folder your new mod folder,
3- add a mod.ini to the "T-Mans Port Mod" folder.  
4- the Mod.ini needs to reference port (the game will follow port's mod.ini to load the MVP/PortMVP folders if I remember correctly, if not then add them).  
5- Now you can edit the copy of the ships table in your mod folder to your hearts content inserting the new ship between the ships you want it to show up between without risking directly braking port or another mod that refers to port.  

the new table file will override port's table but only when your new mod is selected as the mod in the games launcher.  

I strongly suggest leaving all port files alone as this method requires no editing of any files within the port/portMVP mod folders and the team will probably not thank you if you come to them with a problem down the line and it turns out to be directly or indirectly due to your modification of their files.
Title: Re: Struggling with tbms. Can anyone help?
Post by: Vengence on September 12, 2010, 06:52:22 pm
I don't mean to hijack but I have a question about TBMs too that is slightly related to this... only slightly. You can ignore this if you wish but I just wanted to shout it out.

I wanted to add a ship to the existing MediaVP 3.6.12 mod using a TBM, copied and pasted a brand new ship entry, but it didn't appear in the game. When I edited the tbl it did enter the game as expected. I kinda wanted to use a TBM to simply insert the model for viewing and observation purposes without having to deal with a bloated ship.tbl file. Is there something I need to do to insert a ship model using tbm that I am missing?
Title: Re: Struggling with tbms. Can anyone help?
Post by: The E on September 12, 2010, 07:07:04 pm
As always in these matters, it would help greatly if you would post that tbm.
Title: Re: Struggling with tbms. Can anyone help?
Post by: headdie on September 12, 2010, 07:19:07 pm
general advice would be if you want to add a new ship your best way to do it would be to create a mod folder structure like I recommended to T-man but also add a models and maps folder.

(http://www.mediafire.com/imgbnc.php/6c38bd6d34a5a9dd243aff981639e5c62g.jpg) (http://www.mediafire.com/imageview.php?quickkey=toibuv5fscfg61k&thumb=5)
you want the folders highlighted in green above present (ignore the text files)

put any new texture files in the maps folder, the new model into the models folder but instead of copying any ship tables you create a tbm for your new ship in the tables folder.  when you create of copy the mod.ini just have it referencing the version of MediaVPs to keep complications down (Though I suggest not bothering with referencing Media Vps to begin with to minimise complications and add them once you know it works).  in your launcher select your new mod and you should be good to go, remember to use a debug build of the .exe to catch any errors. you can find the log in freespace 2\data, often times just looking through the log will tell you where you need to look to fix a problem.

when creating the -shp.tbm file you need #Ship Classes at the start of the file and it needs to finish with #end
Title: Re: Struggling with tbms. Can anyone help?
Post by: Vengence on September 12, 2010, 11:31:32 pm
As always in these matters, it would help greatly if you would post that tbm.

u...uhh... nevermind... I checked my files again and it appears my problems were naught... Sorry for the messup...
Title: Re: Struggling with tbms. Can anyone help?
Post by: T-Man on September 13, 2010, 03:18:48 am
As always in these matters, it would help greatly if you would post that tbm.
Here it is, though i think FUBAR-BDHR has hit the nail on the head of the problem pretty much; sounds like tbms can't do all i thought they could (i did wonder why the new BP ships were ordered a little oddly, Karuna being miles away from the other UEF ships etc). Making it a full tbl as Headdie suggested should work, i just thought i'd give tbm's a go to try and reduce clutter. Sorry for the confusion people.

EDIT: Uh? why's the file tbm.tbm? I was changing the file type not adding to the name. Corrected. Bloody Vista. :lol:

[attachment deleted by admin]