Bug With Button? And Transition Animation ? [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
pratomoastan
Regular
Posts: 39
Joined: Fri Mar 11, 2016 11:39 am
Projects: My High School Life
Organization: After School Things
Deviantart: pratomoastan
Location: Indonesia
Contact:

Bug With Button? And Transition Animation ? [SOLVED]

#1 Post by pratomoastan » Wed Jun 15, 2016 1:32 pm

Umm Why,
When I Click This Button Something Went Wrong With The Button Animation.
This also happend to my home screen but with diffrent button layout instead use

Code: Select all

has vbox
i use

Code: Select all

has hbox

Code: Select all

screen othperfs():
    tag menu
    # The background of the game menu.
    window:
        style "gm_root"

    # The various buttons.
    frame:
        style_group "gm_nav"
        xalign .98
        yalign .98
        
        has vbox 
        
        #textbutton _("Preferences") action ShowMenu("preferences")
        #textbutton _("Save Game") action ShowMenu("save")
        #textbutton _("Load Game") action ShowMenu("load")
        textbutton ("Music Room") action ShowMenu("music_room")
        textbutton _("Credits") action ShowMenu("credits")
        textbutton _("Help") action Help()
        
        spacing 0
        null height 20
        
        textbutton _("Back") action ShowMenu ("preferences") 

Also At The Music Room I Also Have A Problem -.- There 1 Button That I Cant Click :

The Code Is :

Code: Select all

init python:

    mr2 = MusicRoom(fadeout=1.0)

    mr2.add("music/floatingcity.ogg", always_unlocked=True)
    mr2.add("music/great.ogg")
    mr2.add("music/cots.ogg")

screen music_room2:

    tag menu

    window:
        background "images/system/mroom.png"

    frame:
        style_group "gm_nav"
        xalign .98
        yalign .98
        
        has vbox

        textbutton "Floating City" action mr2.Play("music/floatingcity.ogg")
        textbutton "Great" action mr2.Play("music/great.ogg")
        textbutton "Curse" action mr2.Play("music/cots.ogg")

        null height 20

        textbutton "Next" action mr2.Next()
        textbutton "Previous" action mr2.Previous()

        null height 20

        textbutton _("Back") action ShowMenu ("music_room")

    on "replace" action mr2.Play()

    on "replaced" action Play("music", "music/mnutheme.ogg")

Also in the credits screen i want to play a diffrent music automatically, and when user click back the main menu music re played .
i try the method that used in music room but it wont work ><.

Im just a beginner at renpy so i dont know much to do ><.
i try to read the documentation but it doesnt help me ><.


And wich one is better to be used in the back button

Code: Select all

textbutton _("Back") action Hide("xxxxxx")
or

Code: Select all

textbutton _("Back") action ShowMenu ("xxxxxxxx")
Attachments
output_khfsrt (1).gif
The GIF That Showing The Bugs !!
output_khfsrt (1).gif (685.31 KiB) Viewed 668 times
Last edited by pratomoastan on Sun Jul 03, 2016 11:58 am, edited 1 time in total.
~ Sempai !!!

User avatar
pratomoastan
Regular
Posts: 39
Joined: Fri Mar 11, 2016 11:39 am
Projects: My High School Life
Organization: After School Things
Deviantart: pratomoastan
Location: Indonesia
Contact:

Re: Bug With Button? And Transition Animation ?

#2 Post by pratomoastan » Sat Jun 18, 2016 8:06 am

Hello ? Any Help ?
~ Sempai !!!

User avatar
Alex
Lemma-Class Veteran
Posts: 2724
Joined: Fri Dec 11, 2009 5:25 pm
Contact:

Re: Bug With Button? And Transition Animation ?

#3 Post by Alex » Sat Jun 18, 2016 12:53 pm

Mmm, it's hard to tell what's wrong with the button 'cause gif animation is too fast.
And there is no "has hbox" in the code you've posted, so it's unclear what's the problem with it...

In music room the button will be unlocked (clickable) only when player heared the track associated with this button in one of his playthroughs. So try to play your game untill you'll hear the "cots.ogg" tune, then go to music room - the button should be clickable.

As for issue with music in credits screen - you need to show the code for this screen as well as the main menu screen.

What action you should use for the "Back" button depends on how you show your screens - in the code you've posted buttons showing screens using "ShowMenu" action (and I suppose all the screens have "tag menu", so they just replace eachother). In this case use "ShowMenu ("preferences")" action for the "Back" button.

User avatar
pratomoastan
Regular
Posts: 39
Joined: Fri Mar 11, 2016 11:39 am
Projects: My High School Life
Organization: After School Things
Deviantart: pratomoastan
Location: Indonesia
Contact:

Re: Bug With Button? And Transition Animation ?

#4 Post by pratomoastan » Mon Jun 20, 2016 2:11 am

Code: Select all

screen main_menu():

    # This ensures that any other menu screen is replaced.
    tag menu

    # The background of the main menu.
    window:
        style "mm_root"

    # The main menu buttons.
    frame:
        style_group "mm"
        xalign .98
        yalign .98

        has hbox

        textbutton _("Start Game") action Start()
        textbutton _("Load Game") action ShowMenu("load")
        textbutton _("Preferences") action ShowMenu("preferences")
        textbutton _("Quit") action Quit(confirm=False)

init -2:

    # Make all the main menu buttons be the same size.
    style mm_button:
        size_group "mm"
Thats the code from my main menu screen


anyways i make the gif into a video

[youtube]https://www.youtube.com/embed/F74pAZuptas[/youtube]
Last edited by pratomoastan on Sat Jun 25, 2016 1:14 pm, edited 2 times in total.
~ Sempai !!!

User avatar
pratomoastan
Regular
Posts: 39
Joined: Fri Mar 11, 2016 11:39 am
Projects: My High School Life
Organization: After School Things
Deviantart: pratomoastan
Location: Indonesia
Contact:

Re: Bug With Button? And Transition Animation ?

#5 Post by pratomoastan » Mon Jun 20, 2016 3:30 am

should i do this :

Code: Select all

mr.add("music/blueska.ogg", always_unlocked=True)
 mr.add("music/brighteningway.ogg", always_unlocked=True)
 mr.add("music/duck.ogg", always_unlocked=True)
Or just add the always_unlocked=True to just one music only ?

Code: Select all

 mr.add("music/blueska.ogg", always_unlocked=True)
 mr.add("music/brighteningway.ogg")
 mr.add("music/duck.ogg")
I Want all of the music in not unlocked so the user can play it whenever they want
~ Sempai !!!

User avatar
Alex
Lemma-Class Veteran
Posts: 2724
Joined: Fri Dec 11, 2009 5:25 pm
Contact:

Re: Bug With Button? And Transition Animation ?

#6 Post by Alex » Mon Jun 20, 2016 2:28 pm

I think the problem is that you've used navigation buttons of different sizes in different screens, but set the same style_group for the frames that contain them, so Ren'Py is trying to show them all the same size.
Try to set different style_group parameters in your screens.

If you want to make all the tracks in music room unlocked for player you need to set the always_unlocked parameter for each track.

User avatar
pratomoastan
Regular
Posts: 39
Joined: Fri Mar 11, 2016 11:39 am
Projects: My High School Life
Organization: After School Things
Deviantart: pratomoastan
Location: Indonesia
Contact:

Re: Bug With Button? And Transition Animation ?

#7 Post by pratomoastan » Sat Jun 25, 2016 1:01 pm

Okay thanks i will try it ><
~ Sempai !!!

Post Reply

Who is online

Users browsing this forum: Google [Bot], rayminator