I've been racking my brain all day trying to figure out how to do this, but I'm new to Renpy and python in general, and I really don't have a good sense of how to even search for answers and I could use some guidance.
Here's my goal:
During the VN, a minigame is triggered. This is a logic puzzle, with an array of imagebuttons that can be toggled into three states: OFF, ON, and X, each with their own idle and hover images (e.g. on is highlighted, off is dark, X is...an X). When the VN calls the minigame screen, I need the game screen to generate, say, a 6x6 matrix of square buttons that are initially in the OFF state. Then, the player can click each button to cycle it through from OFF to ON, and again from ON to X, and again from X to OFF, as much as they'd like. When the correct combination is selected (the logic puzzle itself is unimportant here), the game is won and the VN proceeds.
Here's my problem:
I have no idea what I'm doing. I tried following this tutorial initially: https://youtu.be/nvMP9g1drjM, to get the overall structure into a test game so I could divert into my own minigame structure, but as soon as I get to the point where I'm trying to generate interactive elements (buttons), it all falls apart and I can't get it to work.
So I started over in a blank project and simply tried creating a single image button that I could toggle between these three states, and I can't figure this basic problem out either. I don't really understand the syntax or structure I need to achieve it.
Code: Select all
screen GameWindow1:
if tilecurrent_1 == 0:
$idle_1 = "images/tile_off_idle.png"
$hover_1 = "images/tile_off_hover.png"
elif tilecurrent_1 == 2:
$idle_1 = "images/tile_on_idle.png"
$hover_1 = "images/tile_on_hover.png"
elif tilecurrent_1 == 3:
$idle_1 = "images/tile_mark_idle.png"
$hover_1 = "images/tile_mark_hover.png"
imagebutton:
idle idle_1
hover hover_1
if tilecurrent_1 == 0:
action Jump("Cell1_0")
elif tilecurrent_1 == 1:
action Jump("Cell1_1")
elif tilecurrent_1 ==2:
action Jump("Cell1_2")
label Cell1_0:
$tilecurrent_1 = 1
label Cell1_1:
$tilecurrent_1 = 2
label Cell1_2:
$tilecurrent_1 = 0
label start:
$tilecurrent_1 = 0
scene background1
"Click to call game window."
call screen GameWindow1
return
Where do I begin here? Are there any good tutorials you can link me to? I've been googling all day but can't seem to wrap my head around it just yet.
Thank you.