Charas-Project

Game Creation => Requests => Tutorials => Topic started by: The Gwaga Gmonk on June 25, 2004, 10:56:48 AM

Title: How to make a Monkey Island-esque inventory system
Post by: The Gwaga Gmonk on June 25, 2004, 10:56:48 AM
Heya! I'm The Gwaga Gmonk! You might remember my games such as the Gwaga Saga, the hfygs series and Chrome Tide (well, maybe not, since none of them have been released yet, but I'm working on them! Anywho...). So, here's a tutorial on how to make an inventory system like those in adventure games (Monkey Island, Broken Sword etc.).
If you don't know what these inventory systems are, it's basically like this:
The player opens up their inventory and picks an item. Now they are holding it. While holding an item, they interact differently with the surroundings, people and other items. Then back in the inventory screen, they can put the item back or try to combine it with other items.
NOTE: This takes a lot of switches and items. 2 items for every item you want (story items only) and a switch for each of those. You have been warned.

1st point of business: Making the Items
Okay, so first of all, make the items. Obviously, there will be a lot more, but for simplicity, we'll make three: A key, a book, and...a helicopter. Ahem.
Put the three as a switch event, with [Switch: Key Hold], [Switch: Book Hold] and so forth. Then make three new items; Key (Hold), Book (Hold) and Helicopter (Hold), or put a * next to their names, or something to indicate that they are being held. Put those as a switch item as well, with [Switch: Key LetGo] etc.

2nd point of business: Common Events
Now, go to Common Events (duh). Put in six events: Key Hold, Key LetGo, Book Hold and so on, each as parallel processes with the appropriate switch (like, Key Hold event would ned the Key Hold switch). In each of the Hold events, let's use Key Hold put:
Fork Condition-Item: Book (Hold) not got
Fork Condition-Item: Helicopter (Hold) not got
Add item-Key (Hold)
Drop item-Key
Change Switch-Key Hold-off
For each ELSE case, put:
Message-You cannot mix these items.
Then, in each LetGo event, let's use Key again, put in:
Drop Item-Key (Hold)
Add Item-Key
Change Switch-Key LetGo-off.

And there you have it! You will need to make more switches and items for each item you have, but that's the basic-ness of it!