Translations of this page:

This is an old revision of the document!
—-

6. Working with inventory

In this chapter we’ll focus on work with the inventory. As there will be a lot of issues to cover, we should hop straight to it.

First let’s clarify, what inventory is. One of the typical adventure game aspects is the ability to collect various junk lying around in the game world and by using it on other junk player achieves ultimate goals. Also sometimes you might want to strike back and use the inventory junk (referred as items) on something in the game world.

WME has excellent support for inventory including combining items and item stocking. WME also supports multiple inventories in case you’d have more than one main actor or you’d want to include trading in your game.

Inventory has two main definition files:

  1. Inventory box definition - defines the place where your inventory will be stored. It consists of rectangular areas and scrollbars used to navigate in your inventory.
  2. Inventory items definition – defines individual items and attached scripts so you can set up necessary interactions.

Both files are assigned in the Project Manager and we’ve discussed them earlier but to recap, they’re inventory.def file and items.items file. Of course you can name it however you like, but let’s stick for now with the items at hand.

Before we start with that, copy somewhere contents of the resource for chapter 5. It consists of the blank project we discussed earlier and we’re going to eventually build a simple game on top of those files.

So let’s start with a inventory box definition. We’re going to base our interface upon the image inventory.bmp located in data/interface folder. The image looks like that


 
wmebook/ch6.1196944950.txt.gz · Last modified: 2007/12/06 13:42 by metamorphium
Recent changes RSS feed Creative Commons License Driven by DokuWiki