Here are some new options to play with:
- new positive system events
- measures to prevent negative system events (not always appropriate) - most notably the Supernova got 3 new features
1.) New System Events (they have no event messages!) (former bitmask - cases 0, 8, 9 & C)
case 0 = hidden dilithium source discovered
Code: Select all
trek.exe at 0x4B61C change 6 bytes to 4E 71 08 FE 46 6E
-asm-
0044C21B 804E 71 08 OR BYTE [ESI+71],8 // set dilithium flag
0044C21F FE46 6E INC BYTE [ESI+6E] // dilithium resource level +1
cases 8 & 9 = stranded ship discovered and refloated (if 'special system' add special ship for system owner in sector)
Special systems see:
viewtopic.php?f=231&t=319#p33718
case 8 = random minor ship (default IDs 0x69-0x72, 10 ships)
case 9 = add fixed ship ID (default 4C = B'rel II)
Suggestion for case 9:
Create a shiplist.sst entry with ship ID lower than borg (first monster) and higher than last minor ship. When duplicating monster entry make sure ship type is set to standard type (0,1,2,3 or 4). shiptech.sst set to cannot be build by any major/minor. This would allow for funny Chodak, Tarellian or Combat Drone under control of a major race (map range of -1 could force the drone to stay in sector, unless retreat), or even an unique ship like a 'future' ship.
Code: Select all
trek.exe at 0x4B872 change 0x24 bytes to
0F B7 46 68 85 C0 74 ED B1 0A F6 F1 B2 69 02 D4 EB 08 80 7E 68 00 74 DD B2 4C 0F BF 06 E8 AC 9D FF FF EB D1
-asm-
case 8
0044C472 0FB746 68 MOVZX EAX,WORD [ESI+68]
0044C476 85C0 TEST EAX,EAX
0044C478 ^74 ED JE SHORT 44C467
0044C47A B1 0A MOV CL,0A // number of minor race ships in shiplist.sst
0044C47C F6F1 DIV CL
0044C47E B2 69 MOV DL,69 // first minor race ship ID in shiplist.sst
0044C480 02D4 ADD DL,AH
0044C482 EB 08 JMP SHORT 44C48C
case 9
0044C484 807E 68 00 CMP BYTE [ESI+68],0
0044C488 ^74 DD JE SHORT 44C467
0044C48A B2 4C MOV DL,4C // ship ID to add
0044C48C 0FBF06 MOVSX EAX,WORD [ESI]
0044C48F E8 AC9DFFFF CALL 446240
0044C494 ^EB D1 JMP SHORT 44C467
case C = no pop growth this turn (entire food surplus eroded by Tribbles
)
Code: Select all
trek.exe at 0x4B98B change 7 bytes to
C6 86 20 03 00 00 01
-asm-
0044C58B C686 20030000 01 MOV BYTE [ESI+320],1
2.) Counteractions & new features for Negative System Events
- Super Nova -
counteraction: Starbase (permanentely orbiting sun with a powerfull injector device for inversed trilithium-particles)
This gives starbases a meaning, since only default advantage over outposts is the sector claim value:
viewtopic.php?f=122&t=2183#p30258
Even without a starbase, at the first time only the sun animation gets changed, indicating the sun becomes unstable i.e. probability is significantly lower than any other event. Due to the indiction one still might have the time to build a starbase.
Sun animation files to alter:
copy and change duplicate names to s-s-...
s-r-map.tga
s-r-maps.tga
s-r-.ani -> copy has to be edited to use altered tga files including info text like DANGER of NOVA or SUN UNSTABLE
If despite everything the system gets destroyed, at least a free colony ship gets added to sector for emergency evacuation.
Change event text 'All live has been destroyed...' to for example: all planets have been destroyed, colony ship built for emergency evacuation...
Code: Select all
trek.exe at 0x4B6E7 change 0x6E bytes to
80 3D 44 2B 5A 00 03 7E EC 80 7E 30 00 74 E6 80 7E 31 04 75 E0 8B 46 4C 6B C0 6F 8B 04 85 E8 1A 5B 00 83 78 04 01 74 CD 0F BF 06 E8 F9 A8 06 00 0F B7 40 08 80 FC FF 74 0B E8 8B EC FF FF 80 78 2C 07 74 B1 80 7E 34 73 74 0C FE 46 34 EB A6 90 90 90 90 90 90 90 8B 46 4C 33 D2 B2 05 E8 67 91 00 00 0F BF D0 8B 06 E8 ED 9E FF FF B7 04
-asm-
0044C2E7 803D 442B5A00 03 CMP BYTE PTR DS:[5A2B44],3 // not difficulty level 1-3
0044C2EE ^7E EC JLE SHORT 44C2DC
0044C2F0 807E 30 00 CMP BYTE PTR DS:[ESI+30],0 // no home systems
0044C2F4 ^74 E6 JE SHORT trek-org.0044C2DC
0044C2F6 807E 31 04 CMP BYTE PTR DS:[ESI+31],4 // red giant only
0044C2FA ^75 E0 JNZ SHORT 44C2DC
0044C2FC 8B46 4C MOV EAX,DWORD PTR DS:[ESI+4C]
0044C2FF 6BC0 6F IMUL EAX,EAX,6F
0044C302 8B0485 E81A5B00 MOV EAX,DWORD PTR DS:[EAX*4+5B1AE8] // empsInfo+50h adr_provInfo
0044C309 8378 04 01 CMP DWORD PTR DS:[EAX+4],1 // not last system held
0044C30D ^74 CD JE SHORT 44C2DC
0044C30F 0FBF06 MOVSX EAX,WORD PTR DS:[ESI]
0044C312 E8 F9A80600 CALL 4B6C10 // get sector.lst entry
0044C317 0FB740 08 MOVZX EAX,WORD PTR DS:[EAX+8]
0044C31B 80FC FF CMP AH,0FF // check station ID
0044C31E 74 0B JE SHORT 44C32B
0044C320 E8 8BECFFFF CALL 44AFB0 // get StarbaseInfo entry
0044C325 8078 2C 07 CMP BYTE PTR DS:[EAX+2C],7 // not with a starbase
0044C329 ^74 B1 JE SHORT 44C2DC
0044C32B 807E 34 73 CMP BYTE PTR DS:[ESI+34],73 // check picture 's'
0044C32F 74 0C JE SHORT 44C33D // goto nova
0044C331 FE46 34 INC BYTE PTR DS:[ESI+34] // change picture 'r' to 's'
0044C334 ^EB A6 JMP SHORT 44C2DC exit
0044C336 90 NOP
0044C337 90 NOP
0044C338 90 NOP
0044C339 90 NOP
0044C33A 90 NOP
0044C33B 90 NOP
0044C33C 90 NOP
0044C33D 8B46 4C MOV EAX,DWORD PTR DS:[ESI+4C]
0044C340 33D2 XOR EDX,EDX
0044C342 B2 05 MOV DL,5
0044C344 E8 67910000 CALL 4554B0 // get shipID of CS
0044C349 0FBFD0 MOVSX EDX,AX
0044C34C 8B06 MOV EAX,DWORD PTR DS:[ESI]
0044C34E E8 ED9EFFFF CALL 446240 // add colony ship
0044C353 B7 04 MOV BH,4
- Comet Strike -
counteraction:
option A = 1+ powered OBs
Code: Select all
trek.exe at 0x4B6C5 change 0x12 bytes to
0F BF 06 50 E8 C6 A5 FF FF 85 C0 58 75 09 90 90 90 90
-asm-
0044C2C5 0FBF06 MOVSX EAX,WORD[ESI]
0044C2C8 50 PUSH EAX
0044C2C9 E8 C6A5FFFF CALL 446894
0044C2CE 85C0 TEST EAX,EAX
0044C2D0 58 POP EAX
0044C2D1 75 09 JNZ SHORT 44C2DC
0044C2D3 90 90 90 90 nop
option B = systems containing a Gas Giant are protected
Code: Select all
trek.exe at 0x4B6C5 change 0x12 bytes to
F6 46 70 08 75 11 90 90 90 90 0F BF 06 90 90 90 90 90
-asm-
0044C2C5 F646 70 08 TEST BYTE PTR DS:[ESI+70],8 // gas giant
0044C2C9 75 11 JNZ SHORT 44C2DC
0044C2CB 90 90 90 90 nop
0044C2CF 0FBF06 MOVSX EAX,WORD [ESI]
0044C2D2 90 *5 NOP
- Climate Shift Negative -
counteraction:
option A = powered Shield Generator
Code: Select all
trek.exe at 0x4B829 change 0x16 bytes to
0F BF 06 E8 5F A3 FF FF 83 F8 01 7D 31 90 8D 5C 24 08 8D 4C 24 0C
-asm-
0044C429 0FBF06 MOVSX EAX,WORD [ESI]
0044C42C E8 5FA3FFFF CALL 446790 // get SH output
0044C431 83F8 01 CMP EAX,1
0044C434 7D 31 JGE 44C467
0044C436 90 NOP
0044C437 8D5C24 08 LEA EBX,DWORD PTR SS:[ESP+8]
0044C43B 8D4C24 0C LEA ECX,DWORD PTR SS:[ESP+C]
option B = systems containing a Gas Giant are protected
Code: Select all
trek.exe at 0x4B839 change 6 bytes to
F6 46 70 08 75 28
-asm-
0044C439 F646 70 08 TEST BYTE PTR DS:[ESI+70],8
0044C43D 75 28 JNZ SHORT trek-org.0044C467
- Earthquake -
counteraction: active scanner (tomographic tectonic scan for early detection & measures)
Code: Select all
trek.exe at 0x4B7AE change 0x12 bytes to
0F BF 06 E8 7A 88 FF FF 85 C0 75 0B 90 90 90 0F BF 06
-asm-
0044C3AE 0FBF06 MOVSX EAX,WORD PTR DS:[ESI]
0044C3B1 E8 7A88FFFF CALL 444C30
0044C3B6 85C0 TEST EAX,EAX
0044C3B8 75 0B JNZ SHORT 44C3C5
0044C3BA 90 NOP
0044C3BB 90 NOP
0044C3BC 90 NOP
0044C3BD 0FBF06 MOVSX EAX,WORD PTR DS:[ESI]
Patch:
Code: Select all
NAME: Modifying System Events (ECM example) required files: (s-s-map.tga, s-s-maps.tga & s-s-.ani)
DESC: Adds new positive system events, measures to prevent negative system events & some events unlock unused edifice.bst building requirements.
AUTHOR: Spocks-cuddly-tribble
URL: https://www.armadafleetcommand.com/onscreen/botf/viewtopic.php?p=46098#p46098
# new case 0 (disabled due to game balance issues)
# >> 0x4B61C 8E 06 03 00 00 20
# << 0x4B61C 4E 71 08 FE 46 6E
# new cases 8 (ship IDs 69h+ /0xA ships) & 9 (ship ID 50h)
>> 0x4B872 80 8E 07 03 00 00 08 31 C0 83 C4 14 5D 5F 5E 59 5B C3 80 8E 07 03 00 00 10 31 C0 83 C4 14 5D 5F 5E 59 5B C3
<< 0x4B872 0F B7 46 68 85 C0 74 ED B1 0A F6 F1 B2 69 02 D4 EB 08 80 7E 68 00 74 DD B2 50 0F BF 06 E8 AC 9D FF FF EB D1
# new case C
>> 0x4B98B 80 8E 04 03 00 00 20
<< 0x4B98B C6 86 20 03 00 00 01
# Super Nova special code
>> 0x4B6E7 66 8B 1D 44 2B 5A 00 66 83 FB 01 0F 84 22 FE FF FF 66 83 FB 02 0F 84 18 FE FF FF 66 83 FB 03 0F 84 0E FE FF FF 80 7E 30 00 0F 84 04 FE FF FF 31 D2 8A 56 4C 8D 04 D5 00 00 00 00 01 D0 C1 E0 02 01 D0 C1 E0 02 89 C2 C1 E0 02 29 D0 05 98 1A 5B 00 8B 40 50 E8 E0 EF 0C 00 83 F8 01 0F 84 D1 FD FF FF 8A 7E 31 80 FF 04 0F 85 C5 FD FF FF
<< 0x4B6E7 80 3D 44 2B 5A 00 03 7E EC 80 7E 30 00 74 E6 80 7E 31 04 75 E0 8B 46 4C 6B C0 6F 8B 04 85 E8 1A 5B 00 83 78 04 01 74 CD 0F BF 06 E8 F9 A8 06 00 0F B7 40 08 80 FC FF 74 0B E8 8B EC FF FF 80 78 2C 07 74 B1 80 7E 34 73 74 0C FE 46 34 EB A6 90 90 90 90 90 90 90 8B 46 4C 33 D2 B2 05 E8 67 91 00 00 0F BF D0 8B 06 E8 ED 9E FF FF B7 04
# Comet Strike special code -> counteraction option A = 1+ powered OBs
>> 0x4B6C5 8A AE 07 03 00 00 80 CD 02 0F BF 06 88 AE 07 03 00 00
<< 0x4B6C5 0F BF 06 50 E8 C6 A5 FF FF 85 C0 58 75 09 90 90 90 90
# Climate Shift Negative special code -> counteraction option A = powered Shield Generator
>> 0x4B829 8A 86 07 03 00 00 8D 4C 24 0C 0C 40 8D 5C 24 08 88 86 07 03 00 00
<< 0x4B829 0F BF 06 E8 5F A3 FF FF 83 F8 01 7D 31 90 8D 5C 24 08 8D 4C 24 0C
# Earthquake special code -> counteraction = powered Scanner
>> 0x4B7AE 8A 96 04 03 00 00 80 CA 04 0F BF 06 88 96 04 03 00 00
<< 0x4B7AE 0F BF 06 E8 7A 88 FF FF 85 C0 75 0B 90 90 90 0F BF 06
I don't know how many bugs is too many but that point is reached somewhere before however many in BotF is.