Three questions on Renpy usage from a beginner.

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
Kam101
Newbie
Posts: 2
Joined: Mon Oct 03, 2016 9:48 am
Contact:

Three questions on Renpy usage from a beginner.

#1 Post by Kam101 » Mon Oct 03, 2016 1:39 pm

Hello, I just joined the forum.
First of all, I'd like to apologize for the title, since it doesn't follow guideline:
When asking questions about Ren'Py, please chose a descriptive subject. Recently, we've been getting a number of topics with titles like:
A couple of Ren'Py questions...
I do have a series of questions after starting Renpy a couple of days ago. I joined the forum and checked out many threads, especially the ones in here: viewtopic.php?f=51&t=34131
The first thing I want to mention is that a big amount of the links in that thread are using outdated code solutions for specific problems. This means that using the code provided in many of those links are of simply no use for the 2016 Renpy software. Which means a big amount of those threads are nearly useless for nowadays beginners, like myself. Now I'll get to the questions I have. I'll number them to make it easier:

1) How to adjust the vertical postions of in-game Menus? If I go to the The Question project example in it's Options.rpy, I find the following statement:

Code: Select all

## If this is True, in-game menus are placed in the center
## the screen. If False, they are placed inside a window
## at the bottom of the screen.
button_menu = True,
On the Options file of my project, there's no such line neither on it or in the gui.rpy. I see in my gui file:

Code: Select all

## Choice Buttons ##############################################################
##
## Choice buttons are used in the in-game menus.
In that entire section there wasn't shown the option to set the y position of which in-game Menus should appear.
In the gui file, I also found:

Code: Select all

define gui.choice_spacing = 22
and

Code: Select all

gui.choice_button_width = 1240
but again, nothing that makes us know how to change the vertical positions. The documentation(https://www.renpy.org/doc/html/gui.html#choice-menus) didn't help at all, either.

2) Talking about the documentation, in this spot (https://www.renpy.org/doc/html/gui.html ... tomization) it mentions:
Many of these changes involve editing variables in gui.rpy. For example, to increase the dialogue font size, find the line that reads:

Code: Select all

define gui.font_size = 22
I went to the gui.rpy file of my project, and didn't find any "gui.font_size" at all. That setting doesn't exist there. You'd think that a place that mentions "editing variables", those variables would already be present in the spot ready to be modified. I think what was really meant was:

Code: Select all

gui.text_size
since I can clearly find that setting in my gui file. Correct me if I'm wrong, please.

3) Is there any intuitive way (or any way at all) to create my own buttons in the Main Menu screen? I see we can reposition and style them, but can we add our own, or even delete existing ones? I'm having a look at this: https://www.renpy.org/doc/html/gui.html ... navigation
Is that it? If so, how exactly do I implement that? Would appreciate if someone helped me.


As a suggestion, I'd recommend there being (way) more Example Scripts (https://www.renpy.org/doc/html/index.ht ... le-scripts), especially having their options and gui files in the same style the Renpy software provides to their user. Non outdated examples that actually show modified GUI Customization on various degrees to help people that are starting using Renpy. I might have more questions in the future, but for now, I'll keep those three.

That's all, thanks in advance for the help.

User avatar
Ocelot
Eileen-Class Veteran
Posts: 1883
Joined: Tue Aug 23, 2016 10:35 am
Github: MiiNiPaa
Discord: MiiNiPaa#4384
Contact:

Re: Three questions on Renpy usage from a beginner.

#2 Post by Ocelot » Mon Oct 03, 2016 2:14 pm

You are probably interested in navigation screen in screens.rpy

It is where all buttons and logic for their display is defined. This screen is used both for main_menu screen and game_menu: one you get if you right-click when playing.

You can add, delete and change buttons here.

Here you can also find line

Code: Select all

yalign 0.5
which places vbox with buttons centered vertically and

Code: Select all

xpos gui.navigation_xpos
which sets horisontal coordinate to one set in corresponding variable.
< < insert Rick Cook quote here > >

User avatar
papiersam
Veteran
Posts: 231
Joined: Fri Aug 12, 2016 2:24 pm
Completed: Gem Hunt Beta, 1/Probably, Animunch
Projects: The Panda Who Dreamed
Contact:

Re: Three questions on Renpy usage from a beginner.

#3 Post by papiersam » Mon Oct 03, 2016 2:16 pm

This means that using the code provided in many of those links are of simply no use for the 2016 Renpy software. Which means a big amount of those threads are nearly useless for nowadays beginners, like myself.
Well, "2016 Renpy" (or 6.99.11) has only been out for, like, a month, and it pretty much depends on nowaday beginners like yourself to ask questions for, y'know, the questions to be answered, so I wouldn't worry too much.

That being said, I think many people just stick to the older GUI of Renpy: more control, more documentation, more familiar.
1) How to adjust the vertical postions of in-game Menus?
Check out the "screen choice(items)" in the screens.rpy. where it says

Code: Select all

style choice_vbox:
    xalign 0.5
    ypos 270
    yanchor 0.5

    spacing gui.choice_spacing
Just change the ypos to change the vertical position.
I went to the gui.rpy file of my project, and didn't find any "gui.font_size" at all.
I believe you simply have to add "define gui.font_size = 22" somewhere in the gui.rpy if it's not auto-generated (kinda like with config.developer).
Is there any intuitive way (or any way at all) to create my own buttons in the Main Menu screen?
Non outdated examples that actually show modified GUI Customization on various degrees to help people that are starting using Renpy
You've gotta understand that the code isn't outdated, it just isn't specially customised and applied to the new GUI interface in the given examples. For example,

Code: Select all

            button:
                text "Something something" outlines [(1, "#000", 1, 1)]
                align 0.5, 0.5
                background "#f009" #or an image
                hover_background Animation("#fff", 0.25, "#404", 0.5)
                xysize 200, 75
                action Start()
Just drop that in the main_menu screen and play around with it; it's the kind of code I use in Renpy from way back in, like, 2014, and still works now.

I think the TL;DR here is that the coding hasn't changed, but the interface has just a bit. It takes a bit of trial and error, but the "old forums" are just as applicable as new ones.

All things considered, I would recommend sticking to the Legacy Interface, but you're more than welcome to ask questions here about the new GUI (that's what the forum is for, and I'm sure newbies would appreciate it).

Anyways, hope this helps.

Kam101
Newbie
Posts: 2
Joined: Mon Oct 03, 2016 9:48 am
Contact:

Re: Three questions on Renpy usage from a beginner.

#4 Post by Kam101 » Mon Oct 03, 2016 5:41 pm

You are probably interested in navigation screen in screens.rpy

You can add, delete and change buttons here.
(code)
Just drop that in the main_menu screen and play around with it; it's the kind of code I use in Renpy from way back in, like, 2014, and still works now.
Check out the "screen choice(items)" in the screens.rpy. where it says
(code)
Just change the ypos to change the vertical position.
I see. This helped me with my first and third questions and solved them. When I put "define gui.font_size = 22" into my gui file and messed up with that number, I didn't see any difference in-game, both on dialogue or right click menu. I only managed to see a difference when I modified the "define gui.text_size" value. So what is gui.font_size used for?

Also, I'd like to ask a another question:

4) Is there a way to preload a video used in the game, so it doesn't lag in the first moment when it is shown? I have a video added into my screen using the following code:

Code: Select all

image vid = Movie(channel="any", play="filename.m2t")

label start:
    #(stuff)
    show vid
And whenever it's ready to be played, there's a short 1-2 second lag before the game continues smoothly. It'd be great if the video could be loaded beforehand, so things like these wouldn't happen.

Again, thanks in advance.

User avatar
papiersam
Veteran
Posts: 231
Joined: Fri Aug 12, 2016 2:24 pm
Completed: Gem Hunt Beta, 1/Probably, Animunch
Projects: The Panda Who Dreamed
Contact:

Re: Three questions on Renpy usage from a beginner.

#5 Post by papiersam » Tue Oct 04, 2016 10:12 am

So what is gui.font_size used for?
Wouldn't know, haven't tried. Might require you to use a new font first, or it might be documented improperly.
4) Is there a way to preload a video used in the game, so it doesn't lag in the first moment when it is shown?
I know you can preload images, and since you defined your movie as an image displayable, you could try to use renpy.start_predict/renpy.stop_predict. I don't guarantee it'll work, though.

One thing to note, hardware plays a heavy hand in these sort of things; some machines will run videos fine, some won't.

User avatar
Donmai
Eileen-Class Veteran
Posts: 1919
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: Three questions on Renpy usage from a beginner.

#6 Post by Donmai » Tue Oct 04, 2016 1:12 pm

r_sami wrote:One thing to note, hardware plays a heavy hand in these sort of things; some machines will run videos fine, some won't.
True. And some movie formats play better than others. It seems webm is still a good option.
Image
No, sorry! You must be mistaking me for someone else.
TOIRE NO HANAKO (A Story About Fear)

Post Reply

Who is online

Users browsing this forum: Bing [Bot]