Mercurial > qqw-wiki
changeset 603:bd10d215035c draft
Undo of change 4 of page items
| author | 213.17.226.11 |
|---|---|
| date | Wed, 31 Jul 2013 11:11:27 +0200 |
| parents | c63b1d8424af |
| children | c7ea457b1e3d |
| files | items |
| diffstat | 1 files changed, 60 insertions(+), 1 deletions(-) [+] |
line wrap: on
line diff
--- a/items Wed Jul 31 11:11:12 2013 +0200 +++ b/items Wed Jul 31 11:11:27 2013 +0200 @@ -1,1 +1,60 @@ -Many thanks for the nice welbog. It was really useful for me. Keep sharing such ideas within the future as well. This was actually what I was looking for, and I am glad to came here! Many thanks for sharing the such information with us \ No newline at end of file +You can now add items to your maps. It is possible to carry an item to another map. For now, you can make locked doors, quest-giving NPCs and treasure chests. + +== Giving items == +Any tile can give an item to the player when that player steps on it. To do that, simply put a "give" attribute in the tile's definition: + +{{{ +[c] +tile = . +sprite = chest.png +give = treasure +}}} + +You can use any name you want. As soon as the player steps on that tile or bumps into it, the item will be added to the inventory. + +== Disappearing and changing shape == +Sometimes you want the item to disappear from the map after being picked up, or the chest to change its graphics to an open chest. You can do it with the "give_sprite" parameter: + +{{{ +[c] +tile = . +sprite = chest.png +give = treasure +give_sprite = open_chest.png +}}} + +If the parameter contains a name of a sprite image, the sprite will change its looks into that. If the parameter is empty, the sprite will be removed. + +{{{ +[k] +tile = . +sprite = key.png +give = key +give_sprite = +}}} + +You can also change the message that the tile displays by using "give_message". + + +== Locked == +There is little sense in collecting items if you can't do anything with them. For now all you can do with items is unlocking things. If you use the "unlock" parameter in a tile definition, it will be only passable when the player has the specified item. You can also add an "unlock_sprite" parameter, to make the sprite change its looks when the player unlocks it, and "unlock_message" to change the message. + +{{{ +[B] +tile = . +sprite = locked.png +unlock = key +give_sprite = open_bars.png +}}} + +You can combine the "give" and "unlock" parameters -- the item will not be given until the tile is unlocked. + +{{{ +[c] +tile = . +sprite = chest.png +give = treasure +give_sprite = open_chest.png +unlock = key +give_sprite = open_chest.png +}}}
