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.
From RenpyTom in discord: "I pretty much use global exclusively. Store is used in special cases - for example, SetVariable(...) is actually SetField(store, ...)"
How to fix: local variable 'locCur' referenced before assignment
default locCur = "testC"
default locN= "testN"
init python:
global locCur #SOLUTION
global locN #SOLUTION
def func_1():
# for reference, the following use of store. also fixes the problem, but RenpyTom uses global, so I'll use global as well.
# if store.locCur != store.locN
if locCur != locN:
# dostuff