This shows you the differences between two versions of the page.
Both sides previous revisionPrevious revisionNext revision | Previous revision | ||
item_container_tutorial [2017/12/06 08:41] – justin | item_container_tutorial [2017/12/06 13:51] (current) – justin | ||
---|---|---|---|
Line 2: | Line 2: | ||
---- | ---- | ||
- | This tutorial demonstrates how to add an item container to a map. For this walk-through, | + | This tutorial demonstrates how to add an [[item container]] to a [[map]]. For this walk-through, |
- | To begin, open the map that you want to add an item container to in the Map Editor and switch to Place Mode. | + | **Note:** This tutorial assumes that you already understand the basics of navigating around the [[Map Editor]]. |
+ | |||
+ | To begin, open the [[map]] that you want to add an [[item container]] to in the [[Map Editor]] and switch to "Place" mode. | ||
{{: | {{: | ||
- | Select the object that you want to be an item container from the resource selection | + | Select the [[object]] that you want to be an [[item container]] from the resource selection |
{{: | {{: | ||
- | Next, switch the Map Editor into Edit Mode so the necessary modifications can be made to the object. | + | Next, switch the [[Map Editor]] into "Edit" mode so the necessary modifications can be made to the [[object]]. |
{{: | {{: | ||
- | Right-click on your object and select Properties from the context menu. | + | Right-click on your [[object]] and select |
{{: | {{: | ||
- | In the Properties dialog, check the Item Container checkbox to indicate that you want to allow this object to contain items. Double-click any items that you wish to initially be within | + | In the Properties dialog, check the [[Item Container]] checkbox to indicate that you want this [[object]] to behave as a container. Double-click any [[item|items]] that you wish to initially be included in the [[item container]] - this will add them to the box on the right labelled |
- | + | ||
- | Note: You can also added a script to the object if you would like an event to occur when the player opens the item container. For example, you could play an opening animation for the object: | + | |
- | play_animation(self, | + | |
{{: | {{: | ||
- | If markers are enabled in the Map Editor, an item container marker (a "box" icon) will appear over the object to indicate that the object is now an item container. | + | **Note:** You can also add a [[script]] to the [[object]] to have an event occur when the [[player_character|player]] opens the [[item container]] and an "On Close" [[script]] for when the [[player_character|player]] closes the container window or steps away from it. For example, you could play an opening [[animation]] for the [[object|object' |
+ | <code lua> | ||
+ | play_animation(self, | ||
+ | </ | ||
+ | And a closing [[animation]] for the "On Close" [[script]] | ||
+ | <code lua> | ||
+ | play_animation(self, | ||
+ | </ | ||
+ | |||
+ | If markers are enabled in the [[Map Editor]], an [[item container]] marker ({{:wiki:box.png? | ||
{{: | {{: | ||
- | There is one more step to ensure that the player can interact with the item container. When I placed the treasure chest, the Map Editor removed any navigation/ | + | There is one more step to ensure that the [[player_character|player]] can interact with the [[item container]]. When I placed the treasure chest, the [[Map Editor]] removed any [[navigation_and_interaction|navigation paths]] to the [[tile]] that the chest is located |
+ | |||
+ | To do so, switch | ||
{{: | {{: | ||
- | s shown below, I have set the tile in front of the chest and to the left of the chest as Interact Only (displayed as orange | + | Select "Interact Only" |
+ | |||
{{: | {{: | ||
- | Save the map and then try out the item container | + | Save the [[map]], [[exporting_your_game|export the game]], |
+ | |||
+ | {{: |