Community

SCI Programming => Mega Tokyo SCI Archive => Topic started by: Jim C on November 28, 2003, 11:43:59 PM

Title: Quick question re: inventory
Post by: Jim C on November 28, 2003, 11:43:59 PM
Is there any way to remove an item from your inventory (e.g., after you've used it)? Thanks.
Title: Re:Quick question re: inventory
Post by: Doan Sephim on November 29, 2003, 12:19:50 AM
hey jim,

it's alot like this:

(if(Said('drop/key'))
    (if(send gEgo:has(INV_KEY))
            Print("OK")
            (send gEgo:put(INV_KEY))
    )(else
            Print("That would be easier if you had one to drop.")
    )
)

it's the same as getting really...just use the word "put" to lose it.
doan
Title: Re:Quick question re: inventory
Post by: Jim C on November 29, 2003, 11:01:33 AM
Oh, ok. Thanks so much. I must have tried every possible word except for "put".

You're very helpful!
Title: Re:Quick question re: inventory
Post by: Brian Provinciano on November 29, 2003, 01:31:35 PM
The reason it's "put" to drop an item is because the "get" function puts the item into the ego's inventory. The "put" function puts it to have a different owner. It could be called as (send gEgo:put(INV_SOMETHING newOwner)) to put it under newOwner. If only one parameter is specified, it simply sets it's owner to -1.

The help file describes this and more about all the other methods/classes/etc.