Community

SCI Programming => SCI Syntax Help => Topic started by: MusicallyInspired on June 17, 2007, 10:56:59 PM

Title: "Look at <inventory item>"
Post by: MusicallyInspired on June 17, 2007, 10:56:59 PM
Is there something I'm missing? Does there have to be global said statements made for looking at every inventory object? As it is now the only way I can look at an object is to press TAB and click on the inventory item I have. typing "look at basket" gives me a general parser error message.
Title: Re: "Look at <inventory item>"
Post by: troflip on June 18, 2007, 02:04:05 AM
Well each inventory item has a said statement that identifies it.

There's a saidMe method on the inventory that should return the object which matches the thing the user said.

I tried putting this in handleEvent, but it didn't work:
Code: [Select]
       (var foo)
       (if(Said('look>'))
            (= foo (send gInv:saidMe))
            (if (IsObject(foo))
                Print((send foo:description))
            )

        )

Maybe someone else has an idea... I don't know why it's not working.  It should though...
Title: Re: "Look at <inventory item>"
Post by: MusicallyInspired on June 18, 2007, 02:36:45 PM
I have each inventory item identified in the Main script. Both the descriptions and the words that identify them if you type them. But it's like the game ignores it. If I type "look at basket" in another room it just gives the regular look message as if I typed "look <anyword>". I don't see any saidMe's anywhere, though.
Title: Re: "Look at <inventory item>"
Post by: troflip on June 18, 2007, 03:02:43 PM
Well yeah, what I'm saying is that there is no code that does this automatically - it needs to be written.

However, the inventory class seems to be set up for it, such that at least you wouldn't need to write separate Said statements for every item.

Maybe someone else who was done this will chime in.
Title: Re: "Look at <inventory item>"
Post by: MusicallyInspired on June 18, 2007, 06:27:51 PM
Ah, I see. Yes, if anyone's done this please fill us in. :)
Title: Re: "Look at <inventory item>"
Post by: MusicallyInspired on March 09, 2010, 02:33:41 PM
This is still an annoying problem if anyone has any ideas to rectify it.
Title: Re: "Look at <inventory item>"
Post by: Cloudee1 on May 03, 2010, 12:00:16 PM
My only suggestion would be to add in the look said statements to the main script. I think the said property in the items instance is strictly for use by the inventory script when it pulls up and references the list of items owned. The only problem with the main script additions, besides heap space, is that a rooms script might override it first.