Hard Light Productions Forums

Modding, Mission Design, and Coding => FS2 Open Coding - The Source Code Project (SCP) => Topic started by: Solatar on November 24, 2002, 11:31:26 am

Title: Tech room question
Post by: Solatar on November 24, 2002, 11:31:26 am
We all know that it is hard to make whatever ships you want to be in the tech Room actually appear. This is because fs2 says "entry # 1", "entry #2", not GTF Ulysses, GTF Hercules.

Could we change this so that it WOULD say GTF Hercules, or GTF whatever?
Title: Tech room question
Post by: Goober5000 on November 24, 2002, 01:11:55 pm
:wtf: It's not supposed to do that.

Make sure you actually added the ships using either the "in tech database" flag or add-ship SEXP.
Title: Tech room question
Post by: Sesquipedalian on November 24, 2002, 01:47:13 pm
It does do that.  Hades has it right.  And it sucks.  Name based tech room listing instead of entry number based would be marvellous.  This ought not to be too hard to fix, since the tech-add-ship sexp IS name based, and the code could likely be lifted from there.
Title: Tech room question
Post by: Solatar on November 24, 2002, 04:09:31 pm
I Have it, but I have to delete all my pilots, then exit the game with shift-esc. Then restart, and create a new pilot. Then my ships are there.
Title: Tech room question
Post by: aldo_14 on November 24, 2002, 04:42:05 pm
Um.. list by 'in-tech-database' flag, surely?
Title: Tech room question
Post by: Solatar on November 24, 2002, 04:44:46 pm
That barely EVER works.
Title: Tech room question
Post by: Sesquipedalian on November 24, 2002, 09:50:25 pm
Actually, in-tech-database never works.  It appears that the plan, or possibly even the original code, was to use that flag, but in the end the values used were simply numerical.  Makes sense, really, when one has a set ships.tbl like V did: much easier to code.  But changing this would be good for us now that we have mods.

Reinstituting the flag could work, but it doesn't provide much flexibility.  Ships are either in or out that way.  If you want to be able to add a new ship part way through a campaign, the system has to be more complex than mere flags.
Title: Tech room question
Post by: Goober5000 on November 24, 2002, 09:57:51 pm
I think it's possible to add ships to the tech database reliably.  I've seen campaigns do this:

when
--true
--tech-add-ship
----

in the very first mission of the campaign.  Then the tech room works properly.

Hades, am I to understand that you tried this and it didn't work?
Title: Tech room question
Post by: Sesquipedalian on November 24, 2002, 10:07:22 pm
Yes, but if a ship is removed, it messes up all the ship entries that came after it because the tech room's decision to display or not to display a ship is based on entry number, not on name.  The fact that this isn't true of tech-add-ships holds out hope that this could be changed so that the tech database could work without headaches.
Title: Tech room question
Post by: aldo_14 on November 25, 2002, 04:06:17 am
Actually, um, Sesqs previosu statement implied selecting the ship to be added based on it's name trather than the flag...that's what i meant.

IIRC, the ships shown are dependant on their order in the table... but I think 'in tech database' wiorks uif they ship is after the V entires.  Unfortunately, the thrusterglows seem to default to the Terran one , regarless of species, for some reason......
Title: Tech room question
Post by: IPAndrews on November 25, 2002, 06:37:21 am
Wow. This part of the source code really sucks doesn't it. Well, you can't have everything, I guess.
Title: Tech room question
Post by: aldo_14 on November 25, 2002, 10:11:38 am
If it's parsed in during the start, then there must be a line that goes something like;

if current_entry==#sumenumberyouwant#
add to techroom

(or soforth..i think it;s a recursive algorithm to parse the ships)

so just replace it with something like

if current_entry has flag "in-tech-database"
add to techroom

or soforth.

Someone tell me where the specific ships.tbl parsing code is, and I'll have a peek tonight.

can;t actually compile anything, though... bloody inefficient 4th years hogging the VStudie disks,mumble,grumble
Title: Tech room question
Post by: Goober5000 on March 02, 2003, 02:40:56 am
Sorry to bump this, but I'm trying to nail this bug.  Can someone post a screenshot of a messed up tech room?
Title: slight addition
Post by: miniDwarf on March 02, 2003, 04:42:14 am
if i'm getting this problem right, then could you also fix the kills list bug so it doesn't say you've destroyed 300  ares fighters etc etc...
Title: Tech room question
Post by: Goober5000 on March 02, 2003, 10:30:30 pm
Ugh.  Fixed it.


I'm not going to touch that 300 Ares bug, though. :)
Title: Tech room question
Post by: Sesquipedalian on March 03, 2003, 02:41:32 pm
Woot!