Ok, this thread is a little old, but i hope my answer will help you out
So..here is how to deal with Arrays:
First...a look a the t-file-entry(s):
Code: Select all
<page id="8888">
<t id="100">Some text\n\n
[select value="YES,{%s,%s,%s}"]YES[/select]\n\n
[select value="NO,{%s,%s}]NO[/select]
</t>
</page>
ok..you see the brace around the %s. this marks it as an array.
I use only 5 "%s" because sprintf can't do more at one time. If you need
more, than you have to split the message in multiple parts and multiple
sprintf's.
ok....now we send the message...just simple:
Code: Select all
$message = sprintf: pageid=8888 textid=100,"Y1","Y2","Y3","N1","N2"
send incomint question $message to player: callback="<your callbacksript>"
Ok..this was the simple part !
Now...the callback-script:
Code: Select all
Script <your scriptname>
Version: 0
for Script Engine Version: 32
Description
Description
Arguments
* 1: val , Var/String , 'val'
* 2: arr , Value , 'arr'
Source Text
001 $count = size of array $arr
002 $v1 = $arr[0]
003 $v2 = $arr[1]
004 $v3 = $arr[2]
005 $mess = sprintf: fmt='Answer %s Count %s Values %s,%s,%s', $val, $count, $v1, $v2, $v3
006 send incoming message $mess to player: display it=[TRUE]
007 return null
Ok...a little explain:
As you can see the second parameter is simple a value. This is because
there is no parametertype "VAR/Array". Each script that uses an array as
parameter, has to use the type "value" for this.
Also, it is important, the position of the parameter:
if you have defined the array as 3. value in the t-file, it has to be the
3. parameter of the callback-script !
Well i hope this helps you