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.
init python:
locroom = 0
hour = 12
minut = 20
def timelocation():
global locroom, hour, minut
#locroom
if hour >= 12 and hour <= 18:
locroom = "room_sun1"
elif hour >= 19 and hour <= 20:
locroom = "room_sun2"
elif hour >= 21 or hour <= 11:
locroom = "room_sun3"
image room_sun1 = "backgrounds/room_sun1.png"
image room_sun2 = "backgrounds/room_sun2.png"
image room_sun3 = "backgrounds/room_sun3.png"
label room:
$ timelocation()
show screen room
screen room:
add locroom
Everything works by code, the problem is that if you save the game and close it completely, the next time you load the save, it says that the variable $ locroom is not defined. Help me how to save these variables, where I read that such values are not saved.
I'm sorry, but an uncaught exception occurred.
While running game code:
File "renpy/common/000statements.rpy", line 485, in execute_call_screen
store._return = renpy.call_screen(name, *args, **kwargs)
File "game/script.rpy", line 65, in execute
screen room:
File "game/script.rpy", line 65, in execute
screen room:
File "game/script.rpy", line 67, in execute
add locroom
Exception: Not a displayable: 0