Morrowind Mod:Formatted MessageBoxes

The UESPWiki – Your source for The Elder Scrolls since 1995
Jump to: navigation, search

Insert Line Breaks[edit]

Normally, the text entered as first parameter of MessageBox is displayed as a continuous line that the engine breaks where it sees fit according to line's total length and length of separate words. With a bit of hex editing, though, you can make it look more formatted.

Let's say, you want a MessageBox to report the amount of certain enemies you killed like this:

Score:
Daedra Lords: 21
Golden Saints:37
Fargoths:     9999

If you try to make a MessageBox with line breaks in the CS, it will take it as several lines with different operators and refuse to compile it. You'll have to deceive the CS. First, you write an operator:

MessageBox "Score:|Daedra Lords: %.0f|Golden Saints:%.0f|Fargoths:     %.0f", k_Dae, k_Snt, k_Far

Compile the script and save your mod. Now you'll need a hex editor like WinHex (or any that you prefer). Open your .esp with it and find the message text. It will be found there twice - first time in the body of a compiled script, second in the source text. You'll need the first one. Replace all symbols '|' with the hexadecimal code 0A (line feed) and save the file. Now, when you play the mod, the engine will recognize line breaks properly and display your MessageBox as you wanted it.

Just keep in mind that if you change and recompile the script, imposed linebreaks will be lost and you'll have to repeat the operation again.