Time flies when you're having fun I guess, seems only yesterday that I saw the front page post about someone playing with this, and it turns out that it's 3 years later and now there is a working port of the sega-cd speech into Kilrathi Saga!
First up, this is incredible - I've only played a little bit, but I love it! Inspired and curious about how it was working - I decided to take a look at how hard a similar scripting exercise would be for WC2 (I know that EmuMusicFan did some sterling analysis on doing this the 'proper' way by modding the game files). I've managed to identify the memory address where onscreen text is printed during cutscenes and where the game stores the playercharacter names (oddly it stores them twice, once for the savegame, and once for the cutscenes, which will be relevant later...)
From that, I managed to whip up a quick prototype WC2 script file that does what I need here, but identified a couple of issues with the engine/scripting logic (at least as I understand it) as it stands:
Firstly, WC2 uses the same memory address for the cutscene text, as it uses for the 'distance to target' during flight. That means that the console gets spammed during flight, and that the script will be parsed to some degree almost continually during gameplay (which seems to be causing performance impacts).
Logically, I can use the HasWord function in Destro's scripting to check for this - if the string contains ' km' then we can skip the rest of the script - but that doesn't help for the ' m' case. Destro, would it be possible to have an 'EndsWith' string test (without the code I can't be sure, but I don't think there is one)?
Secondly, in the scripting I had real issues with the string replacement - specifically in wanting to check for the below example from the 1st mission debriefing:
If|String|[String.Buffer1]|=|No, I'm not. That patrol scared me, s{[String.Name]}
For those curious, these are the memory addresses I have found so far:
0x0049345E - Mission Series (1-12) - updated during flight and on game-load - indicates Last (current) Mission flown
0x00493460 - Mission Number (0-3) - updated during flight and on game-load - indicates Last (current) Mission flown
0x00499EF8 - Player callsign
0x00499F10 - Player surname
0x00499F28 - Player firstname
0x005D1C41 - Cutscene text - Technically the address is 0x005D1C40 but both CheatEngine and the peek seem to fail to spot this as a string most of the time - using 0x005D1C41 just means that you chop off the first character. This is also the distance to current target counter address during spaceflight.
0x005D3C10 - Mission Letter (e.g. A/B/C/D) - updated during flight - updated during flight (not on game load) - indicates last (current) mission flown
0x005D3C41 - Mission Series Name (e.g. Gwynedd/Niven/Ghorah Khar)- updated during flight - updated during flight (not on game load) - indicates last (current) mission flown
0x0A33A1C1 - During spoken cutscenes this address, or one near it gets the original dos text - it can move though.