The Ren'py Help Desk

Your one stop shop for coding help in Ren'py. Send in the asks, and the help desk answers.

Still Alive

Hey guys, I know I haven’t updated in a while, but I wanted to let you know this blog is still alive. With coronavirus going on, and everyone stuck indoors, I’ve had a lot of time on my hands. 

There’s been a fair number of updates to Ren’Py since the last time I touched it, so I’ve spent the last few months re-familiarizing myself with the engine in preparation for restarting the blog. 

That being said, the last two basic tutorials will be posted to reflect how the new engine version handles sounds and compiling, instead of how it was handled the last time I worked with it, so those blog posts will be delayed. After they are updated, I’ll go back and update the other basic tutorials as needed, before moving on to the exciting stuff: teaching basic python and Ren’Py screen language.

I’ve gotten a lot questions over the intervening quiet period, and I’ll be answering them starting from the newest ones and working back in time(as is still relevant). The hope is that I’m answering questions people still need help with that way.

All in all, I look forward to getting the helpdesk back in working shape, and hearing your phone calls blowing up the metaphorical phone.

Here’s to a coding summer and a wonderful rest of the year.

logoffprotest:

Log Off Protest - Phase Two!

December 29, 2018 (12 am Est) - December 31, 2018. (12 am EST).

This time around - we’re not logging off. Instead, we’ll be banding together and pressuring corporations on social media and app stores. There are two steps to this Phase that are as follows:

1) Mass Tweeting.

For EVERY DAY of this Phase (So at least one tweet December 29, December 30, and December 31), tweet @ the following:

@verizon @yahoo @tumblr @jeffdonof

These are all corporations that own and are related to Tumblr. Jeff D'Onofrio is the CEO of Tumblr. Tweet at them saying WHAT is wrong with this ban, HOW it affects you, and WHAT you want to be done about it. Tag each tweet with #phasetwo2018!

2) Mass Reviews

Go to Tumblr on the app store of your choice (Apple or Google) and leave a negative review. Tell them WHY the ban is wrong, HOW it affects you and your experience, and WHAT you want to be done.

Post each review online with a screenshot. Tag each post with #phasetwo2018!  We need to lower their rating, and show them we mean business. No longer will be ignored. We’ll make them listen.


Timezones

U.S.A

EST - December 29, 2018, at 12 am

CST - December 28, 2018, at 11 pm

MST - December 28, 2018, at 10 pm

PST - December 28, 2018, at 9 pm

International

GMT - December 29, 2018, at 5 am

CST - December 29, 2018, at 1 pm

JST - December 29, 2018, at 2 pm

AEDT - December 29, 2018, at 4 pm

Need your timezone? Use this time zone converter.


An F.A.Q will come as questions flood in. Please message me here, on Twitter, or join our Discord and ask questions there. Thanks for your support guys!

Let’s end this year with a bang, aye?

Note: please read the entire post before sending an ask!

(via vixianna)

ao3tagoftheday:

dbdspirit:

The Official “Log Off” Protest F.A.Q! 


The “Log Off” protest is in response to the recent NSFW ban announced by Tumblr. The ban flags all content the filtering system detects as NSFW, reducing visibility to the community. The system has proven time and time again that is inefficient, oftentimes flagging SFW material as NSFW. 

This SFW material includes art, memes and so on. This ban directly hurts the community and will not solve the actual problems at hand due to the poor flagging system. Because of this, the entire community will suffer.  

So to respond, I propose that every user on Tumblr logs off of Tumblr for 24 hours on December 17th at 12 am EST. 

Times are listed above depending on timezone! 

This post responds to some very common questions about the protest. So make sure to read it over! 


How to Export Your Blog: 

https://tumblr.zendesk.com/hc/en-us/articles/360005118894-Export-your-blog

Alternative Sites: 

Pillowfort

Mastodan 

Wordpress 

Twitter 

There is also an official Tumblr blog (ironic, huh?) and Twitter for the protest! It’s at: 

Twitterhttps://twitter.com/logoffprotest

Tumblr https://logoffprotest.tumblr.com/

There will be official updates on each account. Make sure to tag us in any posts, or use the hashtag #logoff2018

Thanks for your support guys. Let’s fight to make Tumblr better. Actually better. 

Hey y'all! For those who’ve been asking, this is the info about what this blog is doing on the 17th. I hope y'all will join me.

(via kobanya)

kierelthane asked: So, I saw your post about multiple endings, but what if you want to make a visual novel, versus a dating simulation, and you want multiple endings?

Hey sorry to everyone for being silent on here. It’s uhhh a work in progress on getting myself active again.

However! Shira, this is a pretty simple answer. Instead of checking for specific points to send to each ending, you can simply set a series of true/false variables.

Set the variables before the game starts, and every time there is a significant specific milestone, have the variable go from false to true(or vice versa if needed). They can only change those variables in response to dialogue choices and only if they picked the right things at the right time.

So have a series of menus that they only visit once that has important decisions on it(even if they see other menus multiple times) that change variables to true/false.

When you get to the end, you check to see which ones are true. So like you start with: 

if Know_Secret_Origins:
    jump blah blah

Starting at the top with the most plot relevant to the ending milestone and moving down the list as needed. And ending with a generic or even bad end if they don’t trigger anything specific. That’s the easiest way to get them to a specific ending. But you need to make sure that the endings are in order of relevance in the if/elif/else tree. It’s got to be the one that overrules the others, or else you’ll end up in a situation where you get to an ending when another was more relevant. 

It’s the same basic process? You just have to adapt it with true/false instead of points(but you could still use points if you wanted!) So the code is the same really. :) 

New Beginnings

Hey everyone thanks for hanging with me as I uh seemingly disappeared off the face of tumblr.

I’m back, and feeling pretty good. If you take a look at the blog, it’s actually had a major looks overhaul. A custom theme and everything. I also accept comments on posts from disque so there’s that!

The second thing I wanted to announce is that I’d love to be more active, much more active, but uh life and finances prevents me from doing so.

So I’d like to ask you followers if you’d be interested in me setting up a Patreon?  I’d be able to update regularly again, answer questions promptly, and churn out tutorials. I’m open to suggestions on rewards too. 

So Patreon?

lazybott asked: Do you know how to change the scene to a pure white background? "scene black" works but if type "scene white", the background is grayish, which probably means "white" isn't a valid scene.

Hey there whiskeycharley, thanks for phoning in. I know this is an old message, but I figure you and plenty of others could use an explanation.

“White” isn’t a defined action/color on its own like black is. The way around this is to simply define an image you’ve saved(that is all white) as your white scene.

I’m sure you can figure out how to make an all white image in an image/art program, but here’s a refresher on how to get it into the program.

These days Ren’Py makes a new project with a default image folder, but if you’re working with an older version/project, this is how you’d do it:

Drop and drag the white image inside the game folder for the game you’re working on(make sure it’s in the GAME folder and not the BASE folder). Inside the script for the game, define a new background image with the pure white background. It should look like this:

Example:

image bg pure white = “yourimage.png”

Or jpeg, or any other format Ren’Py accepts. Then when you want the background to be pure white, just say “scene bg pure white”.

Make sure you define the image BEFORE the state label.

david-cage-do-not-interact asked: Hi! In my game, you can click on items and read the protags thoughts; as is, the game repeats the same message every time you click on it. How do I change this to a "I've already seen this" message? And make it stay? I tried to use click = 0 variables but they go back to the initial message if you click it too many times :{

Hey there, thanks for phoning in! 

I’m going to assume you’re using an imagebutton in order to make those pretty clickable items in your game. It seems the best idea. If you aren’t then uh you might as well do so, since you know, you can use transformations on them and that will probably be best for an interactive image like yours. :3

So, anyway ignoring the states you already(or don’t! heh) have for your imagebutton, you likely have an Action attached to it that tells it to Jump to a label. 

Now here comes the part that you really need. You can sent a “seen” variable to false at the start of the interaction. Then at the end you can change it to true and with a simple if statement decide if they see the original statement or a “you’ve already seen this message”.

Example:

label thecircle:
   if not seentwice:
       l “We’ve only seen this once. Hopefully.”
       $ seentwice = True
       jump thecircle
   else:
       l “You’ve seen this twice. Congrats!”
       jump somewhereelse

If the true/false variable doesn’t work, call back, and I’ll work up a more vigorous solution with some more of renpy’s obscure functions. 

Anonymous asked: Is it actually possible to transfer a save file (with cache infomation and the like) into another game? Example: Mass Effect 2/3, how it grabs information from the previous games to unlock/lock content in this game based entirely on decisions made previously. Thanks!

Hey there anon, thanks for phoning in!

What you’re looking for is persistent data. Some things can be saved as persistent data and so exist not only between save files for the same game(and so can be used to unlock routes), but also between games. You can program your new game to look for information from its prequel and boot that into its programming to change its default states.

The specifics for how to use persistent data is found here: Persistent Data

I’ll give you a basic overview though so you can get started.

Persistent data is an object that is unrelated to specific parts of your game. A new object is called up using the keyword python to create a block(if you’re creating a bunch of persistent data at once) or a single dollar sign for a line of code. Then, you would tell the interpreter that this is an instance of the persistent data type. To do so you’d write it like this:

Example:

$ persistent.secret_agent = False

In this case, I’m using it as a flag that represents if the player chose the “career” of secret agent. Later in the game, if the player does chose to be a international man of mayhem, you’d change the flag like so:

Example:

$  persistent.secret_agent = True

You can then have it tested with a conditional somewhere else in the game or the next. Say they start out with different stats if they were a secret agent in the last game.

label initialstats:
    if not persistent.secret_agent:
        $ creation_stats = 15
         jump creationscreen
    $ creation_stats = 25
    jump creationscreen

You can scale this of course, such that people who played the game through before with any archetype get more points. This only works though between saves of a single game. If you want to have it work between two different games though, you have to use Multi-persistent Data. The Multipersistent data has to go in an initial python block.

Example:

init python:
     mp = MultiPersistent(”007″)

$ mp.secret_agent = True
$ mp.save()

The stuff in parenthesis after the new instance of the MultiPersistent Class is the “key”. Everything saved to this particular MultiPersistent is attached to that key. The save function also saves the data to the local computer’s disk, it has to be used or it won’t save.

In the next game when you want to load in the old data you’d create a new MultiPersistent instance with the same key. This way the computer can not only access what’s already there, but add to it new stuff from the current game.

Example:

init python:
    mp = MultiPersistent(”007″)

label start:
   

label charactercreation:
    if mp.secret_agent:
        jump loadoldcharacter
    else:
        jump makenewcharacter

Easy peasy! I hope this answered your question. Remember Ren’Py fans, if your code won’t compile and you don’t know why. Who ya’ gonna call? The Ren’Py Help Desk! 

Anonymous asked: Say, how do I make characters default to two-window mode without having to put "show_two_window=True" in the definition for every single one?

Hey there Anon thanks for phoning in! 

This is actually an easier fix than you think! If you go over to the screens file of your game you’ll see the default styles and settings of the screens that come pre-defined when you start any new project. 

The screen you’re looking for is “Say” and it should be the first screen at the top of the file. Under the comments that say “Defaults for side_image and two_window” simply set the default two-window to “True”.

That’s all there is to it! You can do the side for side images. It’s a common thing so it’s already programmed inside.

Just make sure if you set side image to default true you always assign a side image for the game to use for each character when making the new instance of the Character class.

I hope this was helpful and remember, if your code won’t compile and you don’t know why. Who ya’ gonna call? The Ren’Py Help Desk!

antiknuckles asked: Hello, I'm just starting on Ren'Py and making a practice game as I study as a practical way to memorize what I'm learning. Though I've been looking for a while I haven't seen anything on making the text 'type' itself out instead of appearing all at once on the screen. I know you can do this with individual lines, but is there a way to make each of the characters appear a bit slower?

Hey there antiknuckles, thanks for phoning in!

The display speed of the text in the game is handled by the interpreter. It has a default speed, which you can modify, as you stated, by individual lines. This modification deals with how many characters per second appear inside the bracket. This way, someone can say something extra fast or slow.

 However, if you want the speed for all characters up or down, the best way to do this is to create a new style, and then apply that style to the characters themselves.

Characters use a default style inside of Ren’Py unless you override it by specifying one. We’ll get to that in a moment. First I’ll walk you through making a new style with the characteristics you want.

In order to make a new style(that you’re using for all your Characters), first you have to create a new Python block. This needs to have an initialization priority *before* any of the characters that use this style. Characters have an initialization of 0, and run before the game loads. 

“A priority number can be placed between init and python. When a priority is not given, 0 is used. Init statements are run in priority order, from lowest to highest. Init statements of the same priority are run in unicode order by filename, and then from top to bottom within a file.“  Renpy Documentation: Init Python Statement

So you’ll want to create your style with a priority of -1 or less. if you don’t your game will crash as the game tries to assign a style that doesn’t exist yet. Most of the other styles native to Ren’Py, for example in the screens file) have an init of -2, so I stick my own styles with the same priority.

Example:

init -2 python:

Simple as that. The everything in that Python block has an init priority of -2.

From there, you need to create the actual style in name and other characteristics.

The specific function to do so can be found here: Defining Styles: Python 

For the style in question you can name it Default Character Style or something. If you name is something with more than one word, you need to use underscores in place of spaces for it to work.

Example:

init -2 python:
    style.default_character_style = Style(style.default)

Inside the initiation of the new Style class you have to specify it’s parent style. The default would work well for this purpose, but if you want to make another style based on this one you could specify this new still instead.

Example:

init -2 python:
    style.new_style = Style(style.default_character_style)

This was the new style inherent everything already specified in the previous style and then the new stuff is added on top. You can use this to create a default style for all of your characters and then a new one for a specific one that is a variation on the typical style without having to make it all from scratch again.

In order to change the speed of the characters appearing on screen, you have to specify has fast you want them to appear instead. The best way to get it how you want is to experiment. Pick a number and then run some parts of the game. If it’s too fast or slow adjust it. Here’s how you would get a chance into the game though.

Example:

init -2 python:
    style.default_character_style = Style(style.default)
    style.default_character_style.slow_cps = 20

And then any other default things you want to add to the style.

Finally, when it comes to the Characters themselves, when you make the character, you have to specify that you want it to use your custom style instead of the default one. 

To do that, you specify the “what” style.(”who” is for the name; “what” is for what’s said) So, you could theoretically have the name and dialogue in two different styles. When you make the Character, it would look like this:

Example:

define pov = Character(_(”[povname]”), what_style =“default_character_style”)

Simple as that. Now whenever you make changes to that style all the characters will change with it. Character as a class take a large number of arguments so you can specify everything from the color of the name to a suffix or prefix to be appended to the dialogue.(say for example if you want quotation marks to always appear that way you didn’t have to write them in and use escape characters on every line.)

I hope this helps! 

Remember loyal followers, if you’re code won’t compile and you don’t know why? Who ya gonna call? The Ren’Py Help Desk!