Problem with DSE: invalid syntax

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
Calissa Leigh
Regular
Posts: 54
Joined: Wed Apr 11, 2012 11:04 am
Completed: No games, just books. :)
Projects: Murder Mystery 1
Organization: Arcato Publishing
Location: Among the people, and Cajuns
Contact:

Problem with DSE: invalid syntax

#1 Post by Calissa Leigh » Sat Apr 21, 2012 7:58 pm

I'm sorry for this one but I'm not exactly sure what the hang up is. It appears when the script switches from "Morning" to "Afternoon". It's something from within the original DSE scripting, an area I haven't touched yet in the original file taken from the DSE event_dispatcher.

Code: Select all

I'm sorry, but an uncaught exception occurred.

While running game code:
  File "game/main.rpy", line 373, in script call
  File "game/event_dispatcher.rpy", line 255, in script
  File "game/event_dispatcher.rpy", line 262, in python
  File "game/event_dispatcher.rpy", line 60, in python
  File "game/event_dispatcher.rpy", line 99, in python
SyntaxError: invalid syntax (<none>, line 1)

-- Full Traceback ------------------------------------------------------------

Full traceback:
  File "C:\Users\Sangoire\Desktop\renpy-6.13.12\renpy\execution.py", line 265, in run
  File "C:\Users\Sangoire\Desktop\renpy-6.13.12\renpy\ast.py", line 632, in execute
  File "C:\Users\Sangoire\Desktop\renpy-6.13.12\renpy\python.py", line 972, in py_exec_bytecode
  File "game/event_dispatcher.rpy", line 262, in <module>
  File "game/event_dispatcher.rpy", line 60, in check
  File "game/event_dispatcher.rpy", line 99, in eval
  File "C:\Users\Sangoire\Desktop\renpy-6.13.12\renpy\python.py", line 1009, in py_eval
  File "C:\Users\Sangoire\Desktop\renpy-6.13.12\renpy\python.py", line 259, in py_compile
SyntaxError: invalid syntax (<none>, line 1)

Windows-7-6.1.7601-SP1
Ren'Py 6.13.12.1728
 
I'm not sure where to begin with this one.


Line 373 is:

Code: Select all

    centered "Afternoon"

    $ period = "afternoon"
    $ act = afternoon_act

    $ normalize_stats()
    
373>>>    call events_run_period
255 and 262is:

Code: Select all

label events_run_period:

    $ events = [ ]

255>>>    python hide:

        eobjs = [ ]
        egroups = { }
        eingroup = { }

        for i in all_events:
262>>>            if not i.check(eobjs):
                continue
                
            eobjs.append(i)

            props = i.properties()


User avatar
sciencewarrior
Veteran
Posts: 356
Joined: Tue Aug 12, 2008 12:02 pm
Projects: Valentine Square (writer) Spiral Destiny (programmer)
Location: The treacherous Brazilian Rainforest
Contact:

Re: Problem with DSE: invalid syntax

#2 Post by sciencewarrior » Sat Apr 21, 2012 9:37 pm

The error is happening while evaluating those strings with the events' conditions. At least one of them contains invalid Python code. Can you post your full list of events?
Keep your script in your Dropbox folder.
It allows you to share files with your team, keeps backups of previous versions, and is ridiculously easy to use.

Calissa Leigh
Regular
Posts: 54
Joined: Wed Apr 11, 2012 11:04 am
Completed: No games, just books. :)
Projects: Murder Mystery 1
Organization: Arcato Publishing
Location: Among the people, and Cajuns
Contact:

Re: Problem with DSE: invalid syntax

#3 Post by Calissa Leigh » Sat Apr 21, 2012 10:28 pm

Code: Select all

    $ event("work", "act == 'work'", event.only(), priority=200)
    $ event("clean", "act == 'clean'", priority=200)
    $ event("unclean", "act == 'clean' and dirty >=10", event.only(), priority=210)
    $ event("shop", "act == 'shop'", event.choose_one('shop'), priority=200)
    $ event("shop2", "act == 'shop'", event.choose_one('shop'), priority=200)
    $ event("work", "act == 'eyespy' and intelligence >=50 and clues >=20", event.once(), priority=200)
    $ event("weekly", "act == 'weekly' and day % 7 = 0", priority=200)
    $ event("biweeklyevent", "act == 'biweekly' and day % 15 = 0", priority=200)   
    $ event("payrent", "act == 'payrent' and day % 30 = 0", priority=200)
    $ event("payrent", "act == 'rentglasses' and day % 30 = 0 and money <= 100", event.once(), priority=210)
    $ event("payrent", "act == 'rentjail' and day % 30 = 0  and money <= 100", event.only(), priority=210)

Those are all the event strings.

Code: Select all

    dp_period("Afternoon", "afternoon_act")
    dp_choice("Read", "study")
    dp_choice("Hang Out", "hang")
    dp_choice("Paint", "paint")
    dp_choice("Take a Walk", "walk")
The listed events available to choose from for the afternoon.

And short versions of the event actions:

Code: Select all

label hang:
    show bg beach with dissolve
    p "Hanging out with my friends."
    "Party!"
    $ artpoints +=5
    $ tension +=1
    $ dirty +=1
    return

label paint:
    show bg room with dissolve
    p "I spent the day painting. It felt nice."
    $ artpoints +=5
    $ tension +=1
    $ dirty +=1
    return

label walk:
    show bg beach with dissolve
    p "I took a walk."
    $ silentpoints +=5
    $ tension +=2
    $ dirty +=1
    return


    
label study:
    show bg room
    p "I picked up a nice book to read."
    $ intelligence +=5
    $ glassespoints +=5
    $ tension +=1
    $ dirty +=1
    return

Calissa Leigh
Regular
Posts: 54
Joined: Wed Apr 11, 2012 11:04 am
Completed: No games, just books. :)
Projects: Murder Mystery 1
Organization: Arcato Publishing
Location: Among the people, and Cajuns
Contact:

Re: Problem with DSE: invalid syntax

#4 Post by Calissa Leigh » Sat Apr 21, 2012 10:32 pm

And thanks for looking at the problem. :) It really shouldn't be looking over the events at all, I haven't written any events for the afternoon yet so I wasn't sure, I just didn't see where it might be interacting.

User avatar
sciencewarrior
Veteran
Posts: 356
Joined: Tue Aug 12, 2008 12:02 pm
Projects: Valentine Square (writer) Spiral Destiny (programmer)
Location: The treacherous Brazilian Rainforest
Contact:

Re: Problem with DSE: invalid syntax

#5 Post by sciencewarrior » Sun Apr 22, 2012 3:27 am

You're welcome. The problem is in code like " and day % 30 = 0". One equals sign means variable assignment; for comparison you have to use two equal signs, like this: " and day % 30 == 0"

Confusing, I know. But you get used to it after a while.
Keep your script in your Dropbox folder.
It allows you to share files with your team, keeps backups of previous versions, and is ridiculously easy to use.

Calissa Leigh
Regular
Posts: 54
Joined: Wed Apr 11, 2012 11:04 am
Completed: No games, just books. :)
Projects: Murder Mystery 1
Organization: Arcato Publishing
Location: Among the people, and Cajuns
Contact:

Re: Problem with DSE: invalid syntax

#6 Post by Calissa Leigh » Sun Apr 22, 2012 9:34 am

Ah! Okay. :) Thanks again. I'm trying to get all the kinks worked out before I enter in all the basic scripting for the scenes. Hopefully this will be the last one for the DSE script.

Post Reply

Who is online

Users browsing this forum: No registered users