I have a problem with my script on Renpy and could... no in fact, I really need a hand. I'm just tearing my hair out in frustration since two days. I'm trying to do a pretty simple thing I guess : The player can ask five question to a PNJ. Four are true question, the last one is just to proceed with the game. I want to make a question disapear when it is asked, and then, go back to the other questions not asked.
I have that error screen :
Code: Select all
I'm sorry, but an uncaught exception occurred.
While running game code:
File "game/script.rpy", line 588, in script
File "game/script.rpy", line 589, in python
NameError: name 'question_first' is not defined
-- Full Traceback ------------------------------------------------------------
Full traceback:
File "D:\Guillaume\Bureau\renpy-6.16.5-fr\renpy\execution.py", line 288, in run
node.execute()
File "D:\Guillaume\Bureau\renpy-6.16.5-fr\renpy\ast.py", line 1309, in execute
choice = renpy.exports.menu(choices, self.set)
File "D:\Guillaume\Bureau\renpy-6.16.5-fr\renpy\exports.py", line 550, in menu
if renpy.python.py_eval(condition) ]
File "D:\Guillaume\Bureau\renpy-6.16.5-fr\renpy\python.py", line 1342, in py_eval
return eval(py_compile(source, 'eval'), globals, locals)
File "game/script.rpy", line 589, in <module>
"Why Now ?" if question_first == True:
NameError: name 'question_first' is not defined
Code: Select all
$ bitchy = True
$ corruption = 0
$ love = 0
$ question_first = None
$ question_second = True
$ question_third = True
$ question_fourth = True
I read many tutorial but I can't find my mistake. I read in this forum that I should change the "$" by "default". I tried that, but then my game dont lunch and I have that error,
Code: Select all
I'm sorry, but errors were detected in your script. Please correct the
errors listed below, and try again.
File "game/script.rpy", line 51: expected statement.
default bitchy = None
^
File "game/script.rpy", line 52: expected statement.
default corruption = 0
^
File "game/script.rpy", line 53: expected statement.
default love = 0
^
File "game/script.rpy", line 54: expected statement.
default question_first = None
^
File "game/script.rpy", line 55: expected statement.
default question_second = True
^
File "game/script.rpy", line 56: expected statement.
default question_third = True
^
File "game/script.rpy", line 57: expected statement.
default question_fourth = True
^
and I don't know what is wrong. I read some tutorial (Outdated?) for menu with if and varible with default and I don't know what is different in my code.
Here are the line for the menu with if.
Code: Select all
label questionmenu :
log "We deeply apologize. If you have any question, I’m willing to answer them."
menu :
"Why Now ?" if question_first == True:
$ question_first = False
jump questionN1
"third one" if question_second == True:
$ question_second = False
jump questionN2
"second one" if question_third == True:
$ question_third = False
jump questionN3
"First one" if question_fourth == True:
$ question_fourth = False
jump questionN4
"Nan, it’s alright. Let me sleep.":
jump endquestion
label questionN1 :
blablabla
jump questionmenu
label questionN2 :
blabla
jump questionmenu
label questionN3 :
blablabla
jump questionmenu
label questionN4 :
blablabla
jump questionmenu
label endquestion :
log "In fact, it’s already daylight !"
log "Well, good bye for now my friend. We should meet again."
Someone is willing to help me please?
Thanks for reading!