Talk:Text Input With OBSE

From the Oblivion ConstructionSet Wiki
Jump to navigation Jump to search

Featured Content Nomination[edit source]

Yeah, I nominated my own article for "Featured" status. Awful of me, I know, but it doesn't change the fact that it's a good article. I was just clicking "Random Page" hoping to stumble upon something worth nominating when this came up. Anyway, opinions should go here.
Dragoon Wraith TALK 20:39, 20 March 2008 (EDT)

Updates[edit source]

February 2, 2008[edit source]

  • Fixed: Bug that caused extra characters to be deleted when using Backspace.
  • Simplified: Code that checked for an empty string.
  • Added: Code to make sure the player has named the object.
  • Added: Code to make Ctrl+Backspace delete a whole word.

Dragoon Wraith TALK 20:41, 2 February 2008 (PST)

New-line possibilities[edit source]

Ok, first off, it's my first edit to the wiki so if it's wrong/out of place or anything else, feel free to remove or change it. :P

Now for the comment. I just wanted to say it's possible to add newlines to the stringvar itself (so having multiple string vars with %r in the MBoxEx isn't needed anymore). It's described at Talk:MessageBox. Even though it says it's for MessageBox it also works with SetName and ModName (and assuming AppendToName aswell). I've tested it just now and it didn't seem to break anything in the script.

Oh and maybe this could also be used to add semi-colons. Hexcode for those is 3B. Gonna try it out.
Ok, I've gotten the semi-colon to work (;), aswell as the double-quotation mark ("). They both work fine without breaking the script and backspace works as it should. Only thing I didn't get to work was the divides (|). Everytime I added it with the hex editor the script got mixed up when backspace was pressed. It's not a big deal, one would never use it anyways. Only downside to all of this is, that it's a hassle to hex-edit it everytime.

P.S. How do I change the (EST) in my post time? Kyoma 13:27, 3 February 2008 (EST)

Yeah, hex-editing MessageBoxes has been done since Morrowind. A few modders have used it extensively... Qarl's Underground comes to mind immediately. But until OBSE adds a way to use those characters without hex-editing, it's just not going to be a very notable fact.
At any rate, thanks for your contributions to figuring out how to manipulate MessageBoxes... they are woefully inadequate for so many things, but they're all we've got.
Dragoon Wraith TALK 00:44, 4 February 2008 (EST)
True, but I'm just happy it can be done. :) Kyoma 03:27, 4 February 2008 (EST)

Console[edit source]

Me again, um currently when you open the console and you start to type, the scrip doesn't hold. I've added some simple code in my script but I'm a bit afraid of adding it here. (still noob to th cs). So I'm mentioning it here so you can add it. Kyoma 03:27, 4 February 2008 (EST)

Frankly, I'm not sure that the script should be held accountable for something like that, though if you have some way of handling that works well, cool. Feel free to post it.
Anyway, what does happen when you open the console?
Dragoon Wraith TALK 04:02, 4 February 2008 (EST)
If I press the ` key it opens the console like it should. But when I start to type, in the background. Kyoma 08:54, 4 February 2008 (EST)
OK, so I sort of looked into this, and this is what I found:
First of all, you can't type in the Console while the script is running. The call to MessageBox closes the Console. The script continues to run just fine, however.
Secondly, there is no good way to prevent this. MenuMode 3, which is supposed to return true if the Console is open, does not do so if a MessageBox is also open. It is therefore impossible to detect when the script should stop checking keypresses.
So there is, unfortunately, no way to support using the Console during the script (except to read stuff, anyway).
Also, I attempted to implement some more characters, and I found that the percent sign (%) and the semicolon (;) were also impossible to support. The semicolon causes the rest of the line to be a comment, so it fails to see it as part of the string, and the percentage sign crashes the game when it's typed.
The percent sign is, I believe, a bug in OBSE that was previously reported by someone else... perhaps Kyoma? The semicolon, of course, was known previously.
Dragoon Wraith TALK 18:13, 4 February 2008 (EST)
Correct, stupid Oblivion doesn't recognize MenuMode 3 if it already was in menumode. BUT, it's not hard to temporarily disable the script. I already did this with this code. I've placed it between the if state == 1 block and the caps block.
if OnKeyDown 41
	set bConsole to bConsole == 0
endif
if bConsole
	return
endif
As soon as you press the ~ key the part that adds characters to the string is stopped from running but the button checking and self-activation continues like normal.
Yep, using (%) crashes the game, I was a bit suprised cause ModName doesn't use %x or anything so it should consider (%) like any other character, right? Oh and yes, I was the one that reported it. :P
Clever, good call. Feel free to add that to the script.
We should probably go back to the left after this.
Dragoon Wraith TALK 05:25, 5 February 2008 (EST)