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.
TOE - help with complex messages
Read the Scripting Guide again. You are not following it.
[Edit-- added material]
For your reference, the Scripting Guide says this:
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.
[Edit-- added material]
For your reference, the Scripting Guide says this:
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.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.”
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
“Forgiving and being forgiven, loving and being loved,
living and letting live, is the simple basis for it all."
Ernest Holmes 1984
Who is online
Users browsing this forum: No registered users and 0 guests