Do you have to write "init" to start your init block?

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
TheOtherNewGuy
Regular
Posts: 26
Joined: Wed Nov 16, 2016 2:53 am
Contact:

Do you have to write "init" to start your init block?

#1 Post by TheOtherNewGuy »

Using Ren'Py 6.99.11

Getting ready to ask my next real question, but this is something I've wanted to ask for a while.

In my game I have images and characters defined before the "label start" statement (if "statement" is the right word to use), and my game seems to work fine, so does this mean you don't have to actually write "init" at the top of your script? Is an "init block" just the space before the start label?

User avatar
indoneko
Miko-Class Veteran
Posts: 528
Joined: Sat Sep 03, 2016 4:00 am
Contact:

Re: Do you have to write "init" to start your init block?

#2 Post by indoneko »

IIRC, new renpy no longer needs us to declare the images the init: section, so if your game is relatively simple, you might get away without it.
My avatar is courtesy of Mellanthe

User avatar
PyTom
Ren'Py Creator
Posts: 16096
Joined: Mon Feb 02, 2004 10:58 am
Completed: Moonlight Walks
Projects: Ren'Py
IRC Nick: renpytom
Github: renpytom
itch: renpytom
Location: Kings Park, NY
Contact:

Re: Do you have to write "init" to start your init block?

#3 Post by PyTom »

Also, certain statements - define, image, transform, and style - are automatically placed inside an init 0 block if they're not already in an init block. So unless you want to mess with priority for some reason, you don't have to include an init block around them.
Supporting creators since 2004
(When was the last time you backed up your game?)
"Do good work." - Virgil Ivan "Gus" Grissom
Software > Drama • https://www.patreon.com/renpytom

TheOtherNewGuy
Regular
Posts: 26
Joined: Wed Nov 16, 2016 2:53 am
Contact:

Re: Do you have to write "init" to start your init block?

#4 Post by TheOtherNewGuy »

Hmm, okay cool. Thanks for these answers.

Also, PyTom. Out of frustration I may have mentioned in some of my posts that the documentation was hard to understand. Just wanted to clarify that, first and foremost, I'm really glad it's there, if not simply because smarter people can understand it and explain it to others. So, thank you for all the time it took to write it up, updating the software, etc.

Post Reply

Who is online

Users browsing this forum: Alex, Bing [Bot]