Author Topic: Say anything  (Read 8207 times)

0 Members and 1 Guest are viewing this topic.

Offline gumby

Say anything
« on: May 05, 2012, 08:39:01 AM »
Anyone off-hand know how to create a statement to trap if anything is said?  Something like this:
Code: [Select]
   (if(Said('*'))
      Print('Good parse')
   )
I just want to put a dummy statement in my rooms which traps a successful user input.  I don't think that the said spec supports wildcards in the first position, so I'm assuming I need to be looking at the code that handles keystroke events?

I tried to no-claim operator solution in my own post: http://sciprogramming.com/community/index.php/topic,329.0.html (Negation of Said) but it doesn't work (at least not in Studio). 


In the Great Underground Empire (Zork port in development)
Winter Break 2012 Rope Prop Competition

Offline gumby

Re: Say anything
« Reply #1 on: May 05, 2012, 04:33:25 PM »
I just tested the 'no-claim' solution in a new game and it works just fine.  I guess I've got something wonky somewhere else in my game.
In the Great Underground Empire (Zork port in development)
Winter Break 2012 Rope Prop Competition

Offline gumby

Re: Say anything
« Reply #2 on: May 05, 2012, 05:00:21 PM »
Figured it out.  Apparently I clobbered the '*' word in the vocab, which should be of type 'anyword'.  Instead of anyword, it was set to 'preposition'.
In the Great Underground Empire (Zork port in development)
Winter Break 2012 Rope Prop Competition

Offline Collector

Re: Say anything
« Reply #3 on: May 05, 2012, 06:48:21 PM »
That sounds like something that have some kind of entry about it in the Wiki.
KQII Remake Pic

Offline gumby

Re: Say anything
« Reply #4 on: May 05, 2012, 08:49:48 PM »
I think it's covered properly in several said string topics (Advanced Said() Strings, Said() Strings - Comprehensive Examples).  My problem was due to programatically building the vocab & probably not something that anyone will run into.

In my opinion, I would think twice about changing any of the word classes in the vocab of the template game.  There is only one word that comes to mind is the word 'with' (which I've done in the past during testing of the parser), but I'm not even sure if that's a really good idea.
In the Great Underground Empire (Zork port in development)
Winter Break 2012 Rope Prop Competition


SMF 2.0.19 | SMF © 2021, Simple Machines
Simple Audio Video Embedder

Page created in 0.078 seconds with 22 queries.