Community

SCI Programming => SCI Syntax Help => Topic started by: gumby on March 23, 2017, 08:27:21 PM

Title: Drop inventory item (SCI 1.1)
Post by: gumby on March 23, 2017, 08:27:21 PM
I have chosen an item from my inventory and I want to drop it in a room.  The item is selected from inventory and the mouse cursor is changed to represent the item the ego is holding. 

Here's what I have in the doVerb method (conditional logic removed for clarity):
Code: [Select]
   (gEgo put: INV_LEAFLET)   ;Remove item from inventory
   (leaflet show:)                     ;Display the prop in the room

What I can't seem to figure out is how to get the mouse cursor (a leaflet) to change back to say the look or walk icon & have the verb change as well.  I can set the cursor manually:

Code: [Select]
   (gGame setCursor: 996 1)

But that doesn't change the verb, and I'm sure this isn't the right way to be doing this. What am I missing here?
Title: Re: Drop inventory item (SCI 1.1)
Post by: Kawa on March 23, 2017, 09:02:42 PM
Off the top of my head, what about (icon0 select:)? Assuming icon0 is walk.
Title: Re: Drop inventory item (SCI 1.1)
Post by: gumby on March 23, 2017, 09:16:41 PM
I figured it out, though not sure if it's the best way:

Code: [Select]
   (gGame handsOff:)
   (gEgo put: INV_LEAFLET)   ;Remove item from inventory
   (leaflet show:)                     ;Display the prop in the room
   (gGame handsOn:)

If I dig into those methods in the Main script I can probably make it simpler.