Jump to content

Message Boxes and Passing Strings


bluemarvin

Recommended Posts

Is there a way to use strings in a Message Box displayed by way of the Show function?

 

I know how to pass numbers into a message, but not strings.

 

So for example, let's say I has an int variable where if set to 1 that means "Green" is the player's favorite color, where if 2 it means "Blue" is the favorite.

 

Then I want to display a Message Box that tells you whether that variable is set to "Blue" or "Green" ... like:

 

"Your favorite color is currently set to: Blue"

 

Is this possible? I suppose I can do this with a Debug.MessageBox command, but was wondering if there's a way with MyMsg.Show() instead?

Link to comment
Share on other sites

Is there a way to use strings in a Message Box displayed by way of the Show function?

 

I know how to pass numbers into a message, but not strings.

 

So for example, let's say I has an int variable where if set to 1 that means "Green" is the player's favorite color, where if 2 it means "Blue" is the favorite.

 

Then I want to display a Message Box that tells you whether that variable is set to "Blue" or "Green" ... like:

 

"Your favorite color is currently set to: Blue"

 

Is this possible? I suppose I can do this with a Debug.MessageBox command, but was wondering if there's a way with MyMsg.Show() instead?

 

All too easy. Simply have two different Message forms. The first has the message "Your favorite color is currently set to: Blue". The second has the message "Your favorite color is currently set to: Green".

Then you simply code an "if" statement in your script:

 

ScriptName myScript extends whatever

Message Property BlueMessage auto
Message Property GreenMessage auto
int Property favcolor auto

Event SomeEvent()
   If favcolor == 1
        BlueMessage.show()
   ElseIf favcolor == 2
        GreenMessage.show()
   EndIf
EndEvent

Edited by steve40
Link to comment
Share on other sites

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...