Skip to reading
Text & Sierra-Style Adventures

24. A room object is not a carried item

Edition 0.86.3.4

Build a complete text or graphical parser adventure with typed commands, inventory puzzles and press-to-walk controls.

Download PDFView PDF page

The key on the bench is a room object. The key in your bag is an Inventory Designer record. The controller joins those two representations when TAKE KEY succeeds.

Source table from 24. A room object is not a carried item, page 27
StateRoom modelPCA inventoryta_key_room
Before takingVisible in yardNo Brass Keylab
After takingHiddenBrass Key presentcarried
After dropping in cabinVisible in cabinNo Brass Keycabin

Create the Brass Key inventory record with ID brass_key and the Spare Fuse record with ID fuse. Start with an empty inventory. The controller uses Runtime.add_inventory and Runtime.remove_inventory, so ordinary inventory displays can show the same items.

TAKE checks whether the player already has the item. DROP removes it from real inventory and records the room where it was left. The matching placeholder becomes visible in that room. A later TAKE retrieves it.

The example gives each room a fixed drop placeholder. It does not drop a 3D model at the player’s exact feet. That would be a separate placement feature. For a text game, recording the correct room is usually enough.

Page 27 of 68Permalink
Go to page