I'm New to Ren'Py 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.
Message
Author
Zephie-chan
Newbie
Posts: 16
Joined: Mon Jan 01, 2007 9:27 pm
Location: United States
Contact:

I'm New to Ren'Py Questions

#1 Post by Zephie-chan » Mon Jan 01, 2007 11:22 pm

Being new to Ren'Py, I have some questions regarding things not working at all, or not like I would expect. As well as general questions about how to do certain things. I hope someone can help. :)

My most immediate concern: For some reason I cannot get the splash screen to work. I got the code from the Cookbook section, so I assume it's something I did/am doing (or didn't do) rather than something else. This is how I have it set up:

Code: Select all

label splashscreen:
    scene bg white
    with Pause(0.5)

    show splash firstimage
    with dissolve
    with Pause(2.0)

    show splash secondimage
    with dissolve
    with Pause(2.0)

    scene bg white
    with dissolve
    with Pause(1.0)

    return
It's in "script.rpy" after the "init:" block, but before "label start:" block. Yet every time I launch the game, which I do from the Ren'Py Launcher, it immediately goes to the main menu rather than show the splash images that I've specified.

The second, and less immediate, concern: From the CHANGELOG.txt, I see that you can use the "config.image_buttons" and "config.image_labels" variables to change the buttons and what not of the main menu and game menu into what images I provide for it. I can't seem to find any examples of these commands in the Reference Manual, but I might just be looking in the wrong place. Can someone explain to me how they work? Is it merely "config.image_buttons("image.png")", or what?

And a general question about how Ren'Py finds labels: Say I have everything up to just the main menu in "script.rpy", but I put the bulk of my kinetic novel in "env.rpy". Do I have to specifically tell the menu's Start Game button to look in "env.rpy" for "label main_game", or will it automatically find it in there on its own?

I appreciate all the help that I can get. Thank you! :)
"The greatest error is not in making a mistake, but not allowing the one who made the mistake a chance to fix it." - corVine
"There is no reason why good can't triumph over evil, if only angels will get organized along the lines of the mafia." Kurt Vonnegut

User avatar
PyTom
Ren'Py Creator
Posts: 15426
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: I'm New to Ren'Py Questions

#2 Post by PyTom » Mon Jan 01, 2007 11:36 pm

Zephie-chan wrote:My most immediate concern: For some reason I cannot get the splash screen to work. I got the code from the Cookbook section, so I assume it's something I did/am doing (or didn't do) rather than something else. This is how I have it set up:
Bug, at least in the example. You need to have another interaction before the first transition. You can work around it by putting the line:

Code: Select all

    $ renpy.pause(0)
right after the "label splashscreen:".

Code: Select all

The second, and less immediate, concern: From the CHANGELOG.txt, I see that you can use the "config.image_buttons" and "config.image_labels" variables to change the buttons and what not of the main menu and game menu into what images I provide for it. I can't seem to find any examples of these commands in the Reference Manual, but I might just be looking in the wrong place. Can someone explain to me how they work? Is it merely "config.image_buttons("image.png")", or what?

Code: Select all

init:
    python:
        config.image_buttons["Save Game"] = (
            "but_idle.png",
            "but_hover.png",
            "but_sel_idle.png",
            "but_sel_hover.png",
            "but_disable.png")

        config.image_labels["Music Volume"] = "lab_music_volume.png"
Yes, you really do need 5 states for each button.

And a general question about how Ren'Py finds labels: Say I have everything up to just the main menu in "script.rpy", but I put the bulk of my kinetic novel in "env.rpy". Do I have to specifically tell the menu's Start Game button to look in "env.rpy" for "label main_game", or will it automatically find it in there on its own?
Yes, it will find it automatically.

Zephie-chan
Newbie
Posts: 16
Joined: Mon Jan 01, 2007 9:27 pm
Location: United States
Contact:

#3 Post by Zephie-chan » Tue Jan 02, 2007 1:36 am

Yes, thank you! That's exactly what I needed!

Having moved on a bit into the dialog and story of the game since last, I've run into another problem. It's probably rather newb-ish, and addressed somewhere in the reference manual, so forgive me, but while I have you here... :wink:

My kinetic novel is in the NVL-style and the story is told from the narrative, with character speech mixed in intermittently. Normally I wouldn't define a character variable before the text so that no character name will appear, but this doesn't seem to work for NVL-mode as its window just disappears, and then a regular dialog box pops up with the narrative text inside.

What do I have to declare before the text for it to be narrative in the NVL-mode window?

That sounds a little confusing. I hope you understand what I'm trying to get at. But then, it's 12:30 AM. Stuff doesn't seem to make as much sense right now.

Again, thanks for your help!
"The greatest error is not in making a mistake, but not allowing the one who made the mistake a chance to fix it." - corVine
"There is no reason why good can't triumph over evil, if only angels will get organized along the lines of the mafia." Kurt Vonnegut

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

#4 Post by PyTom » Tue Jan 02, 2007 1:39 am

You want to add to your game:

Code: Select all

init:
    $ narrator = NVLCharacter(None)

Zephie-chan
Newbie
Posts: 16
Joined: Mon Jan 01, 2007 9:27 pm
Location: United States
Contact:

#5 Post by Zephie-chan » Sat Jan 06, 2007 7:01 am

Thanks to the expert ministrations of PyTom, I've made excellent progress for my kinetic novel. I started wanting to put together a distribution package of my progress so far, mimicking what the official release would be like, for my friends to test on other operating systems to make sure that it works like it does under my Windows.

Unfortunately I've hit another snag:
Images can be archived using the Ren'Py launcher. Just choose "Archive Images" from the "Tools" menu, and Ren'Py will create an archive containing your images.
My "Archive Images" is grayed out. No matter what I seem to do turns it usable. I've moved my images several different places, run Lint several times, made backups, and even re-downloaded Ren'Py in case it was just a freak accident of my copy, etc.

I feel incredibly dumb as it is having to ask this question, especially considering other people of late haven't had this kind of problem. However, I have always tried to live by the philosophy that "being smart is not always knowing the answer, but knowing where to look for the answer."

Needless to say that I'm that annoying guy in the back always asking questions:

What am I missing? Do I have to assign some special value somewhere? Is my luck really THAT bad; If so, my karma level should be working at "Good Samaritan", yet it is not -- Why?

Once again, any help will be greatly appreciated. :)
"The greatest error is not in making a mistake, but not allowing the one who made the mistake a chance to fix it." - corVine
"There is no reason why good can't triumph over evil, if only angels will get organized along the lines of the mafia." Kurt Vonnegut

User avatar
EwanG
Miko-Class Veteran
Posts: 711
Joined: Thu Oct 26, 2006 5:37 pm
Location: San Antonio, TX
Contact:

#6 Post by EwanG » Sat Jan 06, 2007 7:32 am

To quote PyTom (when I had a similar question):
Hm... it shouldn't be grayed out. Do you have a launcherinfo.py file hanging around? If so, delete it.
Suspect you may have the same issue.

Zephie-chan
Newbie
Posts: 16
Joined: Mon Jan 01, 2007 9:27 pm
Location: United States
Contact:

#7 Post by Zephie-chan » Sat Jan 06, 2007 10:31 am

Thank you, EwanG! You're incredibly awesome. :D
"The greatest error is not in making a mistake, but not allowing the one who made the mistake a chance to fix it." - corVine
"There is no reason why good can't triumph over evil, if only angels will get organized along the lines of the mafia." Kurt Vonnegut

Zephie-chan
Newbie
Posts: 16
Joined: Mon Jan 01, 2007 9:27 pm
Location: United States
Contact:

#8 Post by Zephie-chan » Fri May 04, 2007 1:11 am

Okay, so I've been lazy and haven't been working on my kinetic novel very much, but lately I've gotten back into it and I have a few more questions.

Before I start though, I want to say that I'm sure most, of not all of them are answered in the code references section, but it's just so confusing to "decode" that section into what I want I figured asking would be better...

Customized menus. That's all it comes down to.

First is the main menu: All I want for the menu is Start, Continue, and Quit. I don't want the player to be able to access the Preferences section. I want basically the same for the game menu, too -- just Load, Save, Main Menu, and Exit. And on the topic of saves, I want to include only one save slot (like a bookmark); you could get through the novel in 5 to 8 minutes, maximum, so I don't see the need for 20+ saves.

There are probably shortcuts to getting these things done, and I'd be happy to know how to do it that way, but I'd also like a small explanation on creating entirely new menus and how to have the player access them for future reference. I just don't get that part. Like, so I make the new menu in a totally new .rpy file? What do I put in that file, if so?

It's just so very confusing to me, and I apologize beforehand if this question has been answered a million times before, but I did do a search for "custom menu" and couldn't come up with anything that I could decipher as what I needed.

Thanks a bunch!
"The greatest error is not in making a mistake, but not allowing the one who made the mistake a chance to fix it." - corVine
"There is no reason why good can't triumph over evil, if only angels will get organized along the lines of the mafia." Kurt Vonnegut

User avatar
chisa-chan
Regular
Posts: 197
Joined: Fri Nov 10, 2006 3:25 am
Location: at a village near Bandung, Indonesia
Contact:

#9 Post by chisa-chan » Fri May 04, 2007 1:47 am

Zephie-chan wrote:First is the main menu: All I want for the menu is Start, Continue, and Quit. I don't want the player to be able to access the Preferences section.
Try this one (I copied this from Ren'Py 6.1.1):

Code: Select all

init:
    config.main_menu = [
            ( u"Start", "start", 'True'),
            ( u"Continue", _intra_jumps("_load_screen", "main_game_transition"), 'True' ),
            ( u"End",  ui.jumps("_quit"), 'True' ),
            ]
Customize the config.main_menu and delete the preferences / configure (or whatever the name is) in your game script.
Zephie-chan wrote: I want basically the same for the game menu, too -- just Load, Save, Main Menu, and Exit. And on the topic of saves, I want to include only one save slot (like a bookmark); you could get through the novel in 5 to 8 minutes, maximum, so I don't see the need for 20+ saves.
edit the config.game_menu in your script, maybe? That is what I do.

If it is save / load, then you must modify the scratch. Hard work, I know, but try it ^^

Good luck!
Kalau tidak suka ya jangan diladeni, gitu aja kok repot™.
Cynanthia's Blog (Indonesian)

Zephie-chan
Newbie
Posts: 16
Joined: Mon Jan 01, 2007 9:27 pm
Location: United States
Contact:

#10 Post by Zephie-chan » Sat May 05, 2007 7:11 pm

Okay, so I've removed the Preferences option from the main menu! Yay~! Thanks, chisa-chan! But...
chisa-chan wrote:If it is save / load, then you must modify the scratch. Hard work, I know, but try it ^^
Modify the scratch? I'm sorry, I don't know what that means. ^_^;;

But aside from that, I'd also like to try creating a menu entirely from scratch for future projects. I've looked at the Customizing the Interface reference section, but it all seems so incredibly complicated and huge. I even tried looking at the example provided with Ren'Py (the DSE menu), but again a lot of it just goes right over my head...

Note: That's me in the post below! Sorry! I did think it was kind weird that I had to do an image confirmation, but I just wasn't thinking.
Last edited by Zephie-chan on Tue May 08, 2007 1:26 am, edited 1 time in total.
"The greatest error is not in making a mistake, but not allowing the one who made the mistake a chance to fix it." - corVine
"There is no reason why good can't triumph over evil, if only angels will get organized along the lines of the mafia." Kurt Vonnegut

Guest

#11 Post by Guest » Tue May 08, 2007 1:24 am

Okay, judging from the fact that no one's said anything else on this subject matter, I must have missed something extremely obvious... But I still don't get it.

I've tried copying the day planner from the DSE example into my game folder and telling the _game_menu_screen function to go to "day_planner" just so that I could have a base to work with in creating my own game menu, but that's not working either and I just get a traceback error...

I am so totally lost about this subject, guys. Please help!

User avatar
PyTom
Ren'Py Creator
Posts: 15426
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 » Tue May 08, 2007 10:00 am

Yeah, that wouldn't work. _game_menu_screen expects a string, the name of a label in your program. When the game menu gets invoked (in a new context), it does some housekeeping work (like taking a screenshot of the current screen), and then jumps on over to that label.

You would then want that label to do something interesting, like showing the load/save slots, or preferences, or something.
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
chisa-chan
Regular
Posts: 197
Joined: Fri Nov 10, 2006 3:25 am
Location: at a village near Bandung, Indonesia
Contact:

#13 Post by chisa-chan » Thu May 10, 2007 12:11 am

Zephie-chan wrote: Modify the scratch? I'm sorry, I don't know what that means. ^_^;;
I copied the code from common/00gamemenu.rpy (excludes those labels) and modified them a bit. Hard work.

Or should you use quicksave instead? Ren'Py cookbook has it.
Kalau tidak suka ya jangan diladeni, gitu aja kok repot™.
Cynanthia's Blog (Indonesian)

Guest

#14 Post by Guest » Sat May 19, 2007 7:46 am

I am total newbe at Ren'Py, so maybe I am missing something obvious, but could anyone help me?
I am from Russia so I would like to write my VN in Russian. While I didn't encounter any issues in showing russian text as speech/narrative and even in localizing game interface, whenever I want to use russian character in save or character name, or window title, Ren'Py shows some kind of gibberish instead.

For example, this code
init:
$ config.window_title = "Ðóññêèé"
$ povname = ""
$ pov = DynamicCharacter("povname", color=(192, 64, 64, 255))
$ a = Character("Ôûâà", color="#ff6699")

label start:
$ save_name = "Ïðèìåð"
"Window title should be \"Ðóññêèé\". Note that there is no issues on displaying Russian text here (inside \"\")"
"ß÷ñõ" "Character's name should be \"ß÷ñõ\"."
a "Character's name should be \"Ôûâà\"."
$ povname = renpy.input("Type random rus word")
$ save_name = povname
pov "Oddly enough, now character's name is all right -- %(povname)s."
will result in this screen sequence:
Image Image Image Image Image Image Image
(Last two images are savegame screen after the save in the beginning and after the input)

What I could do with it make Ren'Py show russian character and save names and window titles properly?

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

#15 Post by PyTom » Sat May 19, 2007 8:22 am

When using non-ASCII characters in Python code, you need to prefix the string with a 'u', for unicode. So you'd want to write:

Code: Select all

init:
    $ window.title = u"Русский"
Ditto for the Character's name.
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

Post Reply

Who is online

Users browsing this forum: Google [Bot]