I'm kind of fiddling with some stuff in my GUI-tutorial game and need a little help.
I'll apologize for the redundancy (a similar post is over in the libraries under ThePixie's 'Complex Commands').
In one room in my tutorial I am showing three different ways to use two objects together - verbs, command patterns, and regular expressions. The verbs are easy. Done. The command pattern is done. Now, using some fancy code supplied by The Pixie in the above mentioned library, I have gotten this code to work in X3 --> ^(tell|ask) (?<object>.*) to (be quiet|keep quiet|shut up|hush|be silent)$
In my tutorial game, I have tried that again...
I used this --> ^(pour|dump|add|empty|put|use) (the |) (?<object_water>.*) (on|over|into|onto) (the |) (?<object_seedling>.*)$
... a little more complex, but I think it is correct.
Below is the code for this section of my tutorial:
<command name="water seedling cmd">
<pattern type="string"><![CDATA[^(pour|dump|add|empty|put|use) (the |) (?<object_water>.*) (on|over|into|onto) (the |) (?<object_seedling>.*)$]]></pattern>
<script>
if (Got(water)) {
if (ListContains(ScopeVisible(), seedling)) {
msg ("You empty the water onto the plant. It is quickly absorbed by the ground! Within minutes, the ground rumbles and a giant apple tree emerges from the earth!")
MakeObjectInvisible (water)
MakeObjectInvisible (seedling)
MakeObjectVisible (apple tree1)
}
else {
msg ("There is no seedling here to water!")
}
}
else {
msg ("You need to be carrying the water to do that.")
}
I thought that
^(pour|dump|add|empty|put|use) (the |) (?<object_water>.*) (on|over|into|onto) (the |) (?<object_seedling>.*)$ would accommodate all of the combinations - pour water on seedling, use water on the seedling, empty water on seedling, etc. When I try to 'use water on seedling' I get the message 'You can't use it that way' and if I use other combinations like 'pour water on seedling', I get the message 'I can't see that. (water on seedling)'
Does anyone know what the deal with this is?
Thanks in advance!