Search found 16 matches

by Tessa
Fri Aug 12, 2022 2:12 pm
Forum: Ren'Py Questions and Announcements
Topic: How do I show another screen from within an if/then statement in a screen?
Replies: 2
Views: 290

How do I show another screen from within an if/then statement in a screen?

Hi all. Struggling a bit with this. Say I have this bit of code in my screen. I have a button that checks the answer of a puzzle, and an if/then statement follows to either display a continue button if correct (no issue here), or show a "Wrong!" text if incorrect. However, I'd like the "Wrong!" text...
by Tessa
Wed Aug 10, 2022 8:40 pm
Forum: Ren'Py Questions and Announcements
Topic: New to Renpy development; basic questions about how to set up array of imagebuttons for puzzle minigame
Replies: 22
Views: 409

Re: New to Renpy development; basic questions about how to set up array of imagebuttons for puzzle minigame

Unrelated question. I have the game elements mostly set up and just need to polish it, so I'm looking at other areas of the VN that I still need set up. The last main area I haven't implemented is a journal screen to keep track of progress. I want this to be accessible in any scene in which I includ...
by Tessa
Tue Aug 09, 2022 9:40 pm
Forum: Ren'Py Questions and Announcements
Topic: New to Renpy development; basic questions about how to set up array of imagebuttons for puzzle minigame
Replies: 22
Views: 409

Re: New to Renpy development; basic questions about how to set up array of imagebuttons for puzzle minigame

Beautiful.

For the "Wrong!" text, is there a way to add a time delay and have the text disappear? E.g. "Wrong!" appears and disappears after 3 seconds.
by Tessa
Tue Aug 09, 2022 8:49 pm
Forum: Ren'Py Questions and Announcements
Topic: New to Renpy development; basic questions about how to set up array of imagebuttons for puzzle minigame
Replies: 22
Views: 409

Re: New to Renpy development; basic questions about how to set up array of imagebuttons for puzzle minigame

It works great once, but something odd happens: If you enter in the wrong answer, the button greys out and can't be interacted with until the correct answer is entered in. This means the player can't ever check the answer again manually until they have it correct. Technically this doesn't break the ...
by Tessa
Tue Aug 09, 2022 6:18 pm
Forum: Ren'Py Questions and Announcements
Topic: New to Renpy development; basic questions about how to set up array of imagebuttons for puzzle minigame
Replies: 22
Views: 409

Re: New to Renpy development; basic questions about how to set up array of imagebuttons for puzzle minigame

So I figured out how to implement a skip, but not so much figuring out how to check the answer within the screen to avoid restarting if it's wrong. What would you suggest?
by Tessa
Tue Aug 09, 2022 3:16 pm
Forum: Ren'Py Questions and Announcements
Topic: New to Renpy development; basic questions about how to set up array of imagebuttons for puzzle minigame
Replies: 22
Views: 409

Re: New to Renpy development; basic questions about how to set up array of imagebuttons for puzzle minigame

Working like a charm! Styling has worked quite well too, very pleased with the result! Another relatively minor question: Currently, the Get Results button leaves the minigame screen to check the result. If the result is incorrect, the only recourse is to jump back to the screen to try again, but th...
by Tessa
Tue Aug 09, 2022 12:20 pm
Forum: Ren'Py Questions and Announcements
Topic: New to Renpy development; basic questions about how to set up array of imagebuttons for puzzle minigame
Replies: 22
Views: 409

Re: New to Renpy development; basic questions about how to set up array of imagebuttons for puzzle minigame

Returning to the code for how it checks the answer: if res == ([ON, ON, ON], [OFF, OFF, ON], [OFF, ON, ON]): "Do something" Is there a way for the code to allow both OFF or X for the above check in the OFF segments? As in, the primary check is whether the ON segments, and ONLY the ON segments, are a...
by Tessa
Tue Aug 09, 2022 11:49 am
Forum: Ren'Py Questions and Announcements
Topic: New to Renpy development; basic questions about how to set up array of imagebuttons for puzzle minigame
Replies: 22
Views: 409

Re: New to Renpy development; basic questions about how to set up array of imagebuttons for puzzle minigame

It indeed worked again when I updated to Renpy 8.0.1 -- not sure why that's making a difference. Hopefully there are no unintended consequences of switching to it for everything else in the VN.
by Tessa
Tue Aug 09, 2022 11:35 am
Forum: Ren'Py Questions and Announcements
Topic: New to Renpy development; basic questions about how to set up array of imagebuttons for puzzle minigame
Replies: 22
Views: 409

Re: New to Renpy development; basic questions about how to set up array of imagebuttons for puzzle minigame

Those lines are indeed in the code, I copy/pasted the entirety of the code from before: # define the constants define OFF = 0 define ON = 1 define X = 2 screen minigame(xcount, ycount): # range constants default XRANGE = range(xcount) default YRANGE = range(ycount) default matrix = tuple([OFF for y ...
by Tessa
Tue Aug 09, 2022 2:22 am
Forum: Ren'Py Questions and Announcements
Topic: New to Renpy development; basic questions about how to set up array of imagebuttons for puzzle minigame
Replies: 22
Views: 409

Re: New to Renpy development; basic questions about how to set up array of imagebuttons for puzzle minigame

Sorry, back again with another question. I was testing everything before on a different PC from the one I'm developing the VN on. When I tried duplicating it in a new project on this PC, there's an error I didn't get before: NameError: global name 'YRANGE' is not defined Any thoughts? Why would it s...
by Tessa
Mon Aug 08, 2022 10:11 pm
Forum: Ren'Py Questions and Announcements
Topic: New to Renpy development; basic questions about how to set up array of imagebuttons for puzzle minigame
Replies: 22
Views: 409

Re: New to Renpy development; basic questions about how to set up array of imagebuttons for puzzle minigame

It just clicked for me that the textbutton is driving the cell width, not the matrix itself. It was just a matter of adding xminimum 60 and yminimum 60 to the button. Thank you SO MUCH for your help!
by Tessa
Mon Aug 08, 2022 9:56 pm
Forum: Ren'Py Questions and Announcements
Topic: New to Renpy development; basic questions about how to set up array of imagebuttons for puzzle minigame
Replies: 22
Views: 409

Re: New to Renpy development; basic questions about how to set up array of imagebuttons for puzzle minigame

When I try to substitute in your snippet of image-related code into the original code, it errors out. What am I missing? Sorry for asking what might seem like obvious questions to you :| NameError: name 'txt' is not defined # define the constants define OFF = 0 define ON = 1 define X = 2 screen mini...
by Tessa
Mon Aug 08, 2022 9:33 pm
Forum: Ren'Py Questions and Announcements
Topic: New to Renpy development; basic questions about how to set up array of imagebuttons for puzzle minigame
Replies: 22
Views: 409

Re: New to Renpy development; basic questions about how to set up array of imagebuttons for puzzle minigame

Appending my previous response, after messing with your code a bit: More so than just the images in the cells, I'd basically need to tile over the core code here with a fancy UI/UX: - Images with hover states for the cells - each cell is 60px by 60 px, and each of the three states has its own pair o...
by Tessa
Mon Aug 08, 2022 9:16 pm
Forum: Ren'Py Questions and Announcements
Topic: New to Renpy development; basic questions about how to set up array of imagebuttons for puzzle minigame
Replies: 22
Views: 409

Re: New to Renpy development; basic questions about how to set up array of imagebuttons for puzzle minigame

Precisely! So how would I go about replacing the text with square images (can I set hover states using this code too)? And how would I have the code check for the correct combination? Say for a 3x3 matrix, the "correct" combination is: ON ON ON OFF OFF ON OFF ON ON Edit: I just saw the last line, th...