Hard Light Productions Forums

Modding, Mission Design, and Coding => FS2 Open Coding - The Source Code Project (SCP) => Topic started by: asyikarea51 on March 17, 2008, 10:52:04 am

Title: Ship templating
Post by: asyikarea51 on March 17, 2008, 10:52:04 am
While writing up the tables for something I'm working on, I looked up ship templates, since I have a ship that can make use of this feature. At the same time I implemented the Artemis template as sort of a "bugfix", looked handy to me since it'll also -1 to ship limit, but I go in-game and see no entries at all in both the Lab and in the F3 viewer (apart from some SC Cain in the Terran species slot, don't know where it came from).

Is something potentially wrong with my table, or do I need to wait for 3.7 to be able to make use of this feature? Or is there a test build that I can use for the time being? (And I just saved the table too, oh well... but it shouldn't take too long to copy-paste the old entries from the backup document in any case...)

side notes: I haven't actually done the templating for the ship I wanted to do it on. I only did the Artemis one and fired up the game, my copy-pasted entries should match retail except for speeds and handling, as well as $Shield_icon, $Ship_icon, $Ship_anim and $Ship_overhead commented out (will be using the SCP's integrated ones), so I'm very sure that's not the source of the problem. Another thing to note is that debug builds throw up no errors related to ships.tbl...
Title: Re: Ship templating
Post by: Wanderer on March 17, 2008, 11:23:05 am
For errors with new builds.. Check you fs2_open.log file in main data directory.

As for the ship template feature... I can't really say that i would know if and how it works
Title: Re: Ship templating
Post by: asyikarea51 on March 17, 2008, 11:35:02 am
Wow, I am so not viewing that logfile with vanilla Notepad, :lol:. Still scrolling through it with something that can recognise individual lines as at the time of typing.

Thing is though, I get no crashing whatsoever, just a blank Techroom (that goes for the F3 ship viewer too). That SC Cain issue I mentioned can be safely ignored too...
Title: Re: Ship templating
Post by: Wanderer on March 17, 2008, 01:38:05 pm
Yeah.. its notepad killer - just use something better than notepad (ie. wordpad, crimson edit, aranea, notepad++, etc. etc.)
Title: Re: Ship templating
Post by: asyikarea51 on March 17, 2008, 02:18:01 pm
Update, couldn't really find anything interesting in the log, plus it always gets overwritten each time I start the game. Then again I can barely keep my eyes open...

Decided to just comment out the entire Artemis template entry (even the #Ship Templates and #End tags) as well as the edited Artemis entries in the #Ship Classes section. Now I can see all my ships again except for the two bombers, obviously.

Any ideas, or should I revert back to two separate ships and somehow hold off on 3.7 for the time being? :nervous:

(goes to read wiki on ship-copy)
Title: Re: Ship templating
Post by: Turey on March 19, 2008, 11:29:57 pm
Last I know the feature worked fine.
Title: Re: Ship templating
Post by: asyikarea51 on March 20, 2008, 08:05:03 am
I have no idea how to get ship-copy working. The wiki description is vague, and it doesn't say anything about specifying the ship to copy from.

What build were you using for the ship templates, Turey? Not that it matters, but since you say the feature worked fine the last time you checked, I might want to try again at the end of the week... though FTTB I reset my tables again since I'm doing cleanup.
Title: Re: Ship templating
Post by: Turey on March 21, 2008, 01:49:54 am
I'm just using a generic HEAD build.

Here's a ships.tbl with the artemis templated. Please note that this doesn't actually save a slot on the shiplist, as each ship using a template becomes its own ship upon load.

EDIT: Note that you need to do a Ctrl-Shift-S in tech room to see Artemis.

[attachment deleted by ninja]
Title: Re: Ship templating
Post by: asyikarea51 on March 21, 2008, 02:14:52 am
HEAD build? Those builds in the Recent builds section, or builds taken directly from the source code?

Yeah, that, or the F3 viewer.

Admittedly if it doesn't really save a ship slot then it gives me less of a reason to use it, but I'll have a look later tonight, see how it's done since it makes the tables cleaner. Thanks though. :)
Title: Re: Ship templating
Post by: Zacam on March 21, 2008, 10:50:55 pm
By not saving a ship "slot" it's usage doesn't count against the ships limit. And you can do a lot with ship variation to spice things up.
Title: Re: Ship templating
Post by: asyikarea51 on March 22, 2008, 08:46:33 am
*Is :confused: between Turey's and Zacam's posts*

Temporarily put Turey's supplied table into my mod directory - well, it's a build issue now. It's either I source out a HEAD build for myself, or carry on with 3.6.9/10... :)
Title: Re: Ship templating
Post by: Zacam on March 22, 2008, 01:52:32 pm
FSO (non-inferno builds) has a max number of ships that can be "slotted" in the tables before it stops adding ships. I think it's 130 ship objects that can be defined in the ships.tbl.

I could be completly mis-understanding what this does, but it will allow variations (Ex: Artemis D.H.) to base off the regular Artemis but with a different load out and texture. (Even a different POF? Have not fully looked into this or read the wiki yet) and it would do this without counting agansit the total limit.
Title: Re: Ship templating
Post by: asyikarea51 on March 23, 2008, 05:12:42 am
I thought Inferno builds had a limit too, only raised to ~200? Or have we gone dynamic already? :nervous:

I think I'm confused when the word 'save' is used :lol:. I figure if I could cut down the number of used ship slots as much as possible, then whatever I'm doing wouldn't need an Inferno build (If I finish it, that is. :nervous:).

If ship templating isn't a solution then it doesn't give me much of a reason to use it, although it does make for easy variations without copy pasting everything and making it harder to skim through. (I only commented out the entries from my table anyway, so if a build comes out that has templating enabled, I can just uncomment and use the new system immediately...)

meh... tried to compile a build myself but I got TrackIR errors, and there's no way to get the SDK. Oh well, doesn't matter, I'll just carry on. :)
Title: Re: Ship templating
Post by: Backslash on March 23, 2008, 11:53:30 pm
Try adding code\io\trackir.cpp and code\io\trackir.h to your project.  Or just update your project files from the SVN (provided you use a compiler that uses one of the project file types updated this month ;))

Really, if it doesn't work with this build (http://www.hard-light.net/forums/index.php/topic,52856.0.html) it should be Mantised.

Yeah I got confused in that discussion too.  I've been meaning to try templates but haven't gotten around to it, so thanks Turey.  I'll try that example sometime this week.
Title: Re: Ship templating
Post by: asyikarea51 on March 24, 2008, 01:05:42 am
Yeap, a total n00b at all this coding business even though I can compile the supplied project files (like, err, a matter of clicking? :lol:). I didn't know which branch to select though (based on the program selection, it's definitely not HEAD, it compiles 3.6.9 debug builds)... but I'll have a look at SVN again.

(VC6 asked for some password or somesuch, got stuck and tried compiling in VC2005 instead.)

EDIT: G5K's supplied Trunk build isn't working with it either. The entire Techroom and F3 viewer just goes blank. I'll use Turey's tables, check two, three times before I Mantis it, just to be sure.

EDIT2: Nevermind, looking at VC2005, I think I get what you mean by adding the code files to the project. I'll get around to it when I can. Thanks. :)
Title: Re: Ship templating
Post by: Turey on March 31, 2008, 06:36:16 pm
Zacam is wrong, with the table I provided, Artemis and Artemis D.H. take up two different ship slots.
Title: Re: Ship templating
Post by: Zacam on March 31, 2008, 06:49:14 pm
Well., they do anyway, right?

The question is, does it take up a ship slot if the DH is not used in a mission but another ship is?
Title: Re: Ship templating
Post by: karajorma on April 01, 2008, 02:26:08 am
Ship slots are assigned when the game starts, not when missions load.
Title: Re: Ship templating
Post by: Galemp on April 01, 2008, 02:33:23 pm
On this topic, I'd really like to see a method of texture swapping for the POF in here instead of a full-blown POF swapping.

Suppose you had an HOL variant of the Seth with a black reskin, but you wanted to preserve the POF file reference in case an HTL Seth came along sometime in the future. Can we use the texture replacement code here?
Title: Re: Ship templating
Post by: taylor on April 01, 2008, 04:05:53 pm
Suppose you had an HOL variant of the Seth with a black reskin, but you wanted to preserve the POF file reference in case an HTL Seth came along sometime in the future. Can we use the texture replacement code here?
I coded that up last summer.  It's only in my Xt builds at the moment though.
Title: Re: Ship templating
Post by: Galemp on April 01, 2008, 08:36:49 pm
I oughta look around the Recent Builds subforum a bit more then. Be sure to post a sample table entry so we know how to get it to work, please.
Title: Re: Ship templating
Post by: taylor on April 03, 2008, 10:28:27 pm
I oughta look around the Recent Builds subforum a bit more then. Be sure to post a sample table entry so we know how to get it to work, please.
The 10/28 build in the recent builds forum should have it, but that's the latest Xt-based build that was publicly announced.

As far as using it goes, it's exactly the same as using it in the mission file.  For instance, I use this tbm to have different textures on the Leviathan and Lilith:

Code: [Select]
#Ship Classes

$Name:      GTC Leviathan
+nocreate
$Texture Replace:
+old: fenris-htl
+new: levy-htl

$Name:      SC Lilith
+nocreate
$Texture Replace:
+old: cruiser03-03a
+new: cruiser03x-03a
+old: cruiser03-01a
+new: cruiser03x-01a

#End

And that's it.  It will use the same POFs, just change the textures.  And you can still use texture replacement in a mission as normal too.  It will just get added to the top of anything you specify in the ship entries.
Title: Re: Ship templating
Post by: Galemp on April 04, 2008, 08:20:02 pm
None of the builds I've tried (up to the end of March) support this feature. Not the 10/28 build, not Goober's trunk build, not WMC's 3/23 build.

All of them end up with an empty techroom and an empty Ship lab.
Title: Re: Ship templating
Post by: taylor on April 04, 2008, 09:28:47 pm
It has to be a Xt build, so neither Goober's nor WMC's builds would have that code.  The 10/28 build should have worked though, assuming that you used the right one (http://www.hard-light.net/forums/index.php/topic,50258.msg1015671.html#msg1015671).
Title: Re: Ship templating
Post by: Galemp on April 05, 2008, 04:32:41 pm
Nope, nothing. I tried the build you posted this weekend, and even tried a new ships.tbl consisting exclusively of the data on the Wiki (http://www.hard-light.net/wiki/index.php/Ship_Templates), and I get no ships anywhere. This is really frustrating. I don't know what I can give you to help.
Title: Re: Ship templating
Post by: taylor on April 06, 2008, 09:18:37 pm
I haven't released a new Xt build since the 3/14 one.  All the ones that I've released since are just standard builds.  If you can't get it working with an Xt build (and you'll know it's an Xt build because I'll say so in the thread where you download it or it will have "Xt" in the filename) then just wait a while until I release a new public Xt build and try that one out.  I know that it works though, since my personal mediavps are modified to use it exclusively and they work fine, so it must be something on your end.