defined values not showing in text-quotes

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
ISAWHIM
Veteran
Posts: 318
Joined: Sun Nov 06, 2016 5:34 pm
Contact:

defined values not showing in text-quotes

#1 Post by ISAWHIM »

I swear that this worked on my last game...

In "options.rpy"

Code: Select all

## The version of the game.
define config.version = "0.01"

## Text that is placed on the game's about screen. To insert a blank line
## between paragraphs, write \n\n.
define gui.about = _("- Development Build (Version [config.version]) -\n\nIntroductions and slight GUI setup.")
The purpose was to display the version here, because I do not like it displayed on the game-screen.

However, now, it displays the following text... "Development Build (Version [config.version])"...
Instead of the text... "Development Build (Version 0.01)"

Has the format changed to insert values [defined-vals], into "Quoted text", using [ and ], changed?

User avatar
Remix
Eileen-Class Veteran
Posts: 1628
Joined: Tue May 30, 2017 6:10 am
Completed: None... yet (as I'm still looking for an artist)
Projects: An un-named anime based trainer game
Contact:

Re: defined values not showing in text-quotes

#2 Post by Remix »

try [config.version!t]

Other than that, it might be a case of using python "... {0} ...".format( config.version ) or even making the interpolated [] strings differently in screens.py
Frameworks & Scriptlets:

User avatar
Divona
Miko-Class Veteran
Posts: 678
Joined: Sun Jun 05, 2016 8:29 pm
Completed: The Falconers: Moonlight
Organization: Bionic Penguin
itch: bionicpenguin
Contact:

Re: defined values not showing in text-quotes

#3 Post by Divona »

Doesn't seem like it would take a variable in with the text with standard define. Here is work around:

Code: Select all

define gui.about = _("- Development Build (Version ") + config.version + _(") -\n\nIntroductions and slight GUI setup.")
Completed:
Image

User avatar
ISAWHIM
Veteran
Posts: 318
Joined: Sun Nov 06, 2016 5:34 pm
Contact:

Re: defined values not showing in text-quotes

#4 Post by ISAWHIM »

I think, if this is not just a quirk here...

It may be because the assignment may not be "done" until the page is finished. So it isn't an actual "value", or it now requires a renpy.something insert.

_("That split") + and.insert + ("works fine... thanks!")

The [ and ] are being interpreted as characters, which is some kind of bug/quirk... Thus, anything between them, in the quotes, is showing as text also.

Post Reply

Who is online

Users browsing this forum: Ahrefs [Bot], Bing [Bot], Google [Bot]