Author Topic: Said() Strings - Comprehensive Examples  (Read 4684 times)

0 Members and 1 Guest are viewing this topic.

Offline gumby

Said() Strings - Comprehensive Examples
« on: December 05, 2010, 08:14:38 PM »
These examples were tested against the template game with minor modifications (several word additions, as well as making the word 'of' a noun).



  • Verbs

User Input            Parts of Speech            Said string syntax            Notes
look            verb            look            will match any input starting with 'look' ('look', 'look around', 'look at troll', etc)
jump            verb            jump            will match any input starting with 'jump'


  • Nouns

take a breath            verb/noun            take/breath            Don't include articles in said strings – also responds to 'take breath'
eat the goodies            verb/noun            eat/goodies            Don't include articles in said strings – also responds to 'eat goodies'
take key            verb/noun            take/key            


  • Adjectives / Nouns acting like Adjectives

User Input            Parts of Speech            Said string syntax            Notes
take golden sword            verb/adj/noun            take/sword<golden            
drop heavy black sword            verb/adj/adj/noun            drop/sword<black<heavy            also reponds to 'drop the heavy black sword'
drop heavy goodies basket            verb/adj/noun/noun            drop/basket<goodies<heavy            
take goodies basket            verb/noun/noun            take/basket<goodies            
take basket of goodies            verb/noun/prep/noun               take<of/basket/goodies            dont need to make 'of' a noun
take basket of goodies            verb/noun/noun-prep/noun            take/goodies<basket<of            need to make 'of' a noun for this to work – this appears to be the best thing to do.
drop heavy basket of goodies            verb/adj/noun/noun-prep/noun            drop/basket<heavy/goodies            
take black magic voodoo sword            verb/noun-adj/noun-adj/noun-adj/noun            take/sword<magic<black<voodoo            Can use any number of noun-adjs (black/magic/voodoo), in any order (both the user input & said string)
take top secret water sword            verb/noun/noun/noun/noun            take/sword<top<secret<water            Can use any number of nouns to describe the subject (top/secret/water).  Position unimportant.  'Sword' must remain in the same position however.  Othe nouns can be in any order (both in user input & said syntax)


  • Adverbs

User Input            Parts of Speech            Said string syntax            Notes
where is sword            adverb/indverb/noun            is<where/sword            as in a question “where is sword”
throw basket of goodies quickly            verb/noun/prep/noun/adverb            throw<quickly/basket<of<goodies            note that 'of' needs to be a noun for this to work
quickly throw basket of goodies            adverb/verb/noun/prep/noun            throw<quickly/basket<of<goodies            note that 'of' needs to be a noun for this to work
crawl under table slowly            verb/prep/noun/adverb            crawl<under<slowly/table            same as 'slowly crawl under table'
slowly crawl under table            adverb/verb/prep/noun            crawl<under<slowly/table            same as 'crawl under table slowly'
quickly run down troll            adverb/verb/adverb/noun            run<quickly<down/troll            also responds to 'quickly down run troll' (jibberish), 'run down troll quickly', 'quickly run troll down', does NOT work for 'run troll down quickly', 'run troll quickly down'


  • Prepositions

User Input            Parts of Speech            Said string syntax            Notes
turn lamp on            verb/noun/prep            turn<on/lamp            same said as 'turn on lamp'
turn on lamp            verb/prep/noun            turn<on/lamp            same said as 'turn lamp on'
talk to troll            verb/prep/noun            talk<to/troll            
look in keyhole            noun-verb/prep/noun               look<in/keyhole            
walk behind curtain            noun-verb/prep-noun/noun            walk/curtain<behind            
swing sword at troll            verb/noun/prep/noun               swing<at/sword/troll            
throw sword at thief            verb/noun/prep/noun               throw<at/sword/thief            
eat goodies with troll            verb/noun/prep/noun            eat<with/goodies/troll            
put knife upon ledge            noun-verb/noun/prep/noun            put<upon/knife/ledge            see non-working example 'put knife up on ledge'
swing sword at fat troll            verb/noun/prep/adj/noun            swing<at/sword/troll<fat            
swing heavy sword at troll            verb/adj/noun/prep/noun            swing<at/sword<heavy/troll            
swing heavy sword at fat troll            verb/adj/noun/prep/adj/noun            swing<at/sword<heavy/troll<fat            


  • Making words optional '[]'

User Input            Parts of Speech            Said string syntax            Notes
take long knife            verb/adj/noun            take/knife[<long]            This will enforce that only the adjective 'long' is used, no other adjective is valid.  Note that if the said string was 'take/knife', any adjective could be used & it would be valid
take up sword            verb/prep/noun            take[<up]/sword            Note that string will also accept 'take sword' as user input


  • Grouping words '()'

User Input            Parts of Speech            Said string syntax            Notes
lift up sword OR raise sword            verb/prep/noun OR verb/noun            (lift<up),raise/sword            Both phrases will work, however it is interesting to note that 'raise <any preposition&gt; sword' will also work.


  • Matching any word/no word/exact phrase

User Input              Parts of Speech            Said string syntax            Notes
look            verb            look[/!*] OR look[/noword]            will only match 'look', not 'look this' or 'look at...'
look wall OR look bird OR etc...            verb            look/* OR look/anyword            will only match if there is a word following 'look'
look troll            verb            look/troll[/!*]            
play game            verb/noun            play/game[/noword]            only will match 'play game', will not match 'play game with troll' unless the 'noword' syntax is removed, then it would match
take knife            verb/noun            take/knife            note that this will also match 'take long knife', 'take rusty knife', etc.
lift up sword OR raise sword            verb/prep/noun OR verb/noun            (lift<up),(raise[<noword])/sword            This will ONLY accept 'lift up sword' or 'raise sword'


  • Exhaustive & Complex Examples

User Input            Parts of Speech            Said string syntax            Notes
give food to the dog            verb/noun/prep/article/noun            give/food/dog            preposition not represented in said string, unnecessary
give food to dog            verb/noun/prep/noun            give/food/dog            
give dog the food            verb/noun/article/noun            give/food/dog            
give dog food            verb/noun/noun            give/food<dog            dog being treated here as an adjective (similar to goodies in 'take goodies basket')
give food dog (nonsense)            verb/noun/noun            give/dog<food            
give food the dog (nonsense)            verb/noun/article/noun            give/dog/food            Adding the article changes said string (see 'give food dog')
take troll to game            verb/noun/prep/noun               take<to/troll/game            see non-working example 'take troll out to game'
take troll to game            verb/noun/prep/noun            take/troll/game            see alternative parse of 'take<to/troll/game'
take troll to ball game            verb/noun/prep/noun/noun            take<to/troll/game<ball            ball should probably be classified as an adjective...
take troll ball game            verb/noun/noun/noun            take/game<ball<troll            nonsense! But it does work... also accepts 'take ball troll game'
take troll game ball            verb/noun/noun/noun            take/ball<troll<game            also responds to 'take game troll ball' – utter nonsense.
take troll to ball game            verb/noun/prep/noun/noun            take/troll/game<ball            similar to 'take troll to game', but with additional 'ball' noun which acts as an adj
play game with troll            verb/noun/prep/noun               play<with/game/troll           
play checkers game with troll            verb/noun/noun/prep/noun            play<with/game<checkers/troll           
play game of checkers with troll            verb/noun/noun-prep/noun/prep/noun            play<with/checkers<game<of/troll            note that 'of' needs to be a noun for this to work
play game of checkers with grey troll            verb/noun/noun-prep/noun/prep/adj/noun            play<with/checkers<game<of/troll<grey            note that 'of' needs to be a noun for this to work
play short game of checkers            verb/adj/noun/noun-prep/noun            play/checkers<short<game<of            note that 'of' needs to be a noun for this to work
play short game of checkers with troll            verb/adj/noun/noun-prep/noun/prep/noun            play<with/checkers<short<game<of/troll            note that 'of' needs to be a noun for this to work
quickly play short game of checkers            adverb/verb/adj/noun/noun-prep/noun            play<quickly/checkers<short<game<of            note that 'of' needs to be a noun for this to work
quickly play short game of checkers again            adverb/verb/adj/noun/noun-prep/noun/adverb            play<quickly<again/checkers<short<game<of            41 characters.  Maximum possible in user input string!
again play short game of checkers quickly            adverb/verb/adj/noun/noun-prep/noun/adverb            play<quickly<again/checkers<short<game<of            same syntax as 'quickly play short game of checkers again'


  • Does not work

User Input            Parts of Speech            Said string syntax            Notes
put knife up on ledge            noun-verb/noun/adverb/prep/noun                         Parser reports bad sentence.
take troll out to game             verb/noun/prep/prep/noun                         Parser reports bad sentence.
« Last Edit: June 03, 2015, 03:49:48 PM by Cloudee1 »


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

Offline Collector

Re: Said() Strings - Comprehensive Examples
« Reply #1 on: December 05, 2010, 09:14:40 PM »
Did you put this in the Wiki, too?
KQII Remake Pic

Offline gumby

Re: Said() Strings - Comprehensive Examples
« Reply #2 on: December 05, 2010, 09:48:23 PM »
Did you put this in the Wiki, too?
Yep, it's in there now.
In the Great Underground Empire (Zork port in development)
Winter Break 2012 Rope Prop Competition

Offline Doan Sephim

Re: Said() Strings - Comprehensive Examples
« Reply #3 on: December 05, 2010, 10:15:39 PM »
This is awesome! and much needed!

Offline MusicallyInspired

Re: Said() Strings - Comprehensive Examples
« Reply #4 on: December 06, 2010, 01:26:39 AM »
Holy cripes on toast! (10 points to whoever gets the reference) You, sir, are one awesome human being for figuring this all out! This will help loads!
Brass Lantern Prop Competition

Offline gumby

Re: Said() Strings - Comprehensive Examples
« Reply #5 on: December 06, 2010, 07:56:41 AM »
Hey, thanks guys.  If there is any user input scenario that was missed, please post it here (or in the 'Syntax Help' forum) & we'll get it resolved & documented.
In the Great Underground Empire (Zork port in development)
Winter Break 2012 Rope Prop Competition

Offline Cloudee1

Re: Said() Strings - Comprehensive Examples
« Reply #6 on: January 21, 2015, 01:53:41 PM »
added to tutorials > sci > your first game > Handling the Player's "Said" Input
Halloween Competition Brass Lantern Prop Competition Groundhog Day Competition

Offline gumby

Re: Said() Strings - Comprehensive Examples
« Reply #7 on: April 04, 2015, 01:53:34 PM »
It appears that we lost the vast majority of the original post.  Not exactly 'comprehensive' anymore  :o.  If we don't have a backup from the previous site move, I may need to recreate it from here: http://sciwiki.sierrahelp.com//index.php?title=Said()_Strings_-_Comprehensive_Examples
In the Great Underground Empire (Zork port in development)
Winter Break 2012 Rope Prop Competition

Offline Cloudee1

Re: Said() Strings - Comprehensive Examples
« Reply #8 on: April 06, 2015, 10:07:55 AM »
Took care of getting it back up to snuff. Also updated the tutorial on the subject as well.
Halloween Competition Brass Lantern Prop Competition Groundhog Day Competition

Offline gumby

Re: Said() Strings - Comprehensive Examples
« Reply #9 on: April 06, 2015, 09:14:28 PM »
Thank you sir.
In the Great Underground Empire (Zork port in development)
Winter Break 2012 Rope Prop Competition


SMF 2.0.14 | SMF © 2017, Simple Machines
Simple Audio Video Embedder

Page created in 0.19 seconds with 23 queries.