Trying to figure out how Ren'Py works

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.
Message
Author
User avatar
yummy
Miko-Class Veteran
Posts: 733
Joined: Fri Jul 07, 2006 9:58 pm
Projects: Suna to Majo
Location: France
Contact:

Trying to figure out how Ren'Py works

#1 Post by yummy » Fri Jul 07, 2006 10:11 pm

So I'm planning on using Ren'Py for a game I'm currently writing, but alas, as I tried to run a small script to test the game engine, it kept throwing me the same error.

Here's my script code:

Code: Select all

init:
        
        $ config.screen_width = 800
        $ config.screen_height = 600
        $ config.window_title = "Test"

        image bg route = Image("bgroute.jpg")
        image bg hokora = Image("bghokora.jpg")
        image black = Solid((0, 0, 0, 255))

        image nanaca smile = "TCCN0100.png"
        image nanaca erai = "TCCN0101.png"
        image nanaca pensive = "TCCN0102.png"

        $ n = Character('Nanaca', color=(200, 255, 200, 255))
        $ d = Character('Daichi', color=(125, 100, 200, 255))

label start:

        scene bg route with fade
        $ renpy.music.play('bgm004.ogg')
        
        "So, this is it."
        
        $ renpy.play('vfccc0006annk000.ogg')
        "Girl" "Nyaiiiiii!"
and here's the error message output:

Code: Select all

I'm sorry, but an exception occured while executing your Ren'Py
script.

Exception: Style image is not known.

After initialization, but before game start.

-- Full Traceback ------------------------------------------------------------

  File "renpy\bootstrap.pyo", line 96, in bootstrap
  File "renpy\main.pyo", line 233, in main
  File "renpy\main.pyo", line 102, in run
  File "renpy\style.pyo", line 163, in build_styles
  File "renpy\style.pyo", line 146, in build_style
Exception: Style image is not known.

After initialization, but before game start.

Ren'Py Version: Ren'Py 5.5.2b
I've been trying to figure out what I did wrong for about 4 hours but well I guess I really need help after all.

I hope you see what's wrong :'(

edit:
My images are rather plain png and jpg.
png ones only have alpha properties (transparency).

User avatar
denzil
Veteran
Posts: 293
Joined: Wed Apr 20, 2005 4:01 pm
Contact:

#2 Post by denzil » Sat Jul 08, 2006 12:38 am

Edit:
Removed
*note to self: do not post too early in the morning*
Last edited by denzil on Sat Jul 08, 2006 1:16 am, edited 1 time in total.
Practice makes purrrfect.
Finished projects: Broken sky .:. colorless day .:. and few more...

User avatar
PyTom
Ren'Py Creator
Posts: 15893
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:

#3 Post by PyTom » Sat Jul 08, 2006 1:02 am

No, that's not it. Actually, it looks to me like style.rpy is missing... try re-downloading Ren'Py.
Supporting creators since 2004
(When was the last time you backed up your game?)
"Do good work." - Virgil Ivan "Gus" Grissom
"Silly and fun things are important." - Elon Musk
Software > Drama • https://www.patreon.com/renpytom

User avatar
yummy
Miko-Class Veteran
Posts: 733
Joined: Fri Jul 07, 2006 9:58 pm
Projects: Suna to Majo
Location: France
Contact:

#4 Post by yummy » Sat Jul 08, 2006 5:49 am

Okay seems like I didn't add every file, pardon me :oops:

By the way, what are the vital files for Ren'Py?

I just put the "common" folder and it worked fine.

One more question: does the error dump only have sense to those who are familiar with python language?

Thank you for answering me :D

User avatar
PyTom
Ren'Py Creator
Posts: 15893
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:

#5 Post by PyTom » Sat Jul 08, 2006 10:30 am

yummy wrote: By the way, what are the vital files for Ren'Py?
http://www.bishoujo.us/trac/wiki/ReleasingRenpyGames

has a discussion of which files are important, and which aren't. Don't be too aggressive about deleting files... for example, the tools/ directory shouldn't be shipped with a game, but is useful while making a game.
One more question: does the error dump only have sense to those who are familiar with python language?
Well, my hope is that a little bit of the error dump is readable to everyone... enough of it that you can figure out if there is a problem in the script. But much of the detail is in there for me, to help me if there's a bug in Ren'Py rather than in your script. I can usually tell that from the script + the traceback.

Thank you for answering me :D[/quote]
Supporting creators since 2004
(When was the last time you backed up your game?)
"Do good work." - Virgil Ivan "Gus" Grissom
"Silly and fun things are important." - Elon Musk
Software > Drama • https://www.patreon.com/renpytom

User avatar
yummy
Miko-Class Veteran
Posts: 733
Joined: Fri Jul 07, 2006 9:58 pm
Projects: Suna to Majo
Location: France
Contact:

#6 Post by yummy » Sat Jul 08, 2006 8:32 pm

Thanks for the link it really helped.

I have other minor questions and after searching the forum and the tutorials, I didn't see any reference, so :

- How can I do to make a text "wait" until the sound that is linked has finished playing?

By exemple, Nanaca tells Daichi something and I want her sentence to remain on screen so that the user has nothing to override it.

It might not be important seen as this, but I really need to do that in order to place several critical sentences associated with sound.

Another question:
- How can I put a little "something" that blinks or animates at the end of a sentence, like these little icons which loop ?

I don't know if I'm understandable there XD

I mean, when the string is displayed, is there a possibility to put a little image or an animation at the end of it?

User avatar
yummy
Miko-Class Veteran
Posts: 733
Joined: Fri Jul 07, 2006 9:58 pm
Projects: Suna to Majo
Location: France
Contact:

#7 Post by yummy » Mon Jul 10, 2006 8:34 am

Another question rose:
- Is it possible to do nearly immediate fades so that the shown image would only be viewed as a retinal remnant? (I know I'm asking weird questions, but well)

I've been playing with image effects since then and I still don't get how to use the alpha :/

This quite differs from character animation so I can't use anim.SMAnimation

Code: Select all

image blinking = anim.SMAnimation( "a",
        anim.State( "a", "bgcc0005.png"),
        anim.Edge( "b", 1.0, "a", prob=60),
        anim.Edge("a", 0.25, "b"),
        anim.State("b", "bgcc0016.png")
        )
because it isn't about characters but background :/
Plus, I would have liked to do fade blurring...

Is there a way to do that? :/

User avatar
PyTom
Ren'Py Creator
Posts: 15893
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:

#8 Post by PyTom » Mon Jul 10, 2006 8:58 am

yummy wrote:Another question rose:
- Is it possible to do nearly immediate fades so that the shown image would only be viewed as a retinal remnant? (I know I'm asking weird questions, but well)
I'm not sure what you mean by this.
because it isn't about characters but background :/
Plus, I would have liked to do fade blurring...

Is there a way to do that? :/
There is no difference between characters and background, as far as images are concerened. If you can do it with one, you can do it with the other.

Do you have a background in psychology, or something? These terms seem vaguely familiar, sorta.
Supporting creators since 2004
(When was the last time you backed up your game?)
"Do good work." - Virgil Ivan "Gus" Grissom
"Silly and fun things are important." - Elon Musk
Software > Drama • https://www.patreon.com/renpytom

User avatar
monele
Lemma-Class Veteran
Posts: 4101
Joined: Sat Oct 08, 2005 7:57 am
Location: France
Contact:

#9 Post by monele » Mon Jul 10, 2006 10:08 am

I'm trying to imagine what you're looking for... Either you just want something to be displayed immediately on the screen but just as quickly disappear in a very quick dissolve/fade. If so :

Code: Select all

show thePicture with None
hide thePicture with Dissolve(0.2)

If you want something closer to what happens when you look briefly at the sun or get a lamp flashed in your eyes temporarily, I guess you could have a better effect by having your "bright" picture and another one keeping only brightness values (a picture with a red disc, and a picture with the same disc in pure black surrounded by pure white). You would then use ImageTransition to make dark zones fade out first, and the brightest zones last.

Code example to come if that's the one you want ^^

User avatar
yummy
Miko-Class Veteran
Posts: 733
Joined: Fri Jul 07, 2006 9:58 pm
Projects: Suna to Majo
Location: France
Contact:

#10 Post by yummy » Mon Jul 10, 2006 3:18 pm

Actually, I've been trying to create a fast background flip.
It's quite simple in theory: you display a still background image BG1.
Then with another one, BG2, you quickly fade it in while BG1 blurs out.
Then BG2 blurs out and BG1 fades in back.

I tried this script:

Code: Select all

scene bgimage1 with Fade
show bgimage2 with Dissolve(0.2)
hide bgimage2 with Dissolve(0.2)
scene bgimage1 with Fade
but it didn't quite do what I really wanted :/
What I tried to ask in a weird way was: Can I put the bg images on different layers so that you would have quick fades with each one, in order to create a "retinal remnant", like those you could get naturally when in your room you quickly turn on lights as the place is in the darkness ?

I think monele grabbed the concept, but I still don't know how to create it :/

(btw what's the difference with scene and show statements?)

User avatar
Jake
Support Hero
Posts: 3826
Joined: Sat Jun 17, 2006 7:28 pm
Contact:

#11 Post by Jake » Tue Jul 11, 2006 4:45 am

yummy wrote: (btw what's the difference with scene and show statements?)
If you use 'show', the image gets added to the existing scene alongside (and over the top of, where appropriate) any other images in the scene.
(If they have the same tag - the first word of the image name - then it replaces the existing one rather than adding a new one)

If you use 'scene', it creates a new scene, replacing the old BG image entirely, and removes all images that you'd 'show'n previously.

So:

Code: Select all

scene bg room    # Clears all images, sets 'bg room' as background for new scene

show lucy happy    # Adds a new image 'lucy happy' to the scene

show charlie happy    # Adds a new image 'charlie happy' to the scene

show lucy football    # Replaces 'lucy happy' in the existing scene with 'lucy football'

scene bg sky    # Clears all images, including the old background, 'lucy football' and 'charlie happy', and sets 'bg sky' as the background.

For your overexposure question, I'd think the best way would be to prepare three images - the room unlit, the room overexposed and bloomed, and the room normally lit. Off the top of my head, something like the following would work:

Code: Select all

scene room unlit

scene room bloom

$ renpy.pause(0.2)

scene room lit with Dissolve(0.8)
If you want to have characters in there at the same time it's a little trickier, 'cause scene statements will remove them all - but you can defer the transition until after you've populated the scene, like this:

Code: Select all

scene room unlit
show mary unlit happy

scene room bloom
show mary bloom happy

$ renpy.pause(0.2)

scene room lit
show mary lit happy
with Dissolve(0.8)
(I think that'll work... but there's probably a horrible error there that prevents that from working, I've not got Ren'Py in front of me...)

User avatar
monele
Lemma-Class Veteran
Posts: 4101
Joined: Sat Oct 08, 2005 7:57 am
Location: France
Contact:

#12 Post by monele » Tue Jul 11, 2006 6:26 am

I would have gone with a similar code. Maybe just remove the renpy.pause if you want the bloom version to start fading out immediately. You'll probably have to fiddle with time values to get the right thing.

User avatar
yummy
Miko-Class Veteran
Posts: 733
Joined: Fri Jul 07, 2006 9:58 pm
Projects: Suna to Majo
Location: France
Contact:

#13 Post by yummy » Thu Jul 13, 2006 7:17 pm

Thank you guys, I now know how to do an overexposure scene :D
yummy wrote: I have other minor questions and after searching the forum and the tutorials, I didn't see any reference, so :

- How can I do to make a text "wait" until the sound that is linked has finished playing?
That one I figured out by playing with the renpy.pause() function.
yummy wrote: - How can I put a little "something" that blinks or animates at the end of a sentence, like these little icons which loop ?

I mean, when the string is displayed, is there a possibility to put a little image or an animation at the end of it?
Still didn't find how to do that :/

User avatar
PyTom
Ren'Py Creator
Posts: 15893
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:

#14 Post by PyTom » Thu Jul 13, 2006 7:51 pm

yummy wrote:
yummy wrote: - How can I put a little "something" that blinks or animates at the end of a sentence, like these little icons which loop ?

I mean, when the string is displayed, is there a possibility to put a little image or an animation at the end of it?
Still didn't find how to do that :/
This is in the demo. It's called click-to-continue, abbreviated ctc.
Supporting creators since 2004
(When was the last time you backed up your game?)
"Do good work." - Virgil Ivan "Gus" Grissom
"Silly and fun things are important." - Elon Musk
Software > Drama • https://www.patreon.com/renpytom

User avatar
yummy
Miko-Class Veteran
Posts: 733
Joined: Fri Jul 07, 2006 9:58 pm
Projects: Suna to Majo
Location: France
Contact:

#15 Post by yummy » Fri Jul 14, 2006 1:07 pm

Thanks everybody for your help!

Gotta get on work now :D

Post Reply

Who is online

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