Community

SCI Programming => SCI Community How To's & Tutorials => Topic started by: gumby on November 27, 2010, 03:48:02 PM

Title: Advanced Said() Strings - Part 2 - Qualifying Adjectives
Post by: gumby on November 27, 2010, 03:48:02 PM
Qualifying adjectives:

Code: [Select]
(if(Said('take/key<gold'))
      Print("Ahh!  The gold key!")
)

(if(Said('take/key<silver'))
      Print("Ahh!  The silver key!")
)

(if(Said('take/key'))
      Print("Which key do you mean, the silver or the gold key?")
)

This example forces the user to use the correct adjective in order to pick up a key.  If the user does not, it falls through to the last rule which tells the user that they must be more specific.
Title: Re: Advanced Said() Strings - Part 2
Post by: Cloudee1 on November 27, 2010, 09:09:51 PM
Why the hell did it take 5 years to get this syntax right? It certainly looks simple enough. I assume this would also work for top/bottom drawer or red/green door. I spent days trying to get top and bottom drawer to work, only to ultimately give up and go with one drawer.
Title: Re: Advanced Said() Strings - Part 2
Post by: gumby on November 28, 2010, 04:02:00 PM
Why the hell did it take 5 years to get this syntax right? It certainly looks simple enough. I assume this would also work for top/bottom drawer or red/green door. I spent days trying to get top and bottom drawer to work, only to ultimately give up and go with one drawer.
Yes, it will work with any adjective.  Honestly, I found the syntax here in the tutorials (I think).  Or it might have been in the Studio help files.  Or it was from Lars' parser documentation at the FreeSCI site...

Now admittedly, I had to bumble around for a few hours before I got it working.  But I think most of us work off of examples (I know I do) - 'straight-up' syntax docs sometimes can be too much to digest.
Title: Re: Advanced Said() Strings - Part 2
Post by: MusicallyInspired on November 28, 2010, 10:38:55 PM
I believe you found an example in an area of the Studio help file that had nothing to do with syntax at all. It's still so bizarre to me why Brian never documented this stuff and why nobody ever asked.
Title: Re: Advanced Said() Strings - Part 2
Post by: Cloudee1 on November 28, 2010, 10:55:22 PM
Oh no, I asked. If the MT archives were still here, they are in there. Alot of the questions Bri answered, Either I didn't get it or something. I remember this one changestate in spongebob that was kicking my ass. Ultimately I gave up and took a different route.    Oh weel small consolation that now there is no changestate troubles. I think that has more to do with companion though than me.
Title: Re: Advanced Said() Strings - Part 2 - Qualifying Adjectives
Post by: stateofpsychosis on December 11, 2014, 09:41:32 AM
oh this method works soooo much better than this one: http://sciprogramming.com/community/index.php/topic,351.html


MAJOR major kudos to you sir.

late response :P
Title: Re: Advanced Said() Strings - Part 2 - Qualifying Adjectives
Post by: Cloudee1 on January 21, 2015, 01:49:44 PM
Added to tutorials > SCI > Your first game > Handling the Player's "Said" Input