All you need is an empty room graphic, and one or more locked objects (1-5 per screen) with associated images following the file name convention described in lockpicking.rpy (look at the included graphics for examples):
Code: Select all
images/yourobject_closed.png
images/yourobject_hover.png
images/yourobject_open.png
images/yourobject_open_hover.png
Code: Select all
default yourobject_have_key = False #unless the player DOES HAVE THE KEY for that object
default yourobject_opened = False #until the player has opened it successfully
default yourobject_lock = Lock(##, ##) #the first number is the difficulty 1-29, lower numbers are more difficult,
the second is the "loot" which is not really used in this script,
but if you want to give the player something, that's where you'd put it.
Code: Select all
show screen click_chest("yourobject", _layer="master")
or for multiple objects:
show screen click_chest("yourobject", "yourotherobject", _layer="master")
I tried to comment the code pretty clearly, so I hope everything makes sense! This code is based HEAVILY on trooper6's Analogue Clock code, which is probably the first place to look to do the sound effects better than I did. All code, images, and sound effects in this demo are licensed under a Creative Commons 0 Public Domain license, so take them, modify them, use them however you want.
PLEASE DO improve upon this code, and post it here. I'm pretty new to coding, and there's always a better way (than what I did).