I'm interested in having a system like the Professor Layton games, where the player can wander from location to location and click on characters to trigger a conversation with them. Because I want characters to be able to move from one location to another, and either overlap or have foreground objects overlap them, I think imagebuttons are the best (or only) solution. I have the basic code working after much crashing (as in, Ren'Py stopped responding when calling a label and had to be shut down) but I think it's time to look for expertise in learning to improve things.
Basically, I wonder what people suggest for setting up a bunch of imagebuttons that share a lot of similar properties, especially for characters which could have different expressions, different positions on different scenes, etc. Has anyone done something similar?
My crash, for the record. Here's the code I've used:
Code: Select all
screen button_1:
modal False
zorder 2
imagebutton:
xpos 20 ypos 430
auto "button_1_%s.png"
action [SetVariable("button_1_press", True), Hide("button_1"), Jump("button_1_result")]
screen button_2:
modal False
zorder 0
imagebutton:
xpos 40 ypos 300
auto "button_2_%s.png"
action [SetVariable("button_2_press", True), Hide("button_2"), Jump("button_2_result")]
label image_button_exp:
label room:
show imagemap ground
if not button_1_press:
show screen button_1
if not button_2_press:
show screen button_2
# whatever else happens in this room
$ renpy.pause()
jump room
label button_1_result:
e "You pressed button 1!"
return
label button_2_result:
e "You pressed button 2!"
return
Code: Select all
$ renpy.pause()