Create a game top menu ERROR parsing script failed

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
TDT
Newbie
Posts: 2
Joined: Mon Jul 06, 2020 11:30 am
Contact:

Create a game top menu ERROR parsing script failed

#1 Post by TDT »

I have tried and failed to follow the tutorial by Johannes89 on YouTube. Every time I think I got it right errors keep coming up and as many people just starting out I am getting extremely frustrated. I am trying to create a map icon in the top right which opens the map and then simply returns to the VN when clicked (I need to add image maps later to make it go to another map).


define k = Character("Kay")

label splashscreen:
scene pic3
pause
show pic4 with dissolve
pause
return

screen ingame_menu:
hbox:
yalign 0.0
xalign 1.0
imagebutton auto "images/mapbutton.png" action Show("mapscreen")

screen mapscreen
add "images/map.png"
imagebutton auto "images/map.png" action Return()

label start:
show screen ingame_menu
scene pic1
pause
return


error:
Parsing the script failed
File "game/script.rpy, line 17: Line is indented, but the preceding screen statement does not expect a block.

I am pulling my hair out (what little I have left). I am able to do a simple A-Z dialog with changing scenery and character, but as soon as I try to add a map I fail completely and have no clue what I am doing wrong since I am following a tutorial to a T. I deleted everything but the map and the initial background and still nothing. I tried to find another tutorial, but none seem to deal with adding a map navigation button. My wife wants to do a visual novel and I am trying to help. I don't want to be that guy, but it seems way over my head if I can't even get a small thing to work right.

User avatar
RicharDann
Veteran
Posts: 286
Joined: Thu Aug 31, 2017 11:47 am
Contact:

Re: Create a game top menu ERROR parsing script failed

#2 Post by RicharDann »

You need to add the colon (:) at the end of your mapscreen definition.

Code: Select all

screen mapscreen: #<-- here
    add "images/map.png"
    imagebutton auto "images/map.png" action Return()
The most important step is always the next one.

TDT
Newbie
Posts: 2
Joined: Mon Jul 06, 2020 11:30 am
Contact:

Re: Create a game top menu ERROR parsing script failed

#3 Post by TDT »

Whoa, that fixed that portion. It ended up running until I ended up in game and then there were a bunch of exceptions. I really need to find a proper tutorial. I'll try to ask on discord. Thank you so much!

Post Reply

Who is online

Users browsing this forum: Bing [Bot], Google [Bot]