Code: Select all
init:
$ aVariable = True
label main_menu:
if aVariable:
$ aVariable = False
// Show Splash Screen
jump _library_main_menu
Code: Select all
init:
$ aVariable = True
label main_menu:
if aVariable:
$ aVariable = False
// Show Splash Screen
jump _library_main_menu
Unfortunately, your understanding is a bit wrong. In Ren'Py, by default, all variables are defined in the global namespace. (You can get around this by using python hide or defining and calling a function.) The dollar sign is used to introduce a python statement. Python doesn't require you to declare variables, but instead automatically creates them when you first assign to them, one of the hallmarks of a dynamic language. So in your example, you updated aVariable.I imagine when I set aVariable in the init, it creates a variable for init. However, when I set aVariable inside the if statement, it creates a local variable for the if statement resulting in no changes to the init aVariable. My question is, "Does $ initialize a new variable in Python?" Because I think I just need to edit the variable instead of initializing a new one.
Just to clarify, in Ren'Py, all variables are global. (Except for those used entirely inside python functions, which are declared with def.) Ren'Py needs this so that it can easily determine what to save with the game is saved. Unlike traditional structured programming languages, Ren'Py is deliberately unstructured, to make loading and saving easy.Edit 2: UNLESS, (lol) label main_menu is regarded as a separate method. Oh, I don't know... Thank you for making a splashcreen label, rofl.
Users browsing this forum: No registered users