TOE - help with complex messages

Maps and the art of mapmaking.
mweil86
Leprechaun
Leprechaun
Posts: 13
Joined: 11 Sep 2007

TOE - help with complex messages

Unread postby mweil86 » 23 Jul 2008, 19:32

When I create a complex message the variable does not appear in the message. I followed the scripting guide using a command such as:

MessageBox( { "message.txt"; variable=5 } );

where message.txt looks like: The number is <variable>.

but all that appears is: The number is .

What am I doing wrong?

Thanks.

User avatar
Asheera
Round Table Knight
Round Table Knight
Posts: 4506
Joined: 06 Jul 2008
Location: The Shadows
Contact:

Unread postby Asheera » 23 Jul 2008, 19:33

You should write: <value=variable> ;)
No matter how powerful one becomes, there is always someone stronger. That's why I'm in a constant pursuit of power, so I can be prepared when an enemy tries to take advantage of me.

Franzy
War Dancer
War Dancer
Posts: 362
Joined: 07 Sep 2007
Location: Moscow, Russia
Contact:

Unread postby Franzy » 24 Jul 2008, 11:49

Also remember to use a path with message.txt:)

User avatar
rdeford
Assassin
Assassin
Posts: 299
Joined: 17 Apr 2007
Location: Sequim, USA
Contact:

Unread postby rdeford » 02 Aug 2008, 01:49

Read the Scripting Guide again. You are not following it.

[Edit-- added material]

For your reference, the Scripting Guide says this:
To display a variable within displayed text:

1. In the resource text file use <value=variablename> at places where the variable should be displayed.

Example:
<value=name> has pillaged <value=goldamount> gold from local villages.

2. In the script, the MessageBox() command for the above example would look like:

Format:
MessageBox( { "path/to/textfile"; variablename = value}, "optional_callback_function" );

Example:
MessageBox( { "Maps/SingleMissions/MyMap/Pillage.txt "; name = "Jonny Blackeye", goldamount = 526 });

Notice that commas separate the elements in the variable list inside the {}.

3. In the game the message displayed to the player it would look like:

“Jonny Blackeye has pillaged 526 gold from local villages.”
As mentioned by the other posters, you must use the value=varName format inside the message text. You must use the complete map data path to the message text file inside the MessageBox calling function.

Also, notice that there is a one-to-one correspondence between the varNames in the text file and the variable names in the MessageBox calling function. Also, notice the use of {}. the semicolon, and the commas in the MessageBox calling function. This usage must be followed.
rdeford, Mage Of Soquim

“Forgiving and being forgiven, loving and being loved,
living and letting live, is the simple basis for it all."

Ernest Holmes 1984


Return to “Mapmaking Guild”

Who is online

Users browsing this forum: No registered users and 0 guests