More questions

The Pixie
03 Aug 2011, 17:48
Rather than start a bunch of new threads, I will just ask here.

How do you give the player a menu to choose from? this seems very popular in Quest games, but I cannot see any script option that sounds anything like it.

Jhames
03 Aug 2011, 21:05
Yes, it's possible.
Is not easy at the moment (as far I know) but possible.

This is the code in the aslx file:


<command name="Test">
<script>
list = NewStringList()
list add (list, "Item 1")
list add (list, "Item 2")
result = ShowMenu ("Choose an option", list, false)
</script>
<unresolved type="string"></unresolved>
<pattern>Test</pattern>
</command>


To do this from the editor, go script-editor and to this:

Set variable[list]=[new string list]
Add to list[list] value[text] [item1]
Add to list[list] value[text] [item2]
Set variable [result]=[expression] [Showmenu("Choose an option"),list,false)]

The text between [] go inside textboxes.

The Pixie
03 Aug 2011, 21:30
Thanks, that was very helpful, and not something I was going to guess.

You do have an extraneous ) in your code, should be:
Showmenu("Choose an option",list,false)

And a note for Alex, the error message for a function not found, was that written by Yoda?
FunctionCallElement: Could find not function 'ShowMenu(String)'

The Pixie
05 Aug 2011, 13:27
I have been looking throgh the function description in the Wiki, and was surprised to read this about the return function.

Sets the return value of a function. Note that the function will continue running after this is called.

That strikes me as rather odd; is that right? Why does it do that?

Alex
05 Aug 2011, 13:34
That is correct. It's similar to the way in VB or Pascal you'd assign a return value, then continue running the rest of the function.

As for why, well honestly it's because it was simpler to implement that way.