CuppaCoffee

python code which isn't working for me

Sep 7th, 2012
73
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 2.48 KB | None | 0 0
  1. # if it matters, here's the screen code, but I think this works fine.
  2.  
  3. screen explore1:
  4.     frame:
  5.         xpadding 10
  6.         ypadding 10
  7.         xalign 1.0
  8.         yalign 0
  9.        
  10.         vbox:
  11.  
  12.             text "Explore your cell."
  13.             null height 10
  14.             textbutton "Try to leave." action Jump("leavecell")
  15.             textbutton "Examine yourself." action Jump("exself")
  16.             textbutton "Examine the brick walls." action Jump("exwalls")
  17.  
  18.  
  19. label start:
  20.     $ knowname = False
  21.     $ cellkey = False
  22.  
  23.     j "Ugh..."
  24.     j "Wh... why am I here?!"
  25.     j "I don't remember anything..."
  26.     show screen explore1
  27.     jump chooseaction
  28.  
  29. label exwalls:
  30.         j "Hard stone... the bricks are very refined."
  31.         j "What's this?!"
  32.         j "One of them's loose!"
  33.         $ cellkey = True
  34.         j "There's a key here!"
  35.         jump chooseaction
  36.  
  37. label exself:
  38.         j "Who am I...?"
  39.         j "I...  I can't remember..."
  40.         j "Huh? There's something in my pocket..."
  41.         j "A wallet!"
  42.         j "My name... it's Jack McKen."
  43.         j "At least I know that now..."
  44.         $ knowname = True
  45.         jump chooseaction
  46.        
  47. label leavecell:
  48.  
  49.         j "It's time to get out of here!"
  50.         if cellkey:
  51.             j "Let's just use this key..."
  52.             j "There!"
  53.             jump outofcell
  54.         else:
  55.             j "The bars won't budge. There's gotta be something here which'll help me."
  56.             jump chooseaction
  57. label outofcell:
  58.  
  59.         j "Now I'm out of there... where am I?"
  60.         j "This place is a prison... what am I doing here...?"
  61.  
  62. label chooseaction:
  63.         "Choose an action."
  64.         jump chooseaction
  65.        
  66. return
  67.  
  68.  
  69. I'm sorry, but an uncaught exception occurred.
  70.  
  71. While running game code:
  72.  File "game/script.rpy", line 44, in script
  73.  File "game/script.rpy", line 44, in python
  74. NameError: name 'cellkey' is not defined
  75.  
  76. -- Full Traceback ------------------------------------------------------------
  77.  
  78. Full traceback:
  79.  File "C:\Documents and Settings\Lillian\My Documents\Games\Renpy\renpy\execution.py", line 265, in run
  80.  File "C:\Documents and Settings\Lillian\My Documents\Games\Renpy\renpy\ast.py", line 1374, in execute
  81.  File "C:\Documents and Settings\Lillian\My Documents\Games\Renpy\renpy\python.py", line 1009, in py_eval
  82.  File "game/script.rpy", line 44, in <module>
  83. NameError: name 'cellkey' is not defined
  84.  
  85. Windows-XP-5.1.2600-SP3
  86. Ren'Py 6.13.12.1728
  87. A Ren'Py Game 0.0
Advertisement
Add Comment
Please, Sign In to add comment