Search found 254 matches

by SleepKirby
Wed Sep 11, 2019 3:07 pm
Forum: Development of Ren'Py
Topic: Coding Dialogue Statements easier!
Replies: 16
Views: 2290

Re: Coding Dialogue Statements easier!

what_prefix=""" It sounds like you're trying to make the first and third " be the start and end of a Python string, and the second " be the actual what_prefix, but Python can't figure that out. If you have two " in a row, Python thinks that's a string with nothing in it. And actually, if you have t...
by SleepKirby
Wed Sep 11, 2019 5:42 am
Forum: Development of Ren'Py
Topic: Python 2 deprecation
Replies: 7
Views: 2254

Re: Python 2 deprecation

For those who don't know, there are a lot of Python projects (on PyPI for example) which support Python 2 and 3 simultaneously on their latest version. To clarify, 'support' for Python 2 and 3, in Ren'Py's context, would mean that: The Python version that runs when your game runs can be either Pytho...
by SleepKirby
Sat Jun 29, 2019 2:15 am
Forum: Ren'Py Questions and Announcements
Topic: Adding choices selected to History without showing to user
Replies: 9
Views: 1106

Re: Adding choices selected to History without showing to user

Old thread, but since there was no code shared for adding history entries for selected choices, here's mine: init python: def menu(items, **add_input): """Overwrites the default menu handler, thus allowing us to log the choice made by the player. The default menu handler is set to renpy.display_menu...
by SleepKirby
Mon Apr 15, 2019 2:55 am
Forum: Ren'Py Questions and Announcements
Topic: Array doesn't accept integer variables as index? [Solved]
Replies: 5
Views: 180

Re: Array doesn't accept integer variables as index?

Ren'Py's text interpolation is implemented using the standard Python string.Formatter class (the main difference being that Ren'Py customizes it to use square brackets instead of curly braces). The text in between the outer brackets s_dayOfTheWeek[i_dayOfTheWeek] gets passed to this text interpolati...
by SleepKirby
Sun Apr 14, 2019 4:06 pm
Forum: Ren'Py Questions and Announcements
Topic: TypeError: coercing to Unicode: need string or buffer when accessing a file
Replies: 3
Views: 125

Re: TypeError: coercing to Unicode: need string or buffer when accessing a file

As a general debugging tip - when an error happens on a complex line like this: bannedWordsList = [line.rstrip('\n') for line in open(renpy.file("../bannedwords.txt"), "r")] I'd prefer to temporarily break it up into multiple simpler lines, then run the code again to see which line gets the error: r...
by SleepKirby
Fri Apr 12, 2019 5:15 pm
Forum: Ren'Py Questions and Announcements
Topic: Excluding certain RPY files to speed up game launch/reload?
Replies: 0
Views: 97

Excluding certain RPY files to speed up game launch/reload?

I'm trying to reduce the time it takes to reload my game (with Shift+R) to make testing code a little less tedious. After experimenting with removing/commenting various .rpy files in the game, the biggest reload-time factor I've found is the combined size of the story script files. We generally have...
by SleepKirby
Tue Mar 27, 2018 9:09 pm
Forum: Ren'Py Questions and Announcements
Topic: [Solved] Customize name_only character without getting Lint warning
Replies: 5
Views: 370

Re: Customize name_only character without getting Lint warning

(Slightly late) Update: PyTom resolved this by excluding name_only and a bunch of other names from Lint redefine warnings. The change is in the 6.99.14.2 prerelease.

So to answer this thread: There's nothing wrong with redefining name_only, and now it doesn't get a Lint warning anymore.
by SleepKirby
Fri Mar 23, 2018 6:04 pm
Forum: Ren'Py Questions and Announcements
Topic: 6.99.14.2 Prereleased
Replies: 40
Views: 2730

Re: 6.99.14.2 Prereleased

For my use case where I have a separately-downloaded Atom, updating the launcher makes it re-download Atom to the renpy folder. I tried the update process with (A) Atom.edit.py edited directly to specify an ATOM value, and with (B) Atom.edit.py not edited, but a RENPY_ATOM environment var value set....
by SleepKirby
Sun Mar 18, 2018 3:33 pm
Forum: Ren'Py Questions and Announcements
Topic: [Solved] Customize name_only character without getting Lint warning
Replies: 5
Views: 370

Re: Customize name_only character without getting Lint warning

Yeah Ocelot, you're probably right. I saw this GitHub issue related to redefining name_only, and it seems like redefining is the intended usage. As of 2015, at least.

I'll poke around the Renpy code and see if I can figure out why narrator doesn't trigger Lint, while name_only does.
by SleepKirby
Sun Mar 18, 2018 5:57 am
Forum: Ren'Py Questions and Announcements
Topic: [Solved] Customize name_only character without getting Lint warning
Replies: 5
Views: 370

Re: Customize name_only character without getting Lint warning

Well, there's also this bit in the Quickstart : [Lint] will check your games for potential errors. Since some of these errors will only affect users on other platforms, it's important to understand and usually fix all errors, even if you don't see the problem on your computer. I know Lint's not mean...
by SleepKirby
Sun Mar 18, 2018 5:28 am
Forum: Ren'Py Questions and Announcements
Topic: [Solved] Customize name_only character without getting Lint warning
Replies: 5
Views: 370

[Solved] Customize name_only character without getting Lint warning

Some of my scenes use generic, one-off speaker names like "Girl 1" "Boy 2" and so on. I can't really be bothered to define a unique Character object for each of those speakers. As far as I know, this is the use case for the name_only character , which is automatically used when I have the character ...
by SleepKirby
Sat Mar 17, 2018 4:03 pm
Forum: Ren'Py Questions and Announcements
Topic: Change side images through Conditional switches
Replies: 6
Views: 433

Re: Change side images through Conditional switches

1 and '1' are different in Python. The first is an integer, the second is a text string. When you compare 1 == '1', you get a result of False.

Try changing the ConditionSwitch to use "who==2" and "who==1" instead.
by SleepKirby
Sat Mar 17, 2018 3:54 pm
Forum: Ren'Py Questions and Announcements
Topic: 6.99.14.2 Prereleased
Replies: 40
Views: 2730

Re: 6.99.14.2 Prereleased

That's what I tried before, but I figured it out just now. In addition to Atom.edit.py, I also needed to create an empty atom/atom-windows folder. Now I can select Atom without it downloading another one.
Things are all good on my end now!