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 11:50] – justin | item_container_tutorial [2017/12/06 13:51] (current) – justin | ||
---|---|---|---|
Line 22: | Line 22: | ||
{{: | {{: | ||
- | In the Properties dialog, check the [[Item Container]] checkbox to indicate that you want to allow this [[object]] to contain [[item|items]]. 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 "Items in Container" | + | 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 "Items in 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' | + | **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> | <code lua> | ||
play_animation(self, | play_animation(self, | ||
Line 39: | Line 39: | ||
{{: | {{: | ||
- | 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]], |
+ | |||
+ | {{: |