[Solved] Formatted Messageboxes

Questions specific to OpenMW-CS can be asked, and content development related topics can be discussed here
Post Reply
kuyondo
Posts: 243
Joined: 29 Mar 2016, 17:45

[Solved] Formatted Messageboxes

Post by kuyondo »

Currently, there is no way to do formatted messageboxes in OpenMW. The following hacky method only works in the original engine.
Taken from -> http://en.uesp.net/wiki/Tes3Mod:Formatted_MessageBoxes

Insert Line Breaks
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.
Last edited by kuyondo on 26 Aug 2018, 08:40, edited 1 time in total.
kuyondo
Posts: 243
Joined: 29 Mar 2016, 17:45

Re: Formatted Messageboxes

Post by kuyondo »

Image
Equinox
Posts: 19
Joined: 31 Jul 2018, 20:13

Re: Formatted Messageboxes

Post by Equinox »

kuyondo
Posts: 243
Joined: 29 Mar 2016, 17:45

Re: Formatted Messageboxes

Post by kuyondo »

Thanks! Ive been tracking the progress at github and I just realised that openmw accepts "\n" for newline. yayy
Post Reply