Ren'py feedback from a new user and some questions...

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
Adorya
Miko-Class Veteran
Posts: 541
Joined: Fri Aug 18, 2006 4:51 pm
Contact:

Ren'py feedback from a new user and some questions...

#1 Post by Adorya »

First, I would say thank you for making an "easy to create" VN engine, it only took me a few hours to make a basic multimedia novel chapter from a text only script, and I am thrilled to think about the features it offer.

Second, I have some question about Ren'py features and "how far you can push it" :

- I noticed that if you play a music in the "credit page" like that :

Code: Select all

    python hide:

        renpy.music_start('music.ogg', 0)
        renpy.transition(slowdissolve)

        text = '"Credit etc..."\n\n\n'
And if you select the back to main menu option, the music still play, even after puting a renpy.music_stop() anywhere after the python hide line.
Is it also possible to make a "rolling staff & credit" without having to use a moving image or bg (moving text)?

- If you play in windowed mode then minimize Ren'py, if you try to close the window with right click > close it won't because the game will be waiting for the quit confirmation ingame. Is it possible to close it without restoring the window back? I know that on commercial VN the confirmation can pop in front of the desktop even if the game window is minimized, is it possible to do it in Ren'py?

- I read the thread about zoom, pan and bouncing image, but is there a possibilities to make a combination of all in them to make a fast move camera effect? For exemple, starting a zoom-in in one corner of a bg, then zoom-out while doing a curve with a defined angle and then another zoom-in to the opposite corner without pause. I know that in the zoom thread it was said that zooming a moving image would be a fps killer, so I wondered if it was possible to "move the zoom"...

I don't know if what I say is understandable, but I can show you a perfect exemple of what I am looking for : this moviewas taken from Fate/Hollow Ataraxia (sorry quite big with 60 Mo, rapidshare and VLC viewable only) and has some Nscripter bg move/zoom feature that I would like to use (at reading time 4:33, when Saber pass through Archer's arrow).

Edit: my bad, I found out that it was a sound called before python hide that was still running but still can't stop it though

Code: Select all

    $ renpy.play('1.wav')
    $ renpy.pause (0.5)
    $ renpy.sound.queue('2.wav')
    python hide: 
The 2.wav is the culprit :D (last 2 min)

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

#2 Post by monele »

About the video : oh god! :D... That's the kind of things I wanna see Ren'Py do.... but yea, haha, I love dynamic scenes like this ^^;...
For now, all I can say is that the zoom seems to work... It *seems* that it has been somewhat optimized which means it might not be as slow as before... but maybe it's just my new computer helping with this ^^;. Basically, zoom, as it is, is still quite slow and if you do such extreme zooms as in the video, you'll suffer from pixelly pictures... or at least from jagged lines (when zooming out with a hires picture). The fact the picture will have to be much bigger than the screen won't help with speed ^^;.

When it comes to movement + zoom, I don't think it's implemented yet but my late researches on smooth movements show that it's perfectly possible. So now it's all about speed.

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: Ren'py feedback from a new user and some questions...

#3 Post by PyTom »

Adorya wrote:First, I would say thank you for making an "easy to create" VN engine, it only took me a few hours to make a basic multimedia novel chapter from a text only script, and I am thrilled to think about the features it offer.
Welcome! I hope you enjoy using Ren'Py.

Second, I have some question about Ren'py features and "how far you can push it" :
- I noticed that if you play a music in the "credit page" like that :
...

Is this resolved? In general, you should not use renpy.play or renpy.sound.* to play background music. If you use renpy.music.play to play background music, it will stop when you go back to the main menu.
Is it also possible to make a "rolling staff & credit" without having to use a moving image or bg (moving text)?
Yes, you can write:

Code: Select all

init:
    image credits = Text("Written by Adorya\n \n \nMade with Ren'Py")

show credits at Move(....)
And you can move the text around.

- If you play in windowed mode then minimize Ren'py, if you try to close the window with right click > close it won't because the game will be waiting for the quit confirmation ingame. Is it possible to close it without restoring the window back? I know that on commercial VN the confirmation can pop in front of the desktop even if the game window is minimized, is it possible to do it in Ren'py?
No, this isn't possible in Ren'Py. However, if you pick close twice in a row, Ren'Py will get the message and terminate. Hopefully, this is good enough.

- I read the thread about zoom, pan and bouncing image, but is there a possibilities to make a combination of all in them to make a fast move camera effect? For exemple, starting a zoom-in in one corner of a bg, then zoom-out while doing a curve with a defined angle and then another zoom-in to the opposite corner without pause. I know that in the zoom thread it was said that zooming a moving image would be a fps killer, so I wondered if it was possible to "move the zoom"...
Yes, you can "move the zoom" like this without major penalty. (Modulo the fact that zooms are still fairly slow.)
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

Adorya
Miko-Class Veteran
Posts: 541
Joined: Fri Aug 18, 2006 4:51 pm
Contact:

#4 Post by Adorya »

Thank you, I hope to make good work and have fun with it :)

Theorically Ren'py should be able to match the video (in fact Nscripter engine) because it has all the feature (zoom, pan, move, slide, fade etc...) so I think it is possible to make a fast camera zoom effect...in fact I was able to reproduce one using this code :

Code: Select all

    scene bg1 at Zoom((800, 600), (0, 0, 800, 600), (0, 50, 400, 300), 0.5)
    $ renpy.pause (1.0)
    scene bg1 at Zoom((800, 600), (0, 50, 400, 300), (0, 0, 800, 600), 0.5)
    $ renpy.play('swift_sound.wav')
    scene white with None
    scene bg2 with slowdissolve
The zoom is not "fast" but the swift sound and the transition to bg2 with blink white effect make it work, tricking the user senses...kinda ;)

Now the video is all pimpy because it chain a lot of moves at once with an entertaining music/sound (yes, there is sound in it, you need to raise the volume quite a bit), but as I would like to reproduce an "action scene", that is a good way to learn.

About the sound problem, I wasn't be able to clear it at restart, unfortunately. Here is the bit of code of the script, if that help :

Code: Select all

   (...)$ renpy.play('1.wav')
    $ renpy.pause (0.5)
    $ renpy.sound.queue('2.wav')
    scene white with None
    scene bg1 with slowdissolve
    
    python hide:

        renpy.music_start('3.mp3', 0)
        renpy.transition(slowdissolve)(...)
The 1st wav is a short sound, while the 2nd is an ambiant one (sound of the wind on a cliff) and last for ~2 min. Then credit roll and a bgm start. After clicking on return to main, the bgm stop but the 2nd wav is still running if the user click before it last (within the 2min).
I know I should cut the 2nd wav but as I am going to use it for long text transition, I dont want to create more files that would only used once. On a side note, I know about the mp3 problem but I can replace it with any others formats and still get the "feature"...so the music start/stop is not the problem (rather a sound start/stop issue).

About the close minimized case, well clicking twice won't be a problem, so it is ok for me, thank you for the tip.

I noticed also that if you run by default on a window 800x600 with a 1024x768 desktop, the window seems to run on 1st time out of the desktop (for me everytime I reboot my computer it appear half on bottom of the screen). The position seems saved after several runs but is it possible to make it run in a fixed position (center of screen for exemple?).

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

#5 Post by monele »

I noticed also that if you run by default on a window 800x600 with a 1024x768 desktop, the window seems to run on 1st time out of the desktop (for me everytime I reboot my computer it appear half on bottom of the screen). The position seems saved after several runs but is it possible to make it run in a fixed position (center of screen for exemple?).
Ha ! So I'm not the only one :). I asked this a while ago but was told there was nothing ensuring the position or something.... except in earlier versions, the window was *always* centered, which was neat.


As for the looping sound, here's what I was told to do :

Code: Select all

init:
    python:
        renpy.sound.set_mixer(6, "sfx")
        renpy.sound.set_mixer(5, "sfx")
This assigns channel 5 and 6 to sound effects (meaning their volume will be based on "sound volume" and not "music volume", mostly). Then to play an ambiant sound :

Code: Select all

    $ renpy.music.play("someloop.ogg", channel=6)
If you want to stop it yourself :

Code: Select all

    $ renpy.music.stop(channel=6)
And for kicks, here are other examples of what you can do :

Code: Select all

$ renpy.music.play("someloop.ogg", channel=6, fadein=3)
$ renpy.music.stop(channel=6, fadeout=5)
# and if you don't like typing "channel", "fadein" and "fadeout" :
$ renpy.music.play("someloop.ogg, 6, 3)
$ renpy.music.stop(6, 5)

Adorya
Miko-Class Veteran
Posts: 541
Joined: Fri Aug 18, 2006 4:51 pm
Contact:

#6 Post by Adorya »

The mixer trick work but the small problem is that I want my sound to last until I click to return menu. Currently it stay even if I click the menu, and if I insert the line before the credit call my effect is broken.
I tried to insert the channel music stop in the python credit block but I got a compiling error (invalid syntax).

Also small another issue the possibility to toggle the UI and enjoy the background / image. It is usually a function binded to a keyboard key which is enabled/disabled on stroke.
Currently the assigned key is "h" but I find a bit weird to use another key to toggle back the UI (usually you have to release the key or press twice the same key to toggle).

Edit : guess I found a workaround for my sound problem, I had to put both sound and music in the same channel and fadeout the sound in a defined time with queued music. Still, if I don't have a queued sound the problem will still stay.

Adorya
Miko-Class Veteran
Posts: 541
Joined: Fri Aug 18, 2006 4:51 pm
Contact:

#7 Post by Adorya »

Reviving my question thread for the credit staff roll snippet because I can't make it to work properly :(
image credits = Text("Credits")
...is called in mygeneric call image init block and...
show credits at Move((x, y), (x, y), t.0)
is put in a python hide block where I previously had my static staff credit.

Unfortunately I get a syntax error at the show credit line.
If I put the show credit line outside the python hide block, I get NameError: name 'text' is not defined error.

Also I don't know how to add several credit text line moving together, do you have to use :
text += 'Crédits\n'
If yes where and how?

Thanks in advance, it is really frustrating to block now as I am nearly finishing my 2nd chapter project :)

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:

#8 Post by PyTom »

Please copy in the actual lines from your script. You appear to have elided some things, as what you wrote is obviously a syntax error.
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

Adorya
Miko-Class Veteran
Posts: 541
Joined: Fri Aug 18, 2006 4:51 pm
Contact:

#9 Post by Adorya »

Code: Select all

init:
image img1 = "img1.png"
image img2 = "img2.png"

image credits = Text("Ellipse chapitre I & II")

label start :

(start of script)
...
(end of script)

    python hide:
        renpy.transition(dissolve)        
        show credits at Move((0, 0), (0, 40), 2.0)
Putting show credits before python hide give test non defined, putting after give syntax error.

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:

#10 Post by PyTom »

I'd write your code like this:

Code: Select all

init:
    image img1 = "img1.png"
    image img2 = "img2.png"

    image credits = Text("Ellipse chapitre I & II")

label start :

(start of script)
    ...
(end of script)

    show credits at Move((0, 0), (0, 40), 2.0)
    with dissolve
You definitely can't put a "show" statement inside a python block. I'm not sure what the problem with "test" is, since the name "test" isn't found in this script at all.
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

Adorya
Miko-Class Veteran
Posts: 541
Joined: Fri Aug 18, 2006 4:51 pm
Contact:

#11 Post by Adorya »

Sorry, the message error was :

Code: Select all

NameError: name 'text' is not defined
As the original static credit block was under a python hide block, I assumed it could be possible to just switch with a rolling credit...guess I was wrong.

Anyway I should be able to release the demo tonight so you will be able to dig into the code if you want to :)

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:

#12 Post by PyTom »

If you could sent me the full traceback.txt, I can be 100% sure this isn't a bug in Ren'Py. That would be useful, since I'm aiming to release 5.6.2 Real Soon Now.
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

Adorya
Miko-Class Veteran
Posts: 541
Joined: Fri Aug 18, 2006 4:51 pm
Contact:

#13 Post by Adorya »

It's not a ren'py bug, because I just tested one time and was able to make it work, but now I get the same error while trying to add several lines IIIOrz=

Code: Select all

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

NameError: name 'text' is not defined

While executing game script on line 574 of game/script.rpy.
While executing python code on line 586 of game/script.rpy.

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

  File "E:\VN\renpy\renpy\bootstrap.py", line 124, in bootstrap
  File "E:\VN\renpy\renpy\main.py", line 266, in main
  File "E:\VN\renpy\renpy\main.py", line 94, in run
  File "E:\VN\renpy\renpy\execution.py", line 100, in run
  File "E:\VN\renpy\renpy\ast.py", line 379, in execute
  File "E:\VN\renpy\renpy\python.py", line 803, in py_exec_bytecode
  File "game/script.rpy", line 586, in <module>
NameError: name 'text' is not defined

While executing game script on line 574 of game/script.rpy.
While executing python code on line 586 of game/script.rpy.

Ren'Py Version: Ren'Py 5.6.1

shaja
Regular
Posts: 73
Joined: Sun Oct 16, 2005 8:34 am
Contact:

#14 Post by shaja »

Ren'Py defines 'text' as the default ParameterizedTextobject.

If you are using 'text' as a variable in your code to hold your actual credits text string, you are losing the ParameterizedText reference, which might possibly be a problem.

Post Reply

Who is online

Users browsing this forum: No registered users