Morrowind Mod:XMessageFix

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

A function added by MWSE.

xMessageFix this function allows you to use strings from variables with the MessageBox function with a few restrictions. First, the MessageBox command must immediately follow this one. Second, the number of strings for this function must match the number of strings for the MessageBox. Third, the MessageBox can have buttons but it can't use variables. And finally, the values of the strings used on the MessageBox will be replaced with the values from xMessageFix, but the MessageBox strings set a maximum size for each of the xMessageFix strings (it's OK if the MessageBox strings are longer than the MessageFix ones). Using xMessageFix can take both the STRING variable and literal string types and each string acts as a format string as described for the xStringBuild function. If a string ends in a single % and the formatted string takes less space than the matching string from MessageBox, the remaining characters of the MessageBox string will be used.

While it is possible to use formatted messages and buttons, it is best to format strings with xStringBuild if there are buttons involved because of the limit of 12 parameters per function.

Syntax[edit]

xMessageFix message_format (string), ...

Example[edit]

long thiscell

setx thiscell to xPCCellID

xMessageFix "Teleport Fargoth Where?" thiscell "Seyda Neen" "Red Mountain"
MessageBox "aaaaaaaaaaaaaaaaaaaaaaaa" "aaaaaaaaaaaaaaaaaa" "aaaaaaaaaaaaaaaaa" "aaaaaaaaaaaaaaaaaa"

If you are in Caldera, the Arena in Vivec, or Ald-Ruhn the MessageBox would respectively show:

Teleport Fargoth Where?
Caldera Seyda Neen Red Mountain
Teleport Fargoth Where?
Vivec Seyda Neen Red Mountain
Teleport Fargoth Where?
Ald-ruhn Seyda Neen Red Mountain

See Also[edit]

xPCCellID
xRefID
xMyCellID
xGetName
xSetName
xGetBaseID
xStringCompare
xStringLength
xStringParse
xStringBuild
xStringMatch
xLogMessage