the "define" variable not implemented at the start of the game

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
Mirrodin
Regular
Posts: 114
Joined: Sun Mar 19, 2017 2:56 pm
Contact:

the "define" variable not implemented at the start of the game

#1 Post by Mirrodin »

Hi guys,

Start debugging my game after 2 years, and at the launch I have this error. (I just updated RENPY) so now maybe I need another declarative type.

in my init.rpy :

define version_game = "0.3.22.d"

in option.rpy :

define config.name = _("The Pleasuremancer "+str(version_game)+" - Stable version")

And with the update of RENPY I have this error :

'm sorry, but an uncaught exception occurred.

While parsing C:\***\Pleasuremancer v674/game/Init_globale.rpy.
File "game/options.rpy", line 15, in <module>
define config.name = _("The Pleasuremancer "+str(version_game)+" - Gold edition - Stable version")
NameError: name 'version_game' is not defined

What is the new declarative ?

Thanks

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

Re: the "define" variable not implemented at the start of the game

#2 Post by Ocelot »

Make sure that first define has lower init order than second one.
< < insert Rick Cook quote here > >

strayerror
Regular
Posts: 159
Joined: Fri Jan 04, 2019 3:44 pm
Contact:

Re: the "define" variable not implemented at the start of the game

#3 Post by strayerror »

I believe the config store is treated specially in define statements and hoisted to be some of the first things defined. I'd suggest storing your version in config.version instead.

Post Reply

Who is online

Users browsing this forum: DewyNebula, juliaa__