More Hex Questions
More Hex Questions
It's Help, Story, Previews, About-ID, and Order Info time on my Keen2 mod (levels are at 5/16, I'm stuck for ideas, figured I'd take a chunk out of the paperwork)
... How exactly is the formatting defined? Flipping through the text I see 0A, 0D, and 00. I'm definitely no l337 h4xx0r... but by the looks of it:
0A is used to start a new line, much like the HTML <BR>
0D is used to swap into the "other" text color in the 2FON0000.bmp
00 is used as what... a placeholder?
This is why I need you guys! :-D
Now: I know there's a program or two that will change all this for me--but I'd like to learn why things work the way they do. Could someone step me through here and teach me what 0A, 0D, and 00 are used for in these text files?
Keen2 editing seems to be a whole lot more hexwork than Keen1--because Keen2 doesn't have a STORYTXT.ck2, FINALE.ck2, or HELPTEXT.ck2 file... it's all in the code! I'm okay at working with space constraints--what I'm more interested in is changing the layout of the text on the page! Do I NEED to have those line-breaks where they are?
If need be, I can sit down and hack out a line-by-line replacement of every little bunch of text in the game... :-) that's how I did my Keen1 mod!
--Xky
... How exactly is the formatting defined? Flipping through the text I see 0A, 0D, and 00. I'm definitely no l337 h4xx0r... but by the looks of it:
0A is used to start a new line, much like the HTML <BR>
0D is used to swap into the "other" text color in the 2FON0000.bmp
00 is used as what... a placeholder?
This is why I need you guys! :-D
Now: I know there's a program or two that will change all this for me--but I'd like to learn why things work the way they do. Could someone step me through here and teach me what 0A, 0D, and 00 are used for in these text files?
Keen2 editing seems to be a whole lot more hexwork than Keen1--because Keen2 doesn't have a STORYTXT.ck2, FINALE.ck2, or HELPTEXT.ck2 file... it's all in the code! I'm okay at working with space constraints--what I'm more interested in is changing the layout of the text on the page! Do I NEED to have those line-breaks where they are?
If need be, I can sit down and hack out a line-by-line replacement of every little bunch of text in the game... :-) that's how I did my Keen1 mod!
--Xky
- adurdin
- Site Founder
- Posts: 549
- Joined: Fri Aug 29, 2003 11:27 pm
- Location: Edinburgh, Scotland
- Contact:
In normal use, 0D is a carriage return, and 0A is a line feed. In DOS, to get a proper line break you need both: 0D followed by 0A. I believe this is true for Keen as well.
00 is used to mark the end of a string. While you can mess around with anything within the string, the location of the null (00) character is important: if it gets changed, the starting and ending locations of the strings will be somewhere unexpected, causing a real mess (and possibly a crash). Try it and see... :)
But you can put line breaks anywhere you want within a string.
00 is used to mark the end of a string. While you can mess around with anything within the string, the location of the null (00) character is important: if it gets changed, the starting and ending locations of the strings will be somewhere unexpected, causing a real mess (and possibly a crash). Try it and see... :)
But you can put line breaks anywhere you want within a string.
re: line breaks
I am astounded... flat out astounded. I don't remember seeing an 0D anywhere in the Keen2 "About ID..." part I was editing. Lemme go double-check.
Yeah, there's no sign of 0D anywhere in there:
So how are they starting new lines? :-$ I'm really sorry for being such a nuisance about this... it's a little over my head.
--Xky
Yeah, there's no sign of 0D anywhere in there:
Code: Select all
We are a group of software artists {0A} {00} {00} {00} {00} {00} whose goal is to bring commercial {0A} {00} {00} {00} {00} {00} {00} quality software to the public {0A} {00} {00} {etc} ...
--Xky
re: line length
But without the 0D's in there, I can't change the length of the lines... they're practically hard-coded. For example, look at this "original" code:
Onscreen, that would produce this:
And that's great... but if I were to patch it to, say:
Onscreen in the game, I'd get something like this:
There'd still be the Word 4 on the second line, even though the code has no such thing. This is why I posted--if I attempted to post and move the location of the 0A's, things messed up. :-( Can that be cleared up, at all?
I've already re-done the screen to accomodate for the strict format, so it's not crucial... it'sj ust something I'd like to get a better understanding of. Thanks again!
--Xky
Code: Select all
Word 1 Word 2 Word 3 {0A} {00} {00} {00} {00} Word 4 Word 5 Word 6
Code: Select all
Word 1 Word 2 Word 3
Word 4 Word 5 Word 6
Code: Select all
Word 1 Word 2 Word 3 Word 4 {0A} {00} {00} {00} {00} Word 5 Word 6
Code: Select all
Word 1 Word 2 Word 3 Word 4
Word 4 Word 5 Word 6
I've already re-done the screen to accomodate for the strict format, so it's not crucial... it'sj ust something I'd like to get a better understanding of. Thanks again!
--Xky
- adurdin
- Site Founder
- Posts: 549
- Joined: Fri Aug 29, 2003 11:27 pm
- Location: Edinburgh, Scotland
- Contact:
My previous post was made without looking at the actual files. It appears that line breaks are marked only be 0A in this text. If you want to have the line breaks elsewhere, you can add 0As in other spots. The important thing for this is not to change any of the 00s -- or you get the effect that you mentioned in your post.
As an example, where the original has this (with * representing 0A and ~ representing 00):
A patch could replace it with something like:
Because the subroutines for printing text keep track of where to print the next character, it doesn't matter at all that you have to split the text up between the two strings.
As an example, where the original has this (with * representing 0A and ~ representing 00):
Code: Select all
We are a group of software artists*~~~~~whose goal is to br
Code: Select all
Did you know?*Commander Keen is onl~~~~~y*eight years old**
re: coding
*gasp of understanding* That's awesome--thank you very very much, Mr. Durdin! That'll help me out a bit on my "Previews!" screen, I think.
--Xky
--Xky