Community

SCI Programming => Mega Tokyo SCI Archive => Topic started by: FastaKilla on April 09, 2003, 06:58:21 PM

Title: I have 2 problems, maybe more
Post by: FastaKilla on April 09, 2003, 06:58:21 PM
1. I don't know how to have it bring up the inventory item view when you type 'look/pumpkin'
I have the 'pumpkin' item working, I followed the tutorial.  It is something in the global said statements in the main script right?  Does it use InspectObj or something else?
At the bottom of main script I have
(instance {pumpkin} of Iitem
   (properties
      said 'pumpkin'
      description
             "This is a pumpkin."
      view 14
   )
)


2. I have a view of a person, and I have a close-up pic and I have that working ok.  The view disappears when I type 'back' though and go back to the room.  It comes back if I leave the room and come back though.
Also, how can I get the view to play loop 2 when I type 'talk/man'  ?  (loop 1 is a still pic, loop 2 is the animation of him talking)
Title: Re:I have 2 problems, maybe more
Post by: Eric Grygier on April 09, 2003, 10:05:21 PM
1. Did you put something like this in the header file?:
// Inventory Items
(define INV_ Pumpkin          0)// save don't compile

Title: Re:I have 2 problems, maybe more
Post by: FastaKilla on April 10, 2003, 12:57:25 PM
Yes, I already did that, in game.sh (that's the header file, right?)  I have

// Inventory Items
(define INV_NOTHING           0)
(define INV_PUMPKIN           1)
Title: Re:I have 2 problems, maybe more
Post by: Eric Grygier on April 10, 2003, 05:56:41 PM
1. Yes, it is. It should be working. Are you testing this through a saved game? You need to reenter the room or start a new game, if you made changes to the script.
Title: Re:I have 2 problems, maybe more
Post by: Wilco on April 10, 2003, 06:32:25 PM
Make sure you compile each and every script that you made changes to before you re-enter your game! I found this out the hard way - was having lots of problems because I wasn't saving pictures and scripts to the resource properly.
Title: Re:I have 2 problems, maybe more
Post by: FastaKilla on April 10, 2003, 07:18:28 PM
I compile and rebuild all the time.  That's not the problem.  Do I have to change something from the INV script?
Title: Re:I have 2 problems, maybe more
Post by: FastaKilla on April 10, 2003, 07:42:38 PM
Should I just make an icon print?

I can have 'look/pumpkin' for the room and use if/else for whether or not you have it or not, then make a global 'look/pumpkin' in the main script and use another if/else.  Then if you do have the pumpkin use an icon print.  Should I just try that?
Title: Re:I have 2 problems, maybe more
Post by: Wilco on April 10, 2003, 08:28:48 PM
how can I get the view to play loop 2 when I type 'talk/man'  ?  (loop 1 is a still pic, loop 2 is the animation of him talking)

I'm also just experimenting with this only now, but what I did last night was put another instance using the same view at the bottom of my roomScript, but set it to loop 2 of that view. Then you can call this instance from within an "if(Said" statment to initialise it. Of course the man will have to be temporarily hidden, so I inserted a "hide()" statement. Something like this:

(if(Said('talk/man))
  (aMan2:
    init()
    setCycle(End)
    setSpeed(2)
  )
  (aMan:hid())
)

But this is just my solution, I still haven't figured out how to make the initial character reappear after my animation has finished.
Title: Re:I have 2 problems, maybe more
Post by: FastaKilla on April 16, 2003, 01:05:32 PM
I made icon prints for the items, so that is out of the way, but I have another question.
What do you type to take something out of your inventory? like the opposite of

(send gEgo:get(INV_PUMPKIN))

Will this be a problem though?  Won't it mess up everything I have such as

(if(Said('look/pumpkin'))
            (if(send gEgo:has(INV_PUMPKIN))
            Print(
                "This is a pumpkin."
                #title "Pumpkin"
                #icon 14 0 0
            )
            )(else
                Print("There is a weird looking pumpkin on the ground.")
            )
        )
Title: Re:I have 2 problems, maybe more
Post by: Eigen on April 16, 2003, 01:33:24 PM
To drop an inventory object:

(send gEgo:put(INV_PUMPKIN))



-Eigen
Title: Re:I have 2 problems, maybe more
Post by: Brian Provinciano on April 16, 2003, 04:21:43 PM
The reason "look <item>" is not automatic is because most sierra games have custom messages and events on the "look" phrases.
Title: Re:I have 2 problems, maybe more
Post by: FastaKilla on April 16, 2003, 10:32:54 PM
Thanks.
Title: Re:I have 2 problems, maybe more
Post by: FastaKilla on April 20, 2003, 09:09:17 PM
Now I have more questions.  First, how can I have it go to a room, play the loop of a view just once, then go back to the original room?  For an example, you can use

view.026
original room pic.026  (same script #)
pic with animation pic.027
trigger for playing animation is 'look/glass'

I want you to be able to do this only once.
Also, I think I'll need to type these, but where in the script would I put them?
ProgramControl()
Code:PlayerControl()


My other question is about 2-word things.
How can I have something like baking soda in the vocab?