Possible Actionbutton/Transform glitch? [SOLVED]

Discuss how to use the Ren'Py engine to create visual novels and story-based games. New releases are announced in this section.
Forum rules
This is the right place for Ren'Py help. Please ask one question per thread, use a descriptive subject like 'NotFound error in option.rpy' , and include all the relevant information - especially any relevant code and traceback messages. Use the code tag to format scripts.
Post Reply
Message
Author
User avatar
OddTillTheEnd
Regular
Posts: 43
Joined: Wed Jun 04, 2014 3:45 pm
Completed: Broken Minds (2017), Prison of Lies (2019), Methods (2020), Catalyst Wake (2021)
Projects: JPDE2: Adagio of Darkness (Early access), Blankspace (2020), The Elevator Game with Catgirls
Organization: LockedOn Games
Soundcloud: OddTillTheEnd
itch: lockedon
Contact:

Possible Actionbutton/Transform glitch? [SOLVED]

#1 Post by OddTillTheEnd »

Hello! :)
The following code results in the Transforms I'm applying to each actionbutton sometimes not working at all on one or more buttons. More worryingly, since I'm doing multiple-choice-type minigames this way, the correct choice will often be the transform that isn't working.
After some testing, this appears to only affect text-based images defined purely in Ren'py, as you see below. When I'm using normal images all the transforms work fine.
Is this because of my bad coding skill or because of a glitch?

Code: Select all

transform mytransform:
        on hover:
            zoom 1.04
            easeout 0.5 zoom 1.02
            easein 0.5 zoom 1.04

image choice1:
    Text("CHOICE 1", text_align=0.5)
    alpha 0
    easein 0.8 alpha 1

image choice2:
    Text("CHOICE 2", text_align=0.5)
    alpha 0
    easein 0.8 alpha 1

image choice3:
    Text("CHOICE 3", text_align=0.5)
    alpha 0
    easein 0.8 alpha 1

screen MyScreen:
    imagebutton xalign 0.5 yalign 0.2:
                    idle ("choice1")
                    hover ("choice1")
                    focus_mask None
                    action [SetVariable("myvariable", True)]
                    at mytransform
    imagebutton xalign 0.5 yalign 0.5:
                    idle ("choice2")
                    hover ("choice2")
                    focus_mask None
                    action [SetVariable("myvariable", False)]
                    at mytransform
    imagebutton xalign 0.5 yalign 0.7:
                    idle ("choice3")
                    hover ("choice3")
                    focus_mask None
                    action [SetVariable("myvariable", False)]
                    at mytransform
Any help would be very much appreciated. :)

— Odd.
Last edited by OddTillTheEnd on Sat Jul 01, 2017 8:53 am, edited 1 time in total.

User avatar
OddTillTheEnd
Regular
Posts: 43
Joined: Wed Jun 04, 2014 3:45 pm
Completed: Broken Minds (2017), Prison of Lies (2019), Methods (2020), Catalyst Wake (2021)
Projects: JPDE2: Adagio of Darkness (Early access), Blankspace (2020), The Elevator Game with Catgirls
Organization: LockedOn Games
Soundcloud: OddTillTheEnd
itch: lockedon
Contact:

Re: Possible Actionbutton/Transform glitch?

#2 Post by OddTillTheEnd »

I figured it might help if I made a demo of the issue:

https://www.dropbox.com/s/ytq2psnyfnyyb ... e.zip?dl=0

Let me know if it works okay.

— Odd.

philat
Eileen-Class Veteran
Posts: 1910
Joined: Wed Dec 04, 2013 12:33 pm
Contact:

Re: Possible Actionbutton/Transform glitch?

#3 Post by philat »

Buttons are inactive (= cannot be hovered or selected) if the action is impossible or already fulfilled -- i.e., since myvariable is already False, there's no point to setting it to False, so choices 2 and 3 are inactive. If you try it with myvariable defaulting to None, all three choices will be active. This would be easier to see if you used the default buttons to test, since those are grayed out if inactive.

User avatar
OddTillTheEnd
Regular
Posts: 43
Joined: Wed Jun 04, 2014 3:45 pm
Completed: Broken Minds (2017), Prison of Lies (2019), Methods (2020), Catalyst Wake (2021)
Projects: JPDE2: Adagio of Darkness (Early access), Blankspace (2020), The Elevator Game with Catgirls
Organization: LockedOn Games
Soundcloud: OddTillTheEnd
itch: lockedon
Contact:

Re: Possible Actionbutton/Transform glitch?

#4 Post by OddTillTheEnd »

philat wrote:Buttons are inactive (= cannot be hovered or selected) if the action is impossible or already fulfilled -- i.e., since myvariable is already False, there's no point to setting it to False, so choices 2 and 3 are inactive. If you try it with myvariable defaulting to None, all three choices will be active. This would be easier to see if you used the default buttons to test, since those are grayed out if inactive.
Wow, thank you so much!
I'm so happy the solution doesn't require hours of recoding... I was really afraid of that haha. :)

Thanks again,
— Odd.

Post Reply

Who is online

Users browsing this forum: Ahrefs [Bot]