| | |
text adventure game problem!
Thread Solved |
•
•
Join Date: Apr 2008
Posts: 19
Reputation:
Solved Threads: 0
yeah, another one...but this time in python! yay, more errors!
first off, here's the code..
(based off of chris99's code...the only example i could find for a text adventure game!)
Now, my problem is where it says
I run the program, and at first it appears to be working. From the start, I can go north to the clear field spot. But from there, no matter what I try to do, it gives me a
:note: not actualy username...
anyway, anyone know how to solve this??
first off, here's the code..
(based off of chris99's code...the only example i could find for a text adventure game!)
Now, my problem is where it says
python Syntax (Toggle Plain Text)
elif prompt_p == 'examine sign': print """Behold the mysterious grating! For some unknown reason, it will not open until you have 57 gold. Why the odd number? I don't know...just play along will ya? You won't get out unless you do!""" prompt_p()
I run the program, and at first it appears to be working. From the start, I can go north to the clear field spot. But from there, no matter what I try to do, it gives me a
Python Syntax (Toggle Plain Text)
Traceback (most recent call last): File "C:\Documents and Settings\enokar\My Documents\programming stuff\Python\better text adventure test.py", line 56, in <module> field() File "C:\Documents and Settings\enokar\My Documents\programming stuff\Python\better text adventure test.py", line 16, in field prompt_field() File "C:\Documents and Settings\enokar\My Documents\programming stuff\Python\better text adventure test.py", line 20, in prompt_field clear_path() File "C:\Documents and Settings\enokar\My Documents\programming stuff\Python\better text adventure test.py", line 29, in clear_path prompt_path() File "C:\Documents and Settings\enokar\My Documents\programming stuff\Python\better text adventure test.py", line 43, in prompt_path prompt_p() TypeError: 'str' object is not callable
anyway, anyone know how to solve this??
Last edited by IU34; Apr 5th, 2008 at 9:14 pm.
•
•
Join Date: Apr 2008
Posts: 19
Reputation:
Solved Threads: 0
Yes!! I got it! okay never mind guys...
just to let other people know, I had to change at the end where I called the prompt_p. First I changed everything on that part the prompt_cle, and at the end to call the prompt again I had to put prompt_clear() instead of prompt_p().
just to let other people know, I had to change at the end where I called the prompt_p. First I changed everything on that part the prompt_cle, and at the end to call the prompt again I had to put prompt_clear() instead of prompt_p().
Last edited by IU34; Apr 5th, 2008 at 10:29 pm.
•
•
Join Date: Apr 2008
Posts: 19
Reputation:
Solved Threads: 0
okay, sorry for _triple_ post...
(new code)
so, my new error message is 'local variable 'gold' refferenced before assignment.'
now what?
(new code)
so, my new error message is 'local variable 'gold' refferenced before assignment.'
now what?
![]() |
Similar Threads
- How would I make a text adventure? (Python)
- Structs and Displaying Details (C)
- text adventure programming help (Python)
- Text Adventure -- Classes (Python)
Other Threads in the Python Forum
- Previous Thread: Are .JPGs possible in Tkinter?
- Next Thread: text adventure game "local variable refferenced before assignment"
| Thread Tools | Search this Thread |
abrupt ansi anti apache approximation array assignment avogadro backend beginner binary bluetooth book builtin calculator character cmd converter countpasswordentry curved customdialog dan08 decimals dictionaries dictionary dynamic error exe file float format function gnu graphics heads homework http ideas import inches input java leftmouse library line lines linux list lists loop module mouse mysqlquery number numbers numeric output parsing path phonebook plugin pointer prime programming progressbar py2exe pygame python random recursion redirect scrolledtext software sqlite statictext statistics string strings sum table terminal text textarea thread threading time tlapse trick tuple tutorial twoup ubuntu unicode urllib urllib2 variable wordgame write wxpython xlib





