I hope I'm not sidetracking the people doing the important ship and mission editing when I point out these obscure engine features.
However, this hasn't stopped me from learning how to edit these hotspots. They're defined in OPTIONS.V00 (which also contains the graphics). I'm afraid I'm not very familiar with how to describe low-level editing like this, so please let me know if I should be using any particular formatting conventions.
Within OPTIONS.V00 you'll find 6 uses of the text "FORM", followed by 4 bytes (looks like the length of the following structure), followed by "HOTRSTRC", some more bytes, then "FORM" again, 4 more bytes (length again), and "HTXTSYMB". The 6 such blocks, in order:
- Non-Concordia menu (starts at 8A5E hex)
- Non-Concordia save/load (starts at D012 hex)
- Concordia menu (starts at 141CA hex)
- Concordia save/load (starts at 1877E hex)
- Planet menu (starts at 2087C hex)
- Planet save/load (starts at 26FA6 hex)
Let's look at the first "FORM" (Non-Concordia menu), starting at 8A5E.
The "HOTRSTRC" at 8A66 defines the hotspot areas - both clickable and (for "View storyline" and "Fly mission"), the location where the replacement graphics appear. The first 4 bytes seem to be another length. I'm not sure what the next two bytes do, but they have the same value (0A and 00) in every "HOTRSTRC". After that, there are 4 of 10 bytes, defining the 4 hotspots in this screen. These are 5 little-endian words, in order:
- Left edge
- Top edge
- Right edge (inclusive, so the 51-pixel-wide "Fly mission" graphic goes from 131 (hex 8300) to 182 (hex B600).
- Bottom edge (inclusive again)
- Index
What does that "Index" do? These are numbers from 1 to 4, defining:
- The index in the following "HTXTSYMB" list where the hotspot text comes from.
- The graphic replacement used, where one exists.
- The actual place the game takes you. (1 = Fly mission, 2 = View storyline, 3 = Save/Load, 4 = Exit to DOS).
There are 10 bytes (00 00 00 00 3F 01 C7 00 00 00) for every single HOTRSTRC resource. I can't work out what these do. I've changed them all to 00 or FF without obvious effect.
Note that this means that
hot spot areas may not be defined in the same order as the associated text. In this case, they turned out to be, in order, 4 (Exit), 3 (Save/Load), 2 (View storyline) and 1 (Fly mission). Torment your friends! Swap the 04 at 8A7C with the 03 at 8A86, and the airlock will act as Save/Load while the panel next to the bunk will exit. The popup text will give the game away, but you can fix that too...
Amazingly, it's possible to add index 5, and associated text, and it will display correctly when you mouse over it. However, clicking on it does nothing - which is an improvement on my predicted result, where I fully expected the game to crash. Hotspots with index 0 cause severe lag when moused over and do nothing when clicked.
Putting it all together, here are hotspots moved to the screen corners, with modified text.
Some limitations:
- The game redraws a special background slice in the space where the "subtitle" text appears. This means that you can't have custom door graphics appearing in that part of the screen - see what happened when I put the "storyline" hotspot there. It would be logical if the 10 unknown bytes define this area's placement, but they don't appear to do so.
- The top-left corner of the replacement graphic has to be the top-left corner of the hotspot. You can't, say, have the room lights turn red when the mission briefing door is open.
- My custom text invovled shortening the other text. Changing the length of the "HTXTSYMB" resource would involve changing multiple length definitions throughout this file. I'm assuming that someone has existing documentation on how to insert data into these files and update all the lengths and offsets?
What
can we do with this?
- If the tools for swapping out graphics can be applied to OPTIONS.V00 without damaging its non-graphic resources, we can swap in a whole new carrier interior, with its own layout.
- At a minimum, we can replace the 3 hotspot screens offered by WC2. Hopefully the campaign or mission files have a byte somewhere which selects one for each mission.
- It's just possible that we can add a 4th or further screen and resources to OPTIONS.V00, and select it from the campaign or mission as before. Imagine having each "Fly mission" hotspot be the fighter for that mission sitting on the flight deck, for example. (No, I don't see a way to allow fighter selection through hotspots. Sorry.)
Was this worthwhile? Probably not. There's really no point messing with the interiors to show a new carrier until we can confidently edit the missions and ships to have us flying off a new carrier. Still, it's here for when the time comes.
Final observation: why does the "Fly mission" door appear to lead to the
debriefing room on the
Tiger's Claw? No room in WC2 looks like that...