Code: Select all
004A28AE mov ecx, offset 5919FC // asm base address (not for TMP!)
004A28CA cmp ebx, 49h // number of read slots (without TMP)
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) -> ??? +4/+8 = unused weapon slots and special switch - no trek.exe code
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 - in order of the hob slots) -> bitmask for vectors and firing arcs (see below)
List of the 26 valid direction values: (default firing arc 120 degree, for narrow 60 degree add 0x40, for wide 180 degree +0x80) 01 F - Fore 02 A - Aft 04 S - Starboard (right) 05 FS 06 AS 08 P - Port (left) 09 FP 0A AP 10 U - Up 11 FU 12 AU 14 SU 15 FSU 16 ASU 18 PU 19 FPU 1A APU 20 D - Down 21 FD 22 AD 24 SD 25 FSD 28 PD 26 ASD 29 FPD 2A APD C0 All directions (360 degree arc)
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
- 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)?