Page 1 of 1

Noob struggling with : after a choice

Posted: Wed Jan 16, 2019 2:49 am
by baileykun
So I started teaching myself how to use the program today, just a simple VN with an Affection system. Things were going smoothly until I made my first menu of choices. It worked until I added actions to one of the choices specifically. An error with the colon keep cropping up. I searched for at least an hour with no answer as to what I'm doing wrong. If someone could help me I'd be eternally grateful. I have attached the error message and a chunk of the code around the problem area.

Re: Noob struggling with : after a choice

Posted: Wed Jan 16, 2019 2:57 am
by Imperf3kt
On the line "I picked up the mug", remove the : from the end of the line.
Also, the menu and its content need to be indented once more.

Re: Noob struggling with : after a choice

Posted: Wed Jan 16, 2019 3:36 am
by baileykun
Thanks, I implemented both changes I believe. I also fished out a line I realized wound up on the wrong side of the menu which was mucking things up. However, a new error cropped up and it seems to be rejecting my jump action now. I feel like I'm missing something critical here. (Falling asleep too, will have to check back in the morning.) So sorry for this mess. I'm not really sure where to look all this up and know the info is correct and up to date. I was teaching myself from a menagerie of resources and a bit of intuition.

Re: Noob struggling with : after a choice

Posted: Wed Jan 16, 2019 4:11 am
by Nagibator
After implementing what Imperf3kt said, I'd recommend that you bring your jump statement back so that it is on the same indention as your "I picked up the mug..." quote. Also, bring "Let it cool." back as well (this includes it's body/contents). Also, I'm fairly positive you don't need a "$" before your jump statement.

Code: Select all

    "Meanwhile, the maid placed a nearby tray from a cart already waiting in the room onto the coffee table. "
    "It looks pretty hot, steam is wafting up from the mug. What should I do?"
    menu:
        "Drink the coffee.":
            "I picked up the mug and sipped slowly. The smooth yet complex flavor graced my tongue and warmed my chest."
            jump drink_coffee
        "Let it cool.":
            "I leave the steaming mug on the tray to cool down awhile."

label drink_coffee:
    "As I savored the ."
I don't particularly like fixing all of someone's code because they don't really learn much if they copy and paste it, but I'm fairly positive your mind is in the right place.

What I do recommend is to just focus on indentation. When I programmed in Java, my indentation didn't matter and my code could look as ugly as I wanted (no doubt it made things difficult later), but this is different.

Re: Noob struggling with : after a choice

Posted: Wed Jan 16, 2019 9:02 am
by mitoky
Also here a bit explaining Nagibators code which might help:

Code: Select all

    "Meanwhile, the maid placed a nearby tray from a cart already waiting in the room onto the coffee table. "
    "It looks pretty hot, steam is wafting up from the mug. What should I do?"
    menu:
        "Drink the coffee.":
            "I picked up the mug and sipped slowly. The smooth yet complex flavor graced my tongue and warmed my chest."
            jump drink_coffee
        "Let it cool.":
            "I leave the steaming mug on the tray to cool down awhile."

label drink_coffee:
    "As I savored the ."
The "Meanwhile, the maid (...)" part, is part of a label. imagine the label like a folder and each content of that label is "inside" that folder, hence 4 spaces.
The menu is in the same "folder" , hence its too intended, and the choices are part of the menu, hence the menu itself is too a folder and has the : and the content has +4 more spaces.
Since the choices do something as well they can too be considered a folder, hence they too have the : and everything "inside" that has +4 more spaces.

jump is not part of the line "I picked up the mug(...)" but of the choice "Drink the coffe" hence its on the same line. And jump doenst needs $, $ is used to change variables.


Since the next label, "drink_coffee" is not part of the previous label nor anything, its on a completly new line on its own at the start.

I hope this helped a bit!

Re: Noob struggling with : after a choice

Posted: Wed Jan 16, 2019 10:29 am
by baileykun
Thanks so much to both of you. I fiddled around with it all a bit and I was able to fix it all. I think I understand how it works better now, especially my indentation. I even added the affection points to the menu without breaking anything. I don't know why all the code examples I saw were covered in colons and $jump. Oh well.