Code: Select all
#PLAYER VARIABLES
$ player = PlayerList()
Code: Select all
layeredimage protag_grapple:
#Protagonist Nude Base
#Arm position
if player.grapple_arms == "tied":
"protag-grapple_arms_tied"
elif player.grapple_arms == "up":
"protag-grapple_arms_up"
else:
pass #this should never happen, let's add an error message later
Code: Select all
I'm sorry, but an uncaught exception occurred.
While running game code:
File "game/code/base-grapple/grapple-overlay.rpy", line 1, in script
init python:
File "game/code/base-grapple/grapple-overlay.rpy", line 3, in <module>
player.grapple_face = "shock"
NameError: name 'player' is not defined
-- Full Traceback ------------------------------------------------------------
Full traceback:
File "game/code/base-grapple/grapple-overlay.rpy", line 1, in script
init python:
File "E:\_RenPy\renpy-7.3.5-sdk\renpy\ast.py", line 914, in execute
renpy.python.py_exec_bytecode(self.code.bytecode, self.hide, store=self.store)
File "E:\_RenPy\renpy-7.3.5-sdk\renpy\python.py", line 2028, in py_exec_bytecode
exec bytecode in globals, locals
File "game/code/base-grapple/grapple-overlay.rpy", line 3, in <module>
player.grapple_face = "shock"
NameError: name 'player' is not defined
Windows-8-6.2.9200
Ren'Py 7.3.5.606
Fri Dec 04 15:04:59 2020
I tried defining player in an init block, then it caused a problem because it hadn't been defined before the PlayerList() function, so I made one at init -2 and the other init -1 but then I got a really weird error.
I also tried passing the player as an argument in the screen that is using this layered image, but no cigar, just got the exact same error.
Code: Select all
label start_grapple:
nvl clear
# "This is the sex scene!"
hide screen basic_overlay
show screen grapple_overlay(player=player, npc=npc_dict["npc1"])
Code: Select all
screen grapple_overlay(player, npc):
#layer "overlay2"
## Ensure this appears on top of other screens.
zorder 2
add "gui/overlay/grapple_overlay.png"
frame:
xalign 0.0
yalign 0.0
xsize 543
yfill True
background None
add "protag_grapple" xalign 0.0