by Flimbo » Fri Dec 16, 2011 2:57 pm
Hi Roody.
This time the verb is 'press'. Here's the grammar definition:
Code: Select all
verb "press", "tap"
* DoVague
* (kbd_keys) "on" keys_equipped DoPress
* (kbd_keys) DoPress
Both the infamous 'PC' and the 'keyboard' are suitable xobjects for the verb (in fact both have the keys_equipped attribute).
As you can guess by the grammar definition, I also coded a 'keyboard keys' object, because the player must press some specific keys in order to do some things on the pc.
Here's the object definition:
Code: Select all
scenery kbd_keys "keyboard keys"
{
in office
nouns "key", "keys", "button", "buttons"
adjectives "f1", "f2", "f3", "f4", "f5", "f12", "esc", "escape", "keyboard"
article "the"
is plural
}
I just didn't like the standard "You don't see that." when, for instance, you try 'press f1' outside of the office location... so I changed ParseError at case 11 this way:
Code: Select all
print CThe(actor); " don't see any ";
if InList(kbd_keys, adjective, parse$)
print "keyboard";
else
print parse$;
print "."
RESULT: regardless of the input, InList always returns false, finding no match whatsoever between parse$ and any of the adjectives. I tried all of them.
The printout is always: "You don't see any F1" .. or similar, which is possibly even worse than "You don't see that."
I'm puzzled... again.
Hi Roody.
This time the verb is 'press'. Here's the grammar definition:
[code]verb "press", "tap"
* DoVague
* (kbd_keys) "on" keys_equipped DoPress
* (kbd_keys) DoPress
[/code]
Both the infamous 'PC' and the 'keyboard' are suitable xobjects for the verb (in fact both have the keys_equipped attribute).
As you can guess by the grammar definition, I also coded a 'keyboard keys' object, because the player must press some specific keys in order to do some things on the pc.
Here's the object definition:
[code]scenery kbd_keys "keyboard keys"
{
in office
nouns "key", "keys", "button", "buttons"
adjectives "f1", "f2", "f3", "f4", "f5", "f12", "esc", "escape", "keyboard"
article "the"
is plural
}
[/code]
I just didn't like the standard "You don't see that." when, for instance, you try 'press f1' outside of the office location... so I changed ParseError at case 11 this way:
[code]print CThe(actor); " don't see any ";
if InList(kbd_keys, adjective, parse$)
print "keyboard";
else
print parse$;
print "."
[/code]
RESULT: regardless of the input, InList always returns false, finding no match whatsoever between parse$ and any of the adjectives. I tried all of them.
The printout is always: "You don't see any F1" .. or similar, which is possibly even worse than "You don't see that."
I'm puzzled... again.