Patch:Large text files
This page covers patching large text files. These are the *TXT.CKx files in Keen Vorticons. They contain the help, story, previews and end texts for the game. A utility that makes these patches automatically is Startext. Related patches are Patch:Story Screen (Galaxy).
Default file locations and sizes
In Keen 1 these files are external and can be of any size (to change their names see Patch:Files and filenames) for other episodes they are internal chunks of text and can be patched like other Patch:Text patches. Often it is easiest to use the %patchfile command with them, to create an easily editable external text file. An example is creating an external help text file for Keen 2:
|Patch: Keen 4|
Several things should be noticed. First, you need to patch the text. Second, you will need an eternal file in your mod's directory for CKPatch to read, or you will get a 'file not found' error. Third, the file can only be so large before you start overwriting other, important text. In the case above it can be any size less than 2'016 bytes. Until reccently the size of these files could not be changed, but see section below.
The locations and sizes for patches required to patch all the large text files in Keen 2-6 (and Keen Dreams 1.13) are as follows:
Keen Text Location Max Size (bytes) 2 End $15844 896 Help $15BC0 2'016 Preview $163A0 1'824 Story $16AC0 3'232 3 End $181A0 832 Help $179D0 2'000 Preview $184E0 1'776 Story $18BD0 3'120 4 Story $1EE40 512 5 Story $1FDE0 604 6 Story $1ED50 493 D End $24128 ??? Help $22EF0 416 Story $23090 2'640
There are several other things to note. Firstly, in Keen Vorticons, these text chunks are automatically parsed, that is, the Keen engine will place line returns in the text automatically, like a word processor. (The line width is about 38 characters) Secondly, again in Vorticons, the text is terminated by the character $1A, not $00 as in most text patches. (The proper ASCII character for this can be found in the Keen 1 text files, right at the end, it resembles a left arrow.) Thirdly, in Vorticons, it is possible to change the text from type 1 (Usually called 'white') to type 2 (Usually called 'grey') by placing the character '~' at the start of a line. (Doing this for more than one line in a row can cause odd results however.) Keen uses this, and a preceding line of '_' to divide its texts up into 'pages'
You can also insert most other characters from the font into the file. Checking the Keen 1 files is recommended. Both Notepad and Wordpad can be used for this, and to create\edit text files.
Changing length of text files
It is possible to change the location the game reads text files from. This allows the modder to rearrange text files and thus change their length. (The total amount of space available cannot be changed, but it can be allocated differently and if a mod does not use something such as the previews text, that space can be given to other documents like the story.)
The location of the text file is given by taking the first value ($xxxxRW) and adding an '0' then adding the second value. Thus Keen 3'a Help text file is at $179D0 ($179D -> $179D0 + 0000 = $179D0)
It is important to keep track of what this does to the available space; increasing a file's location by $10 removes 16 bytes of space from it, decreasing it by $10 adds 16 bytes of space. If files are tightly packed then it can be very hard to alter them (New additions, correcting mistakes.) without having to fiddle with patches. If drastically moving a file the amount of space available can be extremely varied.
|Patch: Keen 3|
|Patch: Keen 4 story segment location|