User Tools

Site Tools


item_pickup_tutorial

This is an old revision of the document!


Item Pickups

(WIP)

This tutorial will explain how to set up map objects as items for the player to pick up, for example a key that the player can pick up by walking into/over it and then use to open a door or treasure chest.

Note: This tutorial assumes that you already understand the basics of using the RPG in a Box editors, in particular the Map Editor and Script Editor.

Creating the Object Model

Create model for key object (set as “passable”)

Optional: Default “floating” animation for key Creating a Simple Floating Animation

Create item definition for “Gold Key” in Item Editor

Optional: create sound effect for picking up key

Place object into map in desired location

Open properties dialog for object and assign an entity ID

Open properties dialog for object's tile and add quick script

set_entity_script(self, "");
remove_entity(entity["key_01"]);
play_sound("give_key");
give_item("Gold Key")

Finished! Save map and export game, player will now “pick up” key when walking onto the tile.

(GIF of player picking up key in-game)

item_pickup_tutorial.1520466416.txt.gz · Last modified: 2018/03/07 15:46 by justin