Yes/No prompt message customizing and adding chibi [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
Kokoro Hane
Eileen-Class Veteran
Posts: 1237
Joined: Thu Oct 27, 2011 6:51 pm
Completed: 30 Kilowatt Hours Left, The Only One Girl { First Quarter }, An Encounter ~In The Rain~, A Piece of Sweetness, Since When Did I Have a Combat Butler?!, Piece by Piece, +many more
Projects: Fateful Encounter, Operation: Magic Hero
Organization: Tofu Sheets Visual
Deviantart: kokoro-hane
itch: tofu-sheets-visual
Contact:

Yes/No prompt message customizing and adding chibi [SOLVED]

#1 Post by Kokoro Hane »

Hi there,

I've been reading the document and looked at a few tutorials, but still can't wrap my head around how to customise the Yes/No prompt. On top of that, the tutorials are more complex with its imagemaps and I'm looking for something a little more simple. I'm OK with the default, simple text in a box Yes/No prompt. What I am looking for is, how do I customise all the Yes/No prompt messages and how to add a chibi image on the side of the box next to the text. I'd imagine this is fairly simple, but I can't find where to customise the Yes/No prompts and how I would go about sticking the chibi at the side of the message. How would I go about this? Is there a way with just image statements and textbuttons in v/hboxes? Also, is there a way I can code that when you exit from the Main Menu, it also shows the Quit Yes/No prompt? It simply exits the game if you exit from the Main Menu.

Here's a mock-up screenshot of what I mean. I just screenshoted the prompt, then modified the text and added the chibi as an example of what I am looking to do.
Mock-up screenie.png
Thanks in advanced!
Last edited by Kokoro Hane on Sat Apr 22, 2017 4:04 pm, edited 1 time in total.
PROJECTS:
Operation: Magic Hero [WiP]
Piece By Piece [COMPLETE][Spooktober VN '20]
RE/COUNT RE:VERSE [COMPLETE][RPG]
Since When Did I Have a Combat Butler?! [COMPLETE][NaNoRenO2020+]
Crystal Captor: Memory Chronicle Finale [COMPLETE][RPG][#1 in So Bad It's Good jam '17]

But dear God, You're the only North Star I would follow this far
Owl City "Galaxies"

User avatar
Scribbles
Miko-Class Veteran
Posts: 636
Joined: Wed Sep 21, 2016 4:15 pm
Completed: Pinewood Island, As We Know It
Projects: In Blood
Organization: Jaime Scribbles Games
Deviantart: breakfastdoodles
itch: scribbles
Location: Ohio
Contact:

Re: Yes/No prompt message customizing and adding chibi

#2 Post by Scribbles »

I only know how to do it with an imagemap, so if no one can offer you an alternative I can try to help you there :) but I know thats not what you're looking for > <
Image - Image -Image

User avatar
Ocelot
Lemma-Class Veteran
Posts: 2402
Joined: Tue Aug 23, 2016 10:35 am
Github: MiiNiPaa
Discord: MiiNiPaa#4384
Contact:

Re: Yes/No prompt message customizing and adding chibi

#3 Post by Ocelot »

You can change this prompt by modifying confirm screen.

You can change default text ("Are you sure you want to quit?") by changing translation files for None language (should be generated for any new project. Otherwise, regenerate translation files)

About prompt on main menu: use Quit(confirm=True) action instead of default Quit()
< < insert Rick Cook quote here > >

User avatar
Kokoro Hane
Eileen-Class Veteran
Posts: 1237
Joined: Thu Oct 27, 2011 6:51 pm
Completed: 30 Kilowatt Hours Left, The Only One Girl { First Quarter }, An Encounter ~In The Rain~, A Piece of Sweetness, Since When Did I Have a Combat Butler?!, Piece by Piece, +many more
Projects: Fateful Encounter, Operation: Magic Hero
Organization: Tofu Sheets Visual
Deviantart: kokoro-hane
itch: tofu-sheets-visual
Contact:

Re: Yes/No prompt message customizing and adding chibi

#4 Post by Kokoro Hane »

Scribbles wrote:I only know how to do it with an imagemap, so if no one can offer you an alternative I can try to help you there :) but I know thats not what you're looking for > <
Hmm, I wouldn't mind learning an imagemap way of doing it. Are you able to put custom messages on your image? Namely my issue with some of the tutorials I found is they didn't explain much and one tutorial that provided an example of the ground, idle, and hover sadly wouldn't load xD

So yeah, I wouldn't mind if you helped me with learning the imagemap way if you're up for it so I can do it on my own in the future. Would I also be able to change the yes/no to something unique? I'd image with an imagemap I can change the text of yes and no to whatever I want, with it still performing the yes and no function.

Ocelot wrote:You can change this prompt by modifying confirm screen.

You can change default text ("Are you sure you want to quit?") by changing translation files for None language (should be generated for any new project. Otherwise, regenerate translation files)

About prompt on main menu: use Quit(confirm=True) action instead of default Quit()
Thanks, I'll be sure to put that quit prompt in and see about the translation thing in on e of my test projects.
PROJECTS:
Operation: Magic Hero [WiP]
Piece By Piece [COMPLETE][Spooktober VN '20]
RE/COUNT RE:VERSE [COMPLETE][RPG]
Since When Did I Have a Combat Butler?! [COMPLETE][NaNoRenO2020+]
Crystal Captor: Memory Chronicle Finale [COMPLETE][RPG][#1 in So Bad It's Good jam '17]

But dear God, You're the only North Star I would follow this far
Owl City "Galaxies"

User avatar
Scribbles
Miko-Class Veteran
Posts: 636
Joined: Wed Sep 21, 2016 4:15 pm
Completed: Pinewood Island, As We Know It
Projects: In Blood
Organization: Jaime Scribbles Games
Deviantart: breakfastdoodles
itch: scribbles
Location: Ohio
Contact:

Re: Yes/No prompt message customizing and adding chibi

#5 Post by Scribbles »

Kokoro Hane wrote: Hmm, I wouldn't mind learning an imagemap way of doing it. Are you able to put custom messages on your image? Namely my issue with some of the tutorials I found is they didn't explain much and one tutorial that provided an example of the ground, idle, and hover sadly wouldn't load xD

So yeah, I wouldn't mind if you helped me with learning the imagemap way if you're up for it so I can do it on my own in the future. Would I also be able to change the yes/no to something unique? I'd image with an imagemap I can change the text of yes and no to whatever I want, with it still performing the yes and no function.
I know what you mean, it took me weeks to piece together imagemaps lol

There are a couple of ways to accomplish what you're wanting.. lemme try to explain (I suck at explaining but here I go)

here is the imagemap basics (I took from that tutorial that is really buggy online at Fuck Yeah Ren'py:

Ground – This is what your imagemap will look like without any mouse interaction. You can think of this as a “base” image; it is what your text sits on, or what shows when the text is not accessible. It does NOT contain any code-defined hotspots.

Hover – This is what your imagemap will look like with the mouse hovering over each individual hotspot.

Idle – This is what your imagemap will look like if all of the hotspots are unselected, which means that they are currently not activated (toggled “off”) by the player.

Selected idle – This is what your imagemap will look like if all of the hotspots are selected, which means that they are all activated (toggled “on”) by the player.

Selected hover – This is what your imagemap will look like if all of the hotspots are selected and are being hovered over by the player’s mouse. If you don’t want the hotspots to change their appearance when the player hovers over them, then this image can be the same as the selected idle image.
under screens.rpy you should have something like below (but this is my modified version)

Code: Select all


## Confirm screen ##############################################################
##
## The confirm screen is called when Ren'Py wants to ask the player a yes or no
## question.
##
## http://www.renpy.org/doc/html/screen_special.html#confirm

screen confirm(message, yes_action, no_action):

    ## Ensure other screens do not get input while this screen is displayed.
    modal True

    zorder 200 #places it higher than other stuff

    style_prefix "confirm" 

    add "confirmscreenbackground.png"     #this will be the background, which you could probably just use a very transparent image for your     
                                                            #purposes
    
    label _(message):
        style "confirm_prompt" ## This could be where you add your own custom message - but I haven't tested that. 
        xalign 0.5
        yoffset 40
        
    imagemap:
        ground "groundimage.png" #
        idle "idleimage.png"    ## for me this is the Yes and No text
        hover "hoverimage.png" ## The Yes and No text with hover effects
        
        alpha False
        
        hotspot (820, 399, 44, 30) action yes_action 

## hotspots are actually really easy to locate. Run your game (just use (0,0,0,0) if it gives you an error and as soon as you open the game hit 
## Shift+ D, select Image Location Picker, locate your image (it'll list all of them) then it'll show you the image, and you draw a rectangle over where 
##you want  you button to be (the button is in the image, you are only defining where the user can click on it) after you draw the rectangle Ren'py 
## automatically copy's the coordinates to clipboard, so go back to your code and paste it ^^
        
         hotspot (819, 437, 43, 25) action no_action
    
    key "game_menu" action no_action
so then with the hotspot you are defining whatever you select to be the yes_action or no_action and the options can say whatever you like but you create it as an image.

You'll need a background image, and then the separate idle and hover and ground images:

background:
Image

then the "buttons" areas for the hotspots:
(hover, idle, and ground respectively) -- the white BG and red circle are to make them easier to see for you - they should be transparent except for the parts that you want to be interactive-able
Image
Image
Image

They should actually looks something like this:
Image

Potouto did the graphic design that I'm using for this by the way - it's from my game ^^ (trying to give credit lol)


ERRR did that help? Hopefully? Sorry if I didn't explain it very well - - or wrongly.... As for creating a custom message for this screen I'm not sure "Are you sure you want to do that?" vs the default message :c but maybe someone else can help you there. I'm still very new to coding, but I recently did a ton of imagemaps for my game so I got a bit of a handle on them lol

I got rid of this bit of code:

Code: Select all

#    frame:

#        vbox:
#            xalign .5
#            yalign .5
#            spacing 30

#            label _(message):
#                style "confirm_prompt"
#                xalign 0.5

#            hbox:
#                xalign 0.5
#                spacing 100

#                textbutton _("Yes") action yes_action
#                textbutton _("No") action no_action

#    ## Right-click and escape answer "no".
#    key "game_menu" action no_action
but left the rest
Image - Image -Image

User avatar
Kokoro Hane
Eileen-Class Veteran
Posts: 1237
Joined: Thu Oct 27, 2011 6:51 pm
Completed: 30 Kilowatt Hours Left, The Only One Girl { First Quarter }, An Encounter ~In The Rain~, A Piece of Sweetness, Since When Did I Have a Combat Butler?!, Piece by Piece, +many more
Projects: Fateful Encounter, Operation: Magic Hero
Organization: Tofu Sheets Visual
Deviantart: kokoro-hane
itch: tofu-sheets-visual
Contact:

Re: Yes/No prompt message customizing and adding chibi

#6 Post by Kokoro Hane »

@Scribbles; Haha, well it does seem to explain a little more, but I do admit I still have some confusion. HOWEVER, this has helped me in having a possible theory for another method, which I plan to use. So I do appreciate the help, as the parts other tutorials have not explained where explained here--so if I ever do attempt imagemaps, at least I understand a little better. If not, it still helped in giving me an idea for a theory of another method, so thank you! We'll see how it goes, whichever one I attempt xD


EDIT: Alright, it looks like my theory worked! Again, thank you as this did help with me coming up with the theory~
PROJECTS:
Operation: Magic Hero [WiP]
Piece By Piece [COMPLETE][Spooktober VN '20]
RE/COUNT RE:VERSE [COMPLETE][RPG]
Since When Did I Have a Combat Butler?! [COMPLETE][NaNoRenO2020+]
Crystal Captor: Memory Chronicle Finale [COMPLETE][RPG][#1 in So Bad It's Good jam '17]

But dear God, You're the only North Star I would follow this far
Owl City "Galaxies"

Post Reply

Who is online

Users browsing this forum: No registered users