Author Topic: Question re: SCI Studio Help code snippet  (Read 3697 times)

0 Members and 1 Guest are viewing this topic.

Offline gumby

Question re: SCI Studio Help code snippet
« on: August 22, 2010, 10:30:24 PM »
While going through the SCI Studio help files, I ran into this under the 'Properties' subject
Code: [Select]
(instance {Glowing Gem} of InventoryItem
  (properties
    said '~ gem [ AND glowing ] ~'
    description "You are still carrying the piece of orium"
    view 242
    someVarAddr @SomeVar
  )
)
So, my question is specifically regarding the use of the 'said' reference as a property.  Could someone shed some light as to what it does & when it's used within the context of an instance?  I've only seen said strings immediately after a Parse() event within an event handling method.  Furthermore, I've never seen the '~' character in a said string either - is this some sort of wildcard match?


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

Offline Cloudee1

Re: Question re: SCI Studio Help code snippet
« Reply #1 on: August 23, 2010, 11:27:33 AM »
I think the said you are referring to is used by the inv script as what you put  there is the same word/phrase that populates the inventory list when you press tab.
Halloween Competition Brass Lantern Prop Competition Groundhog Day Competition

Offline MusicallyInspired

Re: Question re: SCI Studio Help code snippet
« Reply #2 on: August 23, 2010, 12:25:56 PM »
Hey! Maybe that has something to do with the said words in the Inv script for each inventory obeject that didn't ever seem to do anything! You can't just type "look at gem" if you have it in your inventory. You have to actually open your inventory window and select it to look at it. I was going to program a bunch of global said statement procedures to get it to work.

Brian! Why didn't you document these things????
Brass Lantern Prop Competition

Offline gumby

Re: Question re: SCI Studio Help code snippet
« Reply #3 on: August 23, 2010, 10:15:32 PM »
Ah, that explains it.  I haven't even gotten to the inventory yet in my development.  Crap, and if I had paid more attention I would have noticed this was an inventory item instance!  So what about the said string?  Is that the literal text that will be displayed when you look at the item in the inventory interface?  It certainly looks like it contains logic of some sort.
In the Great Underground Empire (Zork port in development)
Winter Break 2012 Rope Prop Competition

Offline MusicallyInspired

Re: Question re: SCI Studio Help code snippet
« Reply #4 on: August 24, 2010, 11:31:37 PM »
I think it's the string which defines an inventory object when you try to interact with it with the parser. So "look gem" and "look glowing gem" will function. Otherwise it won't work (which it doesn't for any of my current inventory items in KQ2SCI). Also, Inventory items are somehow tied to props which can be on the screen. The way Brian did it (or Sierra?) was that a player could drop an inventory object and it would appear on screen. So there might be some kind of shared script stuff there....as opposed to the natural way I'd look at it as completely separate bits of code that look like they belong together to the player.

I don't know if I'm making any sense.

A little snip from the SCI Studio help file regarding the InvI class:

Quote
bool saidMe()
Returns TRUE is the user's input "Said" the name of the inventory item. Otherwise, FALSE.
 

This doesn't seem to work in the template game even if the said property is defined.
« Last Edit: August 24, 2010, 11:43:32 PM by MusicallyInspired »
Brass Lantern Prop Competition

Offline MusicallyInspired

Re: Question re: SCI Studio Help code snippet
« Reply #5 on: August 26, 2010, 11:41:03 AM »
I just tried compiling my Main script with  inventory instances that use a similar Said property and it failed saying that "~" and "AND" aren't in the vocabulary. Strange.
Brass Lantern Prop Competition


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

Page created in 0.029 seconds with 23 queries.