[solved] Image declaration/initialisation

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
User avatar
Ayutac
Regular
Posts: 150
Joined: Thu Oct 18, 2012 2:23 pm
Projects: Pokémon Dating Sim
Organization: A Breeze Of Science
Deviantart: Ubro
Location: Mayence, Germany
Contact:

[solved] Image declaration/initialisation

#1 Post by Ayutac » Sun Sep 15, 2013 10:59 am

Hello there, long time not read.

A new project usually has this line in script.rpy

Code: Select all

## You can place the script of your game in this file.

## Declare images below this line, using the image statement.
## eg. image eileen happy = "eileen_happy.png"
I did so and it is the only place in my whole script which is neither in an init/early block nor behind a label which is jumped to from within the game.

But by now I have about 100 images to be loaded and I would like to put it outside the script. How do I do this without breaking anything (in the sense of save issues, which I had a lot in the past; fixed through)?
And when is this part run through?
Same for the character declaration block which follows after the images:

Code: Select all

## Declare characters used by this game.
## In general, we will have two Variables for a character: 
## The one with data (Python-based) and the one to look at and speak with (Ren'Py-based).
## The first's name will start with a small letter and the last with a big letter.
Last edited by Ayutac on Sun Sep 15, 2013 1:24 pm, edited 1 time in total.
Up next: An original, open source, text-based Dating Sim. Stay tuned ;)

Elmiwisa
Veteran
Posts: 476
Joined: Sun Jul 21, 2013 8:08 am
Contact:

Re: Image declaration/initialisation

#2 Post by Elmiwisa » Sun Sep 15, 2013 1:14 pm

What's wrong with declaring image and define character in an init block? :?
After all, image declaration and character definition always run in an init block even if you don't explicitly put them in one. Only image declaration is slightly strange because it would have priority 990 instead of 0 if you don't explicitly put it in an init block, but I doubted that you do anything unusual enough for it to matter.
Beside, if you don't indent the line, then they are never part of any block. No matter where you put them.

User avatar
Ayutac
Regular
Posts: 150
Joined: Thu Oct 18, 2012 2:23 pm
Projects: Pokémon Dating Sim
Organization: A Breeze Of Science
Deviantart: Ubro
Location: Mayence, Germany
Contact:

Re: Image declaration/initialisation

#3 Post by Ayutac » Sun Sep 15, 2013 1:24 pm

so no indent is priority 990 or only the images? Anyway, thanks for the information. I'll just keep them at init 800 to be sure.
Up next: An original, open source, text-based Dating Sim. Stay tuned ;)

Elmiwisa
Veteran
Posts: 476
Joined: Sun Jul 21, 2013 8:08 am
Contact:

Re: [solved] Image declaration/initialisation

#4 Post by Elmiwisa » Sun Sep 15, 2013 1:35 pm

The image only.
When using image statement, it's priority 990.
When using define statement (whether character or anything else), it's priority 0.
I am guessing the image is default to priority 990 because unless you do something very unusual, there is literally no way to actually use an image in an init block, but there is a lot of situation where in order to declare an image you need to use something else first. Hence image is declared as late as possible.

Post Reply

Who is online

Users browsing this forum: Google [Bot], _ticlock_