I defined it with all my variables after start.
Code: Select all
label start:
python:
enemy_hp = 0
enemy_maxhp = 0
enemy_lv = 0
enemy_mp = 0
enemy_maxmp = 0
........
def not_random(chance):
r_number = renpy.random.randint(1,100)
if r_number <= chance:
return 'hit'
else:
return 'miss'Code: Select all
While running game code:
File "renpy/common/00start.rpy", line 151, in script call
call _load_reload_game from _call__load_reload_game_1
File "renpy/common/00keymap.rpy", line 393, in script
python hide:
File "renpy/common/00keymap.rpy", line 403, in <module>
renpy.load("_reload-2")
AttributeError: 'StoreModule' object has no attribute 'not_random'
-- Full Traceback ------------------------------------------------------------
Full traceback:
File "renpy/common/00start.rpy", line 151, in script call
call _load_reload_game from _call__load_reload_game_1
File "renpy/common/00keymap.rpy", line 393, in script
python hide:
File "C:\Users\Emil\Desktop\PSP\Renpy\renpy-6.15.7-sdk\renpy\ast.py", line 805, in execute
renpy.python.py_exec_bytecode(self.code.bytecode, self.hide, store=self.store)
File "C:\Users\Emil\Desktop\PSP\Renpy\renpy-6.15.7-sdk\renpy\python.py", line 1460, in py_exec_bytecode
exec bytecode in globals, locals
File "renpy/common/00keymap.rpy", line 403, in <module>
renpy.load("_reload-2")
File "C:\Users\Emil\Desktop\PSP\Renpy\renpy-6.15.7-sdk\renpy\loadsave.py", line 579, in load
roots, log = loads(location.load(filename))
File "C:\Users\Emil\Desktop\PSP\Renpy\renpy-6.15.7-sdk\renpy\loadsave.py", line 49, in loads
return cPickle.loads(s)
AttributeError: 'StoreModule' object has no attribute 'not_random'
Windows-8-6.2.9200
Ren'Py 6.99.7.858
IO Finale 0.0
