Talk:MessageBox

From the Oblivion ConstructionSet Wiki
Jump to navigation Jump to search

Problems with variables[edit source]

%% - Use this to display a percent-sign in the message

When I tested this, I encountered a problem: the percent-sign doesn't show up. Instead of displaying the percent-sign, my first button was used as a variable and all other buttons didn't do what they had to do. Is it possible to display percent-signs in a messagebox? Would anyone care to find a way to solve this problem, please?

Darkness X 10:19, 6 April 2010 (EDT)

More than 10 Buttons?[edit source]

See thread - a user has posted a script with 20 buttons in his MessageBox, and has not reported any issues with the box itself. I can't test this right now, but I know I've never attempted more than 10 - would anyone care to try? That could be huge.
Dragoon Wraith TALK 09:07, 23 April 2008 (EDT)

No, it doesn't work. If I remember correctly you'll see the option, but nothing will happen when you select it. Also, I thought it was 9?--Haama 11:32, 23 April 2008 (EDT)
Ah, that's no good... but seems like OBSE should be able to figure out which one is pressed... I may fiddle with that at some point.
Also, it's ten buttons, nine variables.
Dragoon Wraith TALK 18:07, 23 April 2008 (EDT)

Semi-Colon?[edit source]

Does anyone know how to display a semi-colon in a message box? The script thinks it's a comment and complains about mis-matched quotes.

Not a huge deal, just curious.
Dragoon Wraith TALK 18:52, 8 June 2007 (EDT)

Successive MessageBoxes Script[edit source]

Hello : Just a little tip in TES-script to make follow two messageBoxs, as you can't do it simply in laying one after an other :

short tempframe
set tempframe to 0

if ( tempframe == 0 )
  MessageBox "My introduction"
  set tempframe to 1
endif

if ( tempframe == 1 )
  short tempButton
  set tempButton to getbuttonpressed
  if ( tempButton > -1 )
    MessageBox "My conclusion"
  endif
  set tempframe to -1
endif

--DZastreux

Thanks for this.
--Thanatos00

Formatting MessageBoxes?[edit source]

Question : Does anyone have more information on formatting MessageBoxes? (line break, etc...) --Thanatos00

You could also use "Message" for this. AFAIK there are no line breaks etc in messageboxes, "can be formated" refers to the length of numeric arguments that can be defined wit "%.xf" --JOG 06:20, 22 April 2006 (EDT)
Hello,
A solution to insert line breaks in message box :
  • Place /\ everywhere you want a line break in your messagebox (or an other unusual double sign, i choose /\ because in my esp file the string /\ doesnt exist anywhere). -> If you want 2 line breaks at the same place type /\/\, etc...
  • Make a copy of your esp file.
  • download Hex WorkShop (free)
  • Open your copy with Hex WS
  • Use the "find" tool (ctrl+F), and type /\ in the "value box" ( Exactly -> "type : text string, value /\" ).
  • Now replace all of your "2F 5C" (which means /\ in hexadecimal) by "0D 0A" (which means "line break" in hexadecimal; 0 is the number, not the letter).
  • Warning : be sure to only replace /\ that are in your messageboxes ! The first time I try this, Ive used the || signs, and I've replaced all of these signs, and some of these signs wasnt into my messageboxes, so when I saved my esp with hex WS my esp was corrupted !! So verify in the right column, each time you replaced /\, that it is really the /\ of your messagebox.
  • try your esp copy in game, and if you did your work properly, *poof* it's working ^^ !
Tips
Before to do that : ensure you that your script which contains messaboxes, is completly finish/clean !
In that way, you will also be able to load your esp (that you've modified with Hex WS) in the TESCS, and rework on it. As long as you dont modify your script which contains your messageboxes, the line breaks modification will stay.
You will be able to reload your script, do modifications, and save it. But line breaks modifications will be lost.
Sorry for my english, hope you will understand ^^'
(If you want to correct my english, dont hesitate. Thanks )
Bye
--Thanatos00 23 April 2006

Other Formatting Operators[edit source]

I've also tested the formating operators: %s (String) %c(char) %b(bin) and %h(hex)

  • %h seems to work partly, maybe displaying only the high-word of an longint
  • %s seems to work like in c, with the variable being a pointer to the memory-location of the string. I got it to display "(Null)" and with large random numbers I managed to crash Oblivion.
  • %c ends the output the rest of the line isn't displayed.
  • %b doesn't work at all.

--JOG 18:11, 7 May 2006 (EDT)

Have you tried %s with a reference variable? BTW, %n crashes Oblivion reliably.--Tegid 12:51, 8 May 2006 (EDT)
Just tried it, almost a a guaranteed crash.--JOG 14:41, 8 May 2006 (EDT)

MessageBoxes in a Scipted Effect[edit source]

Is the use of 2 messageboxes in a scripted effect even possible? I'm having some serious issues with GetButtonPressed. --MaXiMiUS 23:16, 28 May 2006 (EDT)

It is, but you need to use a variable to switch between them. Like this:
short state
short button

Begin GameMode

  if ( state == 0 )
    MessageBox, "Will you do it?", "Yes", "No"
    set state to 1
  elseif ( state == 1 )
    set button to GetButtonPressed
    if ( button == -1 )
      return
    elseif ( button == 0 )
      set state to 2
    else
      set state to 4
    endif
  elseif ( state == 2 )
    MessageBox, "Really?", "No", "Yes"
    set state to 3
  elseif ( state == 3 )
    set button to GetButtonPressed
    if ( button == -1 )
      return
    elseif ( button == 1 )
      MessageBox, "Yay!"
      set state to 4
    else
      set state to 4
    endif
  endif

End
It's a lot of code, but it's pretty simple. Feel free to ask about it, if you're having trouble.
Dragoon Wraith TALK 23:56, 28 May 2006 (EDT)

Fun MessageBox Facts![edit source]

In case it helps anyone, I just spent hours formatting 5 menu/messageboxes. (Wish I'd seen Thanatos's note above first, but probably better to keep this one open for editing). A couple things I measured that will help with this painful process.

  • a line in the box is 60 spaces wide.
  • a line in the box is 39 sequential digits wide (1-0 and repeat)

Since the font is proportional, this is of limited help, but it's SOME. Once I learned I could tap in 60 spaces and get a blank line things did get somewhat easier. The wordwrap method is a major pain though. All I can say is start at the top and get each successive line right. And don't expect them to line up perfectly.

A thought that occurred to me after I'd finished. A good way to handle it in the CS script editor (which uses a similarly proportioned font, it appears) would be to make a template line with the center of each line and the breaks where it will roll over marked, then create your message box text string beneath that. I plan on doing that from now on.

--DanSch 18:43, 1 January 2007 (EDT)