Image Errors in ren'py script; 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
ForeverAmatuer
Newbie
Posts: 1
Joined: Sat Aug 30, 2014 1:58 pm
Contact:

Image Errors in ren'py script; HELP

#1 Post by ForeverAmatuer »

My first time using ren'py I had problems making a new script. I followed the quickstart guide http://www.renpy.org/doc/html/quickstart.html but once I had to start adding pictures, I got an error message claiming that it couldn't find the pictures. I re-installed ren'py, having heard it would help by reading a forum post (I don't remember where). I started over, naming the game "My Question". I received the same error message, and after creating a new folder and copying the images to it (my_question/game) and paying extra attention to the spacing, I was confused when neither the error nor the pictures showed up. It just continued without them. I re-read and thought that I should have implemented an init block, but the guide did not specify the priority number I should have used, and never showed a picture of it in its examples, so I was confused. When I tried to enter one, I received this error:

Parsing the script failed.

File "game/script.rpy", line 1: init statement expects a non-empty block.
init:< (red arrow pointing left)

This is what my code looked like:

Code: Select all

  init:
  image bg meadow = "meadow.jpg"
  image bg uni = "uni.jpg"

  image sylvie smile = "sylvie_smile.png"
  image sylvie surprised = "sylvie_surprised.png" 
  
  define s = Character('Sylvie', color="#c8ffc8")
  define m = Character('Me', color="#c8c8ff")
  
  label start:
    "I'll ask her..."

    m "Um... will you..."
    m "Will you be my artist for a visual novel?"

    "Silence."
    "She is shocked, and then..."

    s "Sure, but what is a \"visual novel?\"""
Whenever I change one thing, another error pops up. I think this all started the very first time I tried to add pictures, when I got an error that my images were not loadable while doing a check script after ren'py couldn't find the images. They're all labeled correctly, I cut and pasted from the guide. As this is my first or second time coding, I have no idea what I'm doing wrong. Help would be much appreciated. I just want to move on to the next step.

User avatar
Donmai
Eileen-Class Veteran
Posts: 1960
Joined: Sun Jun 10, 2012 1:45 am
Completed: Toire No Hanako, Li'l Red [NaNoRenO 2013], The One in LOVE [NaNoRenO 2014], Running Blade [NaNoRenO 2016], The Other Question, To The Girl With Sunflowers
Projects: Slumberland
Location: Brazil
Contact:

Re: Image Errors in ren'py script; HELP

#2 Post by Donmai »

You have an indentation problem here:

Code: Select all

init:
    image bg meadow = "meadow.jpg"
    image bg uni = "uni.jpg"

    image sylvie smile = "sylvie_smile.png"
    image sylvie surprised = "sylvie_surprised.png" 
  
    define s = Character('Sylvie', color="#c8ffc8")
    define m = Character('Me', color="#c8c8ff")
Image
No, sorry! You must be mistaking me for someone else.
TOIRE NO HANAKO (A Story About Fear)

Asceai
Eileen-Class Veteran
Posts: 1258
Joined: Fri Sep 21, 2007 7:13 am
Projects: a battle engine
Contact:

Re: Image Errors in ren'py script; HELP

#3 Post by Asceai »

Alternatively, you can just get rid of the 'init:' line, as image and define statements are implicitly init.

Post Reply

Who is online

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