What i'm trying to do is pull up the day planner for the afternoon only, heres my code.
Code: Select all
init python:
afternoon_act = None
register_stat("Strength", "strength", 10, 100)
register_stat("Intelligence", "intelligence", 10, 100)
register_stat("Charasima", "charm", 10, 100)
dp_period("afternoon", "afternoon_act")
dp_choice("Video Store", "video")
dp_choice("Clothing", "clothi")
dp_choice("Cafe","cafe2")
dp_choice("Book Store","book")
init:
$ event("video", "act == 'video'", event.only(), priority=200)
$ event("video2", "act == 'video'", priority=210)
$ event("clothi", "act == 'clothi'", event.choose_one('cut'), priority=200)
$ event("cafe2", "act == 'cafe2'", event.choose_one('cut'), priority=200)
$ event("book", "act == 'book'", event.solo(), priority=200)
label afternoon:
# It's possible that we will be skipping the afternoon, if one
# of the events in the morning jumped to skip_next_period. If
# so, we should skip the afternoon.
if check_skip_period():
jump evening
# The rest of this is the same as for the morning.
centered "Afternoon"
$ period = "afternoon"
$ act = afternoon_act
$ normalize_stats()
call events_run_period
call day_planner([ "Afternoon",])
############################################
label video:
"I work at the video store."
$ coins += 10
return
label clothi:
"I shop at the Clothing store..."
return
label cafe2:
"I work at the cafe"
$ coins += 10
return
label book:
"I shop for books"
returnCode: Select all
I'm sorry, but an uncaught exception occurred.
While running game code:
File "game/Genrel.rpy", line 43, in script call
call day_planner([ "Afternoon",])
File "game/day_planner.rpy", line 78, in script
python hide:
File "game/day_planner.rpy", line 89, in python
raise Exception("Period %r was never defined." % p)
Exception: Period 'Afternoon' was never defined.
-- Full Traceback ------------------------------------------------------------
Full traceback:
File "C:\Documents and Settings\HP_Administrator\My Documents\renpy-6.12.1\renpy\execution.py", line 261, in run
File "C:\Documents and Settings\HP_Administrator\My Documents\renpy-6.12.1\renpy\ast.py", line 630, in execute
File "C:\Documents and Settings\HP_Administrator\My Documents\renpy-6.12.1\renpy\python.py", line 960, in py_exec_bytecode
File "game/day_planner.rpy", line 89, in <module>
Exception: Period 'Afternoon' was never defined.
Windows-XP-5.1.2600-SP3
Ren'Py 6.12.1.1501
A Ren'Py Game 0.0

