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.
Hello. I'm new in renpy and so I want to apologize for stupid questions.
Question:
I import python module in renpy, then I create new instance in my game. Then I will change some variables of instance and go to main menu.
init python:
from py.test import A
a = A()
# class A:
# def __init__(self):
# self.a = 20
def let():
global a
a.a += 1000
init:
image bg = "bg washington.jpg"
screen count():
add "bg washington.jpg"
frame:
add "money.png"
background None
vbox:
text "{b}{color=#000000}[a.a]{/color}{/b}" xpos 46 ypos 46 xanchor 0.5 yanchor 0.5
screen test():
use count
imagebutton:
auto "button_%s.png"
action Function(let)
focus_mask True
label start:
call screen test
When I start new game all variables changing will saved. But I need clear new instance.
Any links are welcome.
Sorry if I spend your time and thank you for any help.