24. A room object is not a carried item
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.
| State | Room model | PCA inventory | ta_key_room |
|---|---|---|---|
| Before taking | Visible in yard | No Brass Key | lab |
| After taking | Hidden | Brass Key present | carried |
| After dropping in cabin | Visible in cabin | No Brass Key | cabin |
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.
