Welcome, Guest. Please login or register.
May 21, 2019, 11:50:25 PM
Home  >  Tutorials  >  Chapter 6: A couple of loose ends with our Inventory Room
Chapter 6: A couple of loose ends with our Inventory Room

This chapter deals with tidying up a couple of loose ends in regards to our point and click inventory room.

Pic Resource

I know I haven't mentionned it until now, but you will of course need a room picture. Well since our scriptNumber is 500, and our view resources are saved as 500, and the text is saved as 500, can you guess what number I want you to make your picture, yeah that's right 500. I suppose I'll be nice for once, you can just download mine if you want.

Inventory Items at Start

I suppose you'd probably like to have these or possbily other inventory items in your pocket as soon as you start the game. Luckily, this only requires one quick little edit, specifically in the InitRooms script.

In the (init) method, find the bit about the gEgo

 (send gEgo:
    posn(-1 -1)
    setStep(1 1)
    setMotion(MoveTo 3000 100)

Simply add this line somewhere inside that

  get(1) get(2) get(3)// cash, balloon, string

And now that's done, you will now have the inventory items as soon as the game starts.

Keyboard Shortcut (tab) and the Menu Inventory selector

So you have made all the cursors, texts, views, and scripts that I've told you to make, and I suppose that now you want to see it in action. Until we actually create our own point and click menu, you might find that it is actually kind of a pain in the butt to get into that room. Well don't worry, I wouldn't leave you hanging like that. With one small edit to the inv script you'll be tying that string onto the balloon in no time.

Open up the inv script and around line 70, you should find this

(method (showSelf theOwner)

Simply change that into this

(method (showSelf theOwner)
// (invD:
//     text(carrying)
//     doit(theOwner)
// )
   (if(== canTab TRUE)
   = gPreviousCursor gCurrentCursor
   (send gRoom:newRoom(500))

And there you go, now you can enter your new point and click inventory room by either pressing the tab button or by selecting inventory from the menu options. So until we get the rest of the game converted to point and click, at least you have that much.

That sums up all the loose ends regarding our point and click inventory room that I know of.
<< Prev Back to Tutorials Next >>

The SCI Programming Community
Copyright © 2007 - 2019, All Rights Reserved.