making a theme function

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
ShiraiJunichi
Miko-Class Veteran
Posts: 651
Joined: Sat May 21, 2005 12:28 pm
Location: University of Utah
Contact:

making a theme function

#1 Post by ShiraiJunichi »

I would like to make a theme function. I believe I read that ren'py doesn't support user defined functions (more than one line long)... So I thought maybe a subroutine would work. But putting a call statement inside of an init block seems to always give me errors.

Also, in creating my own theme, it seems like I'm setting a lot of styles to have the same values. If I wanted to set all labels, buttons, prompts, etc. to have the same styles (perhaps with minor changes afterward), is there a way to do that which is easier than setting them all individually?

luminarious
Veteran
Posts: 353
Joined: Thu May 01, 2008 1:12 pm
Projects: Winter, winter
Location: Estonia
Contact:

Re: making a theme function

#2 Post by luminarious »

Styles are based on inheritance, right? So defining them for the parent should enable them for several children. Also, there was a function for changing a style's parent, I believe.

User avatar
PyTom
Ren'Py Creator
Posts: 16088
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: making a theme function

#3 Post by PyTom »

Themes are usually python function, but for a single game you can use an init python block. There are a relatively small number of styles a theme has to define, and they are listed at:

http://www.renpy.org/wiki/renpy/doc/ref ... stom_Theme
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

ShiraiJunichi
Miko-Class Veteran
Posts: 651
Joined: Sat May 21, 2005 12:28 pm
Location: University of Utah
Contact:

Re: making a theme function

#4 Post by ShiraiJunichi »

Yes, I've seen that list and I think it's incomplete. It says nothing about style.say_label, style.say_dialogue, style.say_window, or style.menu_choice. I assume there are a few that I'm missing. Information about these styles is scattered around the documentation, which made finding it difficult.

As for just using an init block, I didn't want to worry about init block priority... It's not a big deal though. I would like to clarify one thing though- are call statements inside init blocks illegal?

Post Reply

Who is online

Users browsing this forum: Google [Bot]