Allowing un-allowed characters in a messagebox

Post » Fri May 27, 2011 9:04 am

I want to have a messagebox with quotes and a description of a console command in it. However, quotes (and apparently player-> is not allowed..). I want to use both in my messageBox, such as:

messageBox, "The command is "player->setlevel x"."


Which would output

The command is "player->setlevel x".
.

However, quotes are not allowed. When I tested in game without using quotes, the output was:

The command is "setlevel x".


Weird. It just chopped the player part right out. Anyone know a workaround to using un-allowed characters?

There seems to be a no-no flag set for quite a few nonalphanumeric characters (*, `, '[, ]...)
User avatar
Lily Evans
 
Posts: 3401
Joined: Thu Aug 31, 2006 11:10 am

Post » Thu May 26, 2011 9:33 pm

I don't know about the scripting protocol for the Elder Scrolls scripting language, but have you tried the generic escape character (backslash)?

Example:

messageBox, "The command is \"player->setlevel x\"."

User avatar
Cheville Thompson
 
Posts: 3404
Joined: Sun Mar 25, 2007 2:33 pm

Post » Thu May 26, 2011 10:45 pm

Thought about it, didn't try it. I'll get back.

Edit: Nope, that doesn't work. Nor does the ^ that is used for string variables (^PCRace, ^PCName, etc).
User avatar
Vickytoria Vasquez
 
Posts: 3456
Joined: Thu Aug 31, 2006 7:06 pm

Post » Fri May 27, 2011 5:25 am

You may be able to do it if you compile the script with a placeholder, then hex-edit the characters after saving it. The only problem is you'll have to edit it after every save.
User avatar
Naomi Lastname
 
Posts: 3390
Joined: Mon Sep 25, 2006 9:21 am

Post » Fri May 27, 2011 10:31 am

Yes but when the script is reading the messageBox prompt, won't it automatically stop when it gets to the first non-functional quote (not the quotes that denote the message, the quotes that I want to put in), and then throw an error because you have random gibberish after that?
User avatar
Chris Jones
 
Posts: 3435
Joined: Wed May 09, 2007 3:11 am

Post » Thu May 26, 2011 10:13 pm

Nope. It's already compiled and just told to retrieve a null-terminated string. If you added a null, things would probably break. Qarl used hex-editing after saving for some message boxes with double-quotes in them in the Underground, IIRC.
User avatar
Isaac Saetern
 
Posts: 3432
Joined: Mon Jun 25, 2007 6:46 pm

Post » Fri May 27, 2011 1:10 am

I'll try it sometime, then. I was thinking that the scripts were compiled at runtime.
User avatar
e.Double
 
Posts: 3318
Joined: Tue Jul 24, 2007 11:17 pm

Post » Fri May 27, 2011 1:14 pm

I'll try it sometime, then. I was thinking that the scripts were compiled at runtime.

It is compiled into bytecode by the tescs
User avatar
Shelby Huffman
 
Posts: 3454
Joined: Wed Aug 08, 2007 11:06 am

Post » Fri May 27, 2011 6:11 am

Did you try to use apostrophes for outer quotes? Or you can settle for apostrophes as inner quotes instead.

Also, if you *really* need some nonalphanumeric characters (first check whether they are present in the Magic Cards font that Morrowind uses; it's pretty much limited compared to regular Windows fonts), you can try the trick that worked for me when I needed a newline formatting - type the text with desired characters replaced by some allowed character that you won't use, say '|'. Compile the script and save the mod. Now open the mod file with a hex editor, find your messagebox' text (it will be present in two instances - first goes compiled code, then source text; you need the former) and manually replace |'s with what you need. Just don't do it if you still plan to debug or modify the script, as recompiling will erase your efforts.

Keep in mind that I haven't used this method with characters other than CR, so I can't guarantee that you won't get a CTD :D.
User avatar
Adam Porter
 
Posts: 3532
Joined: Sat Jun 02, 2007 10:47 am

Post » Fri May 27, 2011 6:01 am

I wonder if that's why player-> disappears also.
User avatar
ruCkii
 
Posts: 3360
Joined: Mon Mar 26, 2007 9:08 pm


Return to III - Morrowind