Renpy Screen Dialogue Continues How to Stop
how to do a few renpy things:
- keep a character's name a mystery until they're introduced
- customize the textbox and name/dialogue text properties for a specific character
- change text placement between spoken dialogue and narration
- hide the quick menu for screens and scene changes
- only reveal a choice in a choice menu after it's been unlocked
- loop a choice menu, remove choices that have already been selected, and end the loop either after a specific choice has been selected or all choices have been exhausted
- show a prompt, then show a choice menu while the prompt stays on screen, without replaying the prompt text
(anything in red that follows a hashtag # is a comment clarifying stuff in the code)
_
1) keep a character's name a mystery until they're introduced
(or alternatively, change a characters name to anything at any time!)
you can do this by setting a variable as their name, and changing that variable when you need to in the story. this example makes their name display as "???" until you change it to their actual name.
when you declare the character, set:
where cel_name is the variable that'll be used as the character's displayed name. when they're introduced in the story, just update the variable:
_
2) customize textbox and name/dialogue text properties for specific characters
everything here changes things for a specific character only. if you want to change things for everyone, look in gui.rpy (for changes that renpy's already made variables for) or screens.rpy (for changes that aren't as basic/popular so you've gotta get in there and modify stuff yourself)
for reference, here's a basic character definition:
and here's one loaded up with optional specifications:
- window_background: the textbox image! i use this because i make unique textboxes for my main characters
- image="cel": the image tag! i think this is only necessary if you use side portraits
- what_ : anything beginning with what_ modifies the character's dialogue text. you can combowhat_ with any text style property to change that property for this character. like: what_size, what_italic, what_font, etc.
- who_ : anything beginning with who_ modifies the text of the character's name. just as with what_, you can follow it up with any text style property
_
3) change text placement between spoken dialogue and narration
by default, narration text and dialogue text have the same properties, so they're at the same height:
but i wanted them to be at different heights, since the narration text doesn't have to be pushed down by a character name:
i've only changed the height here, but you could change any text style property you want.
in screens.rpy, look for "screen say(who, what)". by default, it probably says something like:
text who is for character names, text what is for dialogue and narration, aka the text in the text box.
to change the placement of text what depending on if someone is speaking or not, i just separated the dialogue and narration cases, giving them each their own text what:
here i've placed dialogue text at a y-position of c_what_ypos, a variable i've created and defined elsewhere as:
_
4) hide the quick menu for screens and scene changes
this one's super simple, but when i first wanted to do this i still had to google it! these are quick menus (i know, it's tiny in the second example):
to hide it, just use quick_menu:
you might want to hide the quick menu when you show a screen that takes up the whole game window, or want a clean scene change without any gui:
_
5) only reveal a choice in a choice menu after it's been unlocked
(aka, only reveal a choice in a choice menu when it's met certain conditions!)
a basic choice menu looks like this:
choices can be hidden using if statements. here, the "Ask about her tragic past" option will only show up if know_about_tragic_past is set to true:
and you can add as many conditions to the if statement as you want:
_
6) loop a choice menu, remove choices that have already been selected, and end the loop either after a specific choice has been selected or all choices have been exhausted
somewhere outside of the content of the story, define:
and at the choice menu you want to loop, use:
right now it's an infinite loop, since convo_done is always false. to end it after a specific choice has been selected, add:
to remove choices that have already been selected, i use a bunch of true/false variables to keep track of which options have been selected. like before, i define them first:
then add them onto the choice menu:
to end the loop after all choices have been exhausted, just add:
you can loop choice menus within choice menus, and it can go as deep into sub menus as you want:
_
7) show a prompt, then show a choice menu while the prompt stays on screen, without replaying the prompt text
this is totally a personal preference thing and a Very small change, but it's important to me! to show what i mean, here's 3 ways a choice menu might normally be shown:
1) the choice menu shows without the prompt. personally i don't like this one, because i often forget what the prompt is and would rather have it stay on screen.
2) the choice menu shows at the same time as the prompt. this one's okay, but i usually end up skimming the choices before i even read what prompt i'm responding to, so i don't prefer it
3) the prompt shows first, but to get the prompt to stay while the choice menu shows, the prompt is played out all over again. i don't like this one because the flash of the prompt replaying always tricks me into thinking it'll be new text, but it isn't
now, here's my preferred way:
4) the prompt shows first, then the choice menu shows after a click, without replaying the prompt.
the prompt appears to stay onscreen as the player clicks forward, but the prompt's actually being repeated like in method (3)– the repeat is just set to appear instantly, using the text tag {fast}. again, super small and totally just my preference
Source: https://sovonight.tumblr.com/post/625234560654917632/how-to-do-a-few-renpy-things-keep-a-characters
0 Response to "Renpy Screen Dialogue Continues How to Stop"
Post a Comment