Community
SCI Programming => SCI Syntax Help => Topic started by: gumby on August 22, 2010, 10:30:24 PM
-
While going through the SCI Studio help files, I ran into this under the 'Properties' subject
(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?
-
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.
-
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????
-
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.
-
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:
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.
-
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.