Here is the next question in my Solarus quest! Thanks for all of the help so far. Hopefully the more help one receives, the less one will need (maybe) but at the very least these questions will be logged for the needs of future users.
So today I am making a chest to open a door. This will be the very first room of the game, where possession of the tunic will be set to 0 and you receive the first tunic variant before you can exit the room. This will of course require some custom non-tunic Link sprites but that is not the purpose of this post. I am using the basics tutorial #32 ("doors") as a guide.
So if I have the chest in "clothes_chest" and the exit door is "exit_door" with the clothing savegame variable in "green_tunic", then use this script:
function clothes_chest:on_opened(tunic, 1, green_tunic)
map:open_doors("exit_door")
sol.audio.play_sound("door_open")
end
The tunic is given but the door does not open. However if I make a slight alteration by deleting the variant in the first line:
function clothes_chest:on_opened(tunic, green_tunic)
map:open_doors("exit_door")
sol.audio.play_sound("door_open")
end
The door will open, but the hero gets paused permanently at the chest, and the tunic is not given.