Trek.exe Ship Slots (for 3D sfx)

Trek.exe Ship Slots; support/discussion/questions

Moderator: thunderchero

Post Reply
User avatar
Spocks-cuddly-tribble
Code Master
Code Master
Posts: 723
Joined: Sun Apr 27, 2008 2:00 am

Trek.exe Ship Slots (for 3D sfx)

Post by Spocks-cuddly-tribble » Sat Nov 05, 2011 8:23 am

A recent project forced me to look into the trek.exe ship slots. Maybe the info is of use for someone and the missing info can be added. :wink:


Increasing number of trek.exe ship slots:

Code: Select all

004A28AE                 mov     ecx, offset 5919FC // asm base address (not for TMP!)
004A28CA                 cmp     ebx, 49h // number of read slots (without TMP)
The whole data block can be moved to any location. Bytes needed = 0x30 * number of read slots(without TMP) -> vanilla 0xDB0 (0x30*0x49)


Optimizing usage of TMP slot:

The TMP slot is used for all ships missing on the list (it's unused in vanilla, maybe it was just a safeguard for testing purposes).

An example how to make use of it:

Say a mod uses 100 different ship designs (HOBs) with 50 of them being standard models with 8 phasers, norm scale & no special slots like damage spots.

Add only the 50 non-standard HOBs to the slot list (more shared slots = shorter list, means a faster code, but should be insignificant). Now just adjust number of read slots and edit the TMP slot for 8 phasers & standard scale and you're done.


Structure of the trek.exe ship slots: (length 0x30 each)

Code: Select all

+0x0 = name of Hob file
+0x4 = ??? most 1;  CS, TT, rom: Warbird HCII, YS & CalCryGoTaCho=0; defiant EdoGod=2; sovy=4, outpost=7, starbase=0,1, 3 or 4 
+0x8 = ??? most 0, some card fer kling rom & Gal-X Sovy Defiant = 1 
+0xC = number of weapon slots (phaser, plasma or Gomtuu effect)
+0x10 = plasma switch marker
+0x14 = number of damage spots -> for scar1.hob & explosions
+0x18 = special damage texture switch marker for starbases -> d*s_b.gif (a bit bugged)
+0x1C = exe scale
+0x20 = phaser/plasma slots (16 max) -> meaning of different default values?
Other trek.exe references wrt ship hob files:

- 0x17B158 (one for each empire, minors share fed entry) will be used if hob name read from shiplist.sst is not in stbof.res, stations & monster use Hs.hob [57D68C] (another safeguard for testing purposes)

- 0x1809A8 are used for the screensaver: (errors = crash)

Code: Select all

00501991                 mov     ecx, 46h // 70 hob files
0050199E                 mov     ecx, 47h // 71 -> next iteration
00501A08                 mov     ds:5966C8, 46h // 70 hob files
00501A1A                 mov     ebx, 47h // 71 -> next iteration
Some open questions:

- rlitanim.hob & laser.hob? -> rlit.vtx & laser.vtx -> no effect when removed from stbof.res? (vtx reference in sub_53CD90)

- trigger situation/code for the borg t01e.gif (smiley)? -> t01.hob only vanilla hob using 6 gif files?
Last edited by Spocks-cuddly-tribble on Mon Nov 28, 2011 2:17 pm, edited 1 time in total.
On the verge of a nervous breakdown? Try the relaxing tribble sounds.

User avatar
thunderchero
Site Administrator aka Fleet Admiral
Site  Administrator aka Fleet Admiral
Posts: 6066
Joined: Fri Apr 25, 2008 2:00 am
Location: On a three month training mission, in command of the USS Valiant.
Contact:

Re: Trek.exe Ship Slots (for 3D sfx)

Post by thunderchero » Sat Nov 05, 2011 11:55 am

Very nice find being able to use the TMP slot for all matching ship scale/phasers. I just tested with all major ships replaced with models from UDM3.0.1 ship pack added and then disabled all the major races slots by changing C** -> A** for all slots and no crashes so far. :D this should help tethys with his add every thing mod (AKA Galaxy mod) lol :wink:

Note; be careful when doing this UE will move TMP slot (up one slot) due to unused slot moved to last slot 8O

thunderchero

User avatar
Tethys
Past Administrator
Past Administrator
Posts: 2065
Joined: Fri Jul 18, 2008 2:00 am
Location: Your mom's bed ;)
Contact:

Re: Trek.exe Ship Slots (for 3D sfx)

Post by Tethys » Sat Nov 05, 2011 4:08 pm

Funny we had a conversation about ship slots just the other day, I think I used the TMP slot however. I believe it now has 3 models.. lol
Not for the weak of heart...
Image
GALM <--- GALM/Galaxies Mod

User avatar
thunderchero
Site Administrator aka Fleet Admiral
Site  Administrator aka Fleet Admiral
Posts: 6066
Joined: Fri Apr 25, 2008 2:00 am
Location: On a three month training mission, in command of the USS Valiant.
Contact:

Re: Trek.exe Ship Slots (for 3D sfx)

Post by thunderchero » Sat Nov 05, 2011 4:54 pm

Tethys wrote:Funny we had a conversation about ship slots just the other day, I think I used the TMP slot however. I believe it now has 3 models.. lol

So..... if you rename it to TMP and use 150% scale and 8 phasers on that slot, every other slot that used 150% scale and 8 phasers could be used for a different ship.

thunderchero

User avatar
Peter1981
Rear-Admiral
Rear-Admiral
Posts: 1118
Joined: Tue May 06, 2008 2:00 am
Location: England

Re: Trek.exe Ship Slots (for 3D sfx)

Post by Peter1981 » Sat Nov 05, 2011 6:36 pm

@SCT this is very intresting and exciting infomation -- Kudos!

User avatar
DCER
Code Master
Code Master
Posts: 683
Joined: Sat Apr 26, 2008 2:00 am

Re: Trek.exe Ship Slots (for 3D sfx)

Post by DCER » Mon Nov 07, 2011 12:42 pm

thunderchero wrote:Note; be careful when doing this UE will move TMP slot (up one slot) due to unused slot moved to last slot 8O
This is now fixed in 0.7.1b and 0.7.2dev4. It was caused by auto-fixing duplicate slots and placing them at the end of the list. Duplicates will still get fixed but now stay in the same place.

In the original trek.exe there is no slot 0 instead there are two slots names HM1. UE will auto-rename the second one to 0.

Post Reply

Return to “Trek.exe Ship Slots”

Who is online

Users browsing this forum: No registered users