Dse help?

Discuss how to use the Ren'Py engine to create visual novels and story-based games. New releases are announced in this section.
Forum rules
This is the right place for Ren'Py help. Please ask one question per thread, use a descriptive subject like 'NotFound error in option.rpy' , and include all the relevant information - especially any relevant code and traceback messages. Use the code tag to format scripts.
Post Reply
Message
Author
User avatar
serusk
Newbie
Posts: 13
Joined: Sun May 15, 2011 1:33 pm
Projects: Aywen, Dorchadas
Contact:

Dse help?

#1 Post by serusk » Sat May 28, 2011 12:19 am

I've spent the past days trying to learn how to do this right :/
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"

    return
but when i get to the point in the game, it gives me a error

Code: 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
What am I doing wrong? I'm new to this xC

shuen
Regular
Posts: 72
Joined: Tue Mar 22, 2011 2:36 pm
Contact:

Re: Dse help?

#2 Post by shuen » Sat May 28, 2011 1:41 am

the following script cause error, remove this.
call day_planner([ "Afternoon",])
Image
.Traditional Chinese Site.
~Illustrator+Graphic/Web Designer~

User avatar
Anima
Veteran
Posts: 448
Joined: Wed Nov 18, 2009 11:17 am
Completed: Loren
Projects: PS2
Location: Germany
Contact:

Re: Dse help?

#3 Post by Anima » Sat May 28, 2011 11:52 am

Try

Code: Select all

call day_planner([ "afternoon",])
instead of

Code: Select all

call day_planner([ "Afternoon",])
Avatar created with this deviation by Crysa
Currently working on:
  • Winterwolves "Planet Stronghold 2" - RPG Framework: Phase III

User avatar
serusk
Newbie
Posts: 13
Joined: Sun May 15, 2011 1:33 pm
Projects: Aywen, Dorchadas
Contact:

Re: Dse help?

#4 Post by serusk » Sat May 28, 2011 12:57 pm

I still get the same error :/

Post Reply

Who is online

Users browsing this forum: proller