Page 1 of 1

DSE ERROR

Posted: Sun Mar 27, 2016 12:02 am
by Ladythief1997
So this error pops up...

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 112: invalid syntax
    $ day = 0
     ^
    

Ren'Py Version: Ren'Py 6.99.7.858
for this coding but I dont know what syntax is supposed to go there. Any idea people?

Code: Select all

init python:
    register_stat("Strength", "strength", 10, 100)
    register_stat("Intelligence", "intelligence", 10, 100)

    dp_period("Morning", "morning_act")
    dp_choice("Attend Class", "class")
    dp_choice("Cut Class", "cut")
    
    # This is an example of an event that should only show up under special circumstances
    dp_choice("Fly to the Moon", "fly", show="strength >= 100 and intelligence >= 100")

    dp_period("Afternoon", "afternoon_act")
    dp_choice("Study", "study")
    dp_choice("Hang Out", "hang")

    dp_period("Evening", "evening_act")
    dp_choice("Exercise", "exercise")
    dp_choice("Play Games", "play")

    
# This is the entry point into the game.


    # Initialize the default values of some of the variables used in
    # the game.
    $ day = 0

    # Show a default background.
    scene black

    # The script here is run before any event.

    "In case you're just tuning in, here's the story of my life to
     date."

    "I'm a guy in the second year of high school."

    "I'm not good at sports or school or even something as simple as
     remembering peoples names."

    "In short, I am your usual random loser guy."

    "And this is my story..."


    # We jump to day to start the first day.
    jump day


# This is the label that is jumped to at the start of a day.
label day:

    # Increment the day it is.
    $ day += 1

    # We may also want to compute the name for the day here, but
    # right now we don't bother.

    "It's day %(day)d."

    # Here, we want to set up some of the default values for the
    # day planner. In a more complicated game, we would probably
    # want to add and remove choices from the dp_ variables
    # (especially dp_period_acts) to reflect the choices the
    # user has available.

    $ morning_act = None
    $ afternoon_act = None
    $ evening_act = None
    $ narrator("What should I do today?", interact=False)

    # Now, we call the day planner, which may set the act variables
    # to new values. We call it with a list of periods that we want
    # to compute the values for.
    call screen day_planner(["Morning", "Afternoon", "Evening"])

    
    # We process each of the three periods of the day, in turn.
label morning:

    # Tell the user what period it is.
    centered "Morning"

    # Set these variables to appropriate values, so they can be
    # picked up by the expression in the various events defined below. 
    $ period = "morning"
    $ act = morning_act
    
    # Execute the events for the morning.
    call events_run_period

    # That's it for the morning, so we fall through to the
    # afternoon.

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

    call events_run_period


label evening:
    
    # The evening is the same as the afternoon.
    if check_skip_period():
        jump night

    centered "Evening"

    $ period = "evening"
    $ act = evening_act
    
    call events_run_period


label night:

    # This is now the end of the day, and not a period in which
    # events can be run. We put some boilerplate end-of-day text
    # in here.

    centered "Night"

    "It's getting late, so I decide to go to sleep."

    # We call events_end_day to let it know that the day is done.
    call events_end_day

    # And we jump back to day to start the next day. This goes
    # on forever, until an event ends the game.
    jump day
         

# This is a callback that is called by the day planner. 
label dp_callback:

    # Add in a line of dialogue asking the question that's on
    # everybody's mind.
    $ narrator("What should I do today?", interact=False)

Re: DSE ERROR

Posted: Sun Mar 27, 2016 1:26 am
by trooper6
You are missing the "label start"

It should look a bit more like this:

Code: Select all

# This is the entry point into the game.
label start:

Re: DSE ERROR

Posted: Sun Mar 27, 2016 2:26 am
by Ladythief1997
The same error still popped up.

Re: DSE ERROR

Posted: Sun Mar 27, 2016 3:53 am
by Nylan
You'll need to close out of the game and re-launch (or reload) it for the change to take effect. Also make sure the start label has no leading spaces and is placed where trooper6 mentioned (under "# This is the entry point into the game.")

Re: DSE ERROR

Posted: Sun Mar 27, 2016 9:56 pm
by Ladythief1997
Its still showing up the same error

Re: DSE ERROR

Posted: Mon Mar 28, 2016 2:27 am
by Ladythief1997

Code: Select all

# You can place the script of your game in this file.
    # can integrate with a new version of DSE when it comes out.
init python:
 define register_stat $ ("Strength", "strength", 10, 100)
 define register_stat $ ("Intelligence", "intelligence", 10, 100)

    dp_period("Morning", "morning_act")
    dp_choice("Attend Class", "class")
    dp_choice("Cut Class", "cut")
    
    # This is an example of an event that should only show up under special circumstances
    dp_choice("Fly to the Moon", "fly", show="strength >= 100 and intelligence >= 100")

    dp_period("Afternoon", "afternoon_act")
    dp_choice("Study", "study")
    dp_choice("Hang Out", "hang")

    dp_period("Evening", "evening_act")
    dp_choice("Exercise", "exercise")
    dp_choice("Play Games", "play")
    
    
# Declare images below this line, using the image statement.


# The game starts here.
label start:

    # Initialize the default values of some of the variables used in
    # the game.
    $ day = 0

    # Show a default background.
    scene black

    # The script here is run before any event.

    "In case you're just tuning in, here's the story of my life to
     date."

    "I'm a guy in the second year of high school."

    "I'm not good at sports or school or even something as simple as
     remembering peoples names."

    "In short, I am your usual random loser guy."

    "And this is my story..."


    # We jump to day to start the first day.
    jump day


# This is the label that is jumped to at the start of a day.
label day:

    # Increment the day it is.
    $ day += 1

    # We may also want to compute the name for the day here, but
    # right now we don't bother.

    "It's day %(day)d."

    # Here, we want to set up some of the default values for the
    # day planner. In a more complicated game, we would probably
    # want to add and remove choices from the dp_ variables
    # (especially dp_period_acts) to reflect the choices the
    # user has available.

    $ morning_act = None
    $ afternoon_act = None
    $ evening_act = None
    $ narrator("What should I do today?", interact=False)

    # Now, we call the day planner, which may set the act variables
    # to new values. We call it with a list of periods that we want
    # to compute the values for.
    call screen day_planner(["Morning", "Afternoon", "Evening"])

    
    # We process each of the three periods of the day, in turn.
label morning:

    # Tell the user what period it is.
    centered "Morning"

    # Set these variables to appropriate values, so they can be
    # picked up by the expression in the various events defined below. 
    $ period = "morning"
    $ act = morning_act
    
    # Execute the events for the morning.
    call events_run_period

    # That's it for the morning, so we fall through to the
    # afternoon.

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

    call events_run_period


label evening:
    
    # The evening is the same as the afternoon.
    if check_skip_period():
        jump night

    centered "Evening"

    $ period = "evening"
    $ act = evening_act
    
    call events_run_period


label night:

    # This is now the end of the day, and not a period in which
    # events can be run. We put some boilerplate end-of-day text
    # in here.

    centered "Night"

    "It's getting late, so I decide to go to sleep."

    # We call events_end_day to let it know that the day is done.
    call events_end_day

    # And we jump back to day to start the next day. This goes
    # on forever, until an event ends the game.
    jump day
         

# This is a callback that is called by the day planner. 
label dp_callback:

    # Add in a line of dialogue asking the question that's on
    # everybody's mind.
    $ narrator("What should I do today?", interact=False)

    return



So that is the entire script as of now and this is what I am getting right now.

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 4: invalid syntax
    define register_stat $ ("Strength", "strength", 10, 100)
                        ^
    

Ren'Py Version: Ren'Py 6.99.7.858

Re: DSE ERROR

Posted: Mon Mar 28, 2016 10:56 am
by Nylan
This is a new error. Look at your code. What's the difference between the line shown in the error message you posted in this most recent script.py vs the first one?

Re: DSE ERROR

Posted: Mon Mar 28, 2016 4:12 pm
by Ladythief1997
Ah.. your right my bad. Still don't know how to fix it though.

Re: DSE ERROR

Posted: Mon Mar 28, 2016 8:32 pm
by Nylan

Code: Select all

init python:
 define register_stat $ ("Strength", "strength", 10, 100)
 define register_stat $ ("Intelligence", "intelligence", 10, 100)

    dp_period("Morning", "morning_act")
    dp_choice("Attend Class", "class")
    dp_choice("Cut Class", "cut")
Your "define" statements are invalid. http://www.diveintopython.net/getting_t ... _code.html

Not enough spaces in your indentation. You need 4.

Re: DSE ERROR

Posted: Tue Mar 29, 2016 5:31 am
by philat
At this point, I would strongly encourage you NOT to try to incorporate the DSE 3.0 framework into your own game right now and instead 1) study the example scripts of The Question and the Tutorial game along with the documentation (for instance, what does the $ sign do? What is the define statement?), and once you've done that, 2) simply start with the DSE 3.0 project as downloaded and study it so you can understand what you need to change to achieve what you want.

Re: DSE ERROR

Posted: Fri Apr 01, 2016 6:08 pm
by Ladythief1997
philat wrote:At this point, I would strongly encourage you NOT to try to incorporate the DSE 3.0 framework into your own game right now and instead 1) study the example scripts of The Question and the Tutorial game along with the documentation (for instance, what does the $ sign do? What is the define statement?), and once you've done that, 2) simply start with the DSE 3.0 project as downloaded and study it so you can understand what you need to change to achieve what you want.

Not A bad idea except i'm on a serious time crunch and am NOT a fast learner. I was already planning on doing that later after I got help on this and shipped the game to a buddy of mine but THE CRUNCH GOT ME. I need serious help and quickly. T-T or my gaming life is utterly over.

Re: DSE ERROR

Posted: Fri Apr 01, 2016 10:00 pm
by trooper6
Ladythief1997 wrote:
philat wrote:At this point, I would strongly encourage you NOT to try to incorporate the DSE 3.0 framework into your own game right now and instead 1) study the example scripts of The Question and the Tutorial game along with the documentation (for instance, what does the $ sign do? What is the define statement?), and once you've done that, 2) simply start with the DSE 3.0 project as downloaded and study it so you can understand what you need to change to achieve what you want.
Not A bad idea except i'm on a serious time crunch and am NOT a fast learner. I was already planning on doing that later after I got help on this and shipped the game to a buddy of mine but THE CRUNCH GOT ME. I need serious help and quickly. T-T or my gaming life is utterly over.
The problem seems to be that you want to do DSE, which is advanced, and you don't understand how to do basics...and then you say you have no time to learn the basics. It is hard to understand advanced help when you don't know the basics. It takes longer than if you learned the process properly because none of the answers will make sense until you have a foundation.

So what are your options? If the game is free, and you are in a time crunch, maybe you can put up a recruitment ad in the looking for programmers and get someone to just code it for you. I can't, because I'm already working on two short free games, but maybe someone else will code it for you for free.

Re: DSE ERROR

Posted: Mon Apr 04, 2016 1:35 am
by Ladythief1997
trooper6 wrote:
Ladythief1997 wrote:
philat wrote:At this point, I would strongly encourage you NOT to try to incorporate the DSE 3.0 framework into your own game right now and instead 1) study the example scripts of The Question and the Tutorial game along with the documentation (for instance, what does the $ sign do? What is the define statement?), and once you've done that, 2) simply start with the DSE 3.0 project as downloaded and study it so you can understand what you need to change to achieve what you want.
Not A bad idea except i'm on a serious time crunch and am NOT a fast learner. I was already planning on doing that later after I got help on this and shipped the game to a buddy of mine but THE CRUNCH GOT ME. I need serious help and quickly. T-T or my gaming life is utterly over.
The problem seems to be that you want to do DSE, which is advanced, and you don't understand how to do basics...and then you say you have no time to learn the basics. It is hard to understand advanced help when you don't know the basics. It takes longer than if you learned the process properly because none of the answers will make sense until you have a foundation.

So what are your options? If the game is free, and you are in a time crunch, maybe you can put up a recruitment ad in the looking for programmers and get someone to just code it for you. I can't, because I'm already working on two short free games, but maybe someone else will code it for you for free.
Okay I've miracle worked the project. I have one month to learn DSE any specific recommendations as to what I should learn to be able to fix the error on my own? I don't want to ask for shortcuts exactly but....Yeaa. Something that gives me enough understanding that gets me through this. Believe it or not a month is not as long as it sounds for me.