Formatted Messageboxes

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

Formatted Messageboxes

Post by kuyondo » 05 Aug 2018, 14:07

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.

User avatar
kuyondo
Posts: 215
Joined: 29 Mar 2016, 17:45

Re: Formatted Messageboxes

Post by kuyondo » 05 Aug 2018, 14:31

Image

Post Reply

Who is online

Users browsing this forum: No registered users and 2 guests