Imagebutton vs menu item - time specific dialogue option

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
Zenathos815
Newbie
Posts: 6
Joined: Wed Sep 06, 2017 3:42 pm
Contact:

Imagebutton vs menu item - time specific dialogue option

#1 Post by Zenathos815 »

Hey guys I am still new with ren'py but I'm starting to get the hang of things I am just having a little trouble with a few basic things.

I have plans for specific times where during a time of day on certain days of the week a character is present at a certain location like say the MC is at home and is passing time but has a menu on screen with options like wait or sleep and they spend all day at that location for 3 days but lets say at night on Wednesday their roommate comes home and their "chibi" is displayed I would like the MC to have an option to start dialogue or start an event without having to disrupt the existing menu options.

I wanted to know if anyone has a good way of doing this that they can share. I tried adding a menu option but this seems impractical for scenes that may have multiple characters at one time on some days but not others and I was having an issue with the menu bugging where it would skip two time periods or would still show the character after the time period ended though the if statement specifically set to show them for that time and hide them otherwise. Might be an issue with how I structure it but I can't seem to figure it out and it seems complcated for those times with multiple characters.

I considered using imagebuttons so the player can click the character they want to talk to but I can't get the syntax right for some reason and the only guides that seem to give full examples are drected for menu options or fixed buttons.

I don't mind using an imagemap but if I can't figure out an imagebutton I imagine this would be much harder.

I would like to see how others have handled this because I imagine my code is trash and I'm curious to see what the most effective way to do this would be.

User avatar
TellerFarsight
Veteran
Posts: 230
Joined: Sun Jun 04, 2017 8:09 pm
Projects: Vora, Secrets Untold
Location: Toronto, ON
Contact:

Re: Imagebutton vs menu item - time specific dialogue option

#2 Post by TellerFarsight »

Let's see if I'm understanding this right.
You want a screen that shows certain options like "wait" or "sleep," and then at certain points in the story additional options come up?
Essentially (and it sounds like you're already kind of doing this) you'd just do that with if statements.

Code: Select all

screen things_to_do:
    vbox:
        textbutton "Wait for something to happen"
        textbutton "Sleep"
        if Joe_is_here:
            textbutton "Talk to Joe"
        if Mark_is_here:
            textbutton "Talk to Mark"
        if Joe_is_here and Mark_is_here:
            textbutton "Hang out with da boys."
If you want to also put if statements making these conditional to the time of day, you can put those in too. These variables would need to be in the script though, not in the screen. You can also replace the textbuttons here with imagebuttons pretty simply.
Last edited by TellerFarsight on Thu Sep 14, 2017 8:58 pm, edited 1 time in total.
Current Project: Vora
Also Check Out: Devil Survivor [Reverse-Engineered]

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

Re: Imagebutton vs menu item - time specific dialogue option

#3 Post by philat »

Why is it impractical to use menu options? As for the issues with "skipping" or not showing correctly, that's almost certainly an error rather than an issue with menus. (Obviously I can't say what the error is if you don't show us what you did.)

Menu options are simple and should be easy to use. Imagebuttons will probably look prettier, but would be slightly more work to implement (for instance, you would have to think about positioning the imagebutton). There is never really a "most effective way" to do anything -- it all depends on precisely what you want.

Post Reply

Who is online

Users browsing this forum: Google [Bot], Syrale