Ren'Py Gripes
Re: Ren'Py Gripes
Hi folks
I noticed that when you build a game, the python standard library is automatically included in the base folder, but its not available when developing from the launcher. I've decided it wouldn't take any space overhead to just copy it from a temp build to every project's base folder and put in the line config.searchpath.extend(['base\\lib\\pythonlib2.7'] in the init code. Is there a way to import modules from the library thats already inside the actual renpy SDK folder itself, since it's there anyway, and will be automatically included in the build?
Thanks for all you do Tom!
I noticed that when you build a game, the python standard library is automatically included in the base folder, but its not available when developing from the launcher. I've decided it wouldn't take any space overhead to just copy it from a temp build to every project's base folder and put in the line config.searchpath.extend(['base\\lib\\pythonlib2.7'] in the init code. Is there a way to import modules from the library thats already inside the actual renpy SDK folder itself, since it's there anyway, and will be automatically included in the build?
Thanks for all you do Tom!
- 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 Gripes
Huh? You should be able to import any module that's included with Ren'Py. (We don't include the whole python library, just the modules we use, and a few more that we think are likely to be used by games.) An import statement will use the copy included with the Ren'Py SDK, even if it's not in the base folder.
Supporting creators since 2004
(When was the last time you backed up your game?)
"Do good work." - Virgil Ivan "Gus" Grissom(When was the last time you backed up your game?)
Software > Drama • https://www.patreon.com/renpytom
Re: Ren'Py Gripes
hmm.. i get an error when ive tried to use things, like the string module for instance, unless i put init python: import string. am i doing it wrong?
- 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 Gripes
No, module imports need to be in an init python block. That's because importing stuff outside those blocks leads to all sorts of problems with saving and loading.
Supporting creators since 2004
(When was the last time you backed up your game?)
"Do good work." - Virgil Ivan "Gus" Grissom(When was the last time you backed up your game?)
Software > Drama • https://www.patreon.com/renpytom
Re: Ren'Py Gripes
Would it be possible to set the number of times the timer in screen will repeat?
- Sleepy
- Regular
- Posts: 136
- Joined: Wed Nov 27, 2013 6:12 pm
- Projects: Camera Anima
- Organization: EXP-resso Mutt
- Tumblr: sleepy-does-games.tumblr.com
- itch: https://expressomutt
- Contact:
Re: Ren'Py Gripes
I did a thread about the issue (viewtopic.php?f=8&t=40385) but I thought it was worth posting about. Would it be possible to make the quick menu hide when not in dialogue mode, like in the pre-update?
I found without linking quick menu to something like the say screen, the quick menu would show outside the dialogue screens and even during transitions. It's not a game breaker or something unfixable but it's a distracting default.
I found without linking quick menu to something like the say screen, the quick menu would show outside the dialogue screens and even during transitions. It's not a game breaker or something unfixable but it's a distracting default.
Re: Ren'Py Gripes
Imagebuttons with the action Preference("display", "window") only show the selected_idle state when the window size is equal to the config variables that define the defaults. If the window is resized, the button is idle, resulting in both Windowed and Full Screen buttons rendering as unselected. I find that setting the action to a list of [Preference("display", "window"),SelectedIf(not _preferences.fullscreen)] allows a button that sets the display mode to Windowed to present as selected in any circumstance when full screen is not active.
- 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 Gripes
You can also just use Preference("display", "any window"). The default size is preferred because it's where the game is expected to be the sharpest.
Supporting creators since 2004
(When was the last time you backed up your game?)
"Do good work." - Virgil Ivan "Gus" Grissom(When was the last time you backed up your game?)
Software > Drama • https://www.patreon.com/renpytom
Re: Ren'Py Gripes
I can't delete this post and it probably belongs somewhere else so sorry about that.
- TaoistFruitbat
- Newbie
- Posts: 20
- Joined: Wed Jun 29, 2016 12:46 am
- Projects: Soulshine
- Contact:
Re: Ren'Py Gripes
I've recently had some headaches with Ren'py overwriting functions when passing keywords to labels.
For example, I have a JRPG-esque battle engine. I define a function to start a battle within Ren'py.
An instance of Conflict stores the data for the current battle, and deals with some battle logic.
The menus.jump is essentially Ren'py's call function in disguise. The conflict_start label looks like
However, once the code reaches this label conflict, instead of becoming the function in tern_functions.rpy, becomes a object of Conflict once the text "Hoi" displays. It should stay as the function.
If I call the conflict parameter 'con' instead of 'conflict' then the conflict function is not overwritten.
I've tried to mimic this in pure python but couldn't, so I figure label conflict_start(conflict): is somehow setting the conflict function equal to the conflict object I pass into the label.
It's easy enough to avoid this by renaming the conflict function or the conflict keyword in the label. It's just annoying because I must avoid passing labels names that are used as functions. I have a decent amount of functions and a decent amount of parameters to pass into labels. The code reads clearer when I do not have to abbreviate variables to avoid overwriting functions with the same name. Mostly though, I do not expect this to happen and I worry that this will cause people bugs.
(Below is the custom jump code. I doubt it has anything to do with the problem, but I'm putting it here just in case.)
For example, I have a JRPG-esque battle engine. I define a function to start a battle within Ren'py.
Code: Select all
# File: tern_functions.rpy
# This functions are used only in the renpy script.
init -19 python:
def conflict(participants):
"""
Creates a conflict and moves the player to the conflict label.
"""
Conflict(participants)
Code: Select all
# File: conflict.py
# This is imported to Renpy
class Conflict(object):
def __init__(self, actors, player_start=True):
# Some init code...
def begin_conflict(self):
"""
Begins the conflict and send us to the conflict screens.
:return: None
"""
self.step()
menus.jump('conflict_start', conflict=self)
Code: Select all
label conflict_start(conflict):
"Hoi!"
python:
menus.s_choice("The conflict starts!")
conflict.step()
player.participant.is_in_conflict = True
jump('conflict_action_phase', actor=conflict.next_actor(), conflict=conflict)
If I call the conflict parameter 'con' instead of 'conflict' then the conflict function is not overwritten.
I've tried to mimic this in pure python but couldn't, so I figure label conflict_start(conflict): is somehow setting the conflict function equal to the conflict object I pass into the label.
It's easy enough to avoid this by renaming the conflict function or the conflict keyword in the label. It's just annoying because I must avoid passing labels names that are used as functions. I have a decent amount of functions and a decent amount of parameters to pass into labels. The code reads clearer when I do not have to abbreviate variables to avoid overwriting functions with the same name. Mostly though, I do not expect this to happen and I worry that this will cause people bugs.
(Below is the custom jump code. I doubt it has anything to do with the problem, but I'm putting it here just in case.)
Code: Select all
# File: promenus.py
import renpy.exports as renpy
class ProMenus(object):
#init some stuff...
def jump(self, label, clear_stack=True, add_to_stack=True, *args, **kwargs):
"""
Jumps to the label.
:param label: String of the label we are jumping to.
:param clear_stack: Boolean. If true, clear the stack.
:param add_to_stack: If true, add the label to the stack. This is done after clearing the stack.
:param container: If not none, then go the that container's menu.
:param user: Actor that is doing something. Used with containers
:return: Label we jumped to. (Return for testing purposes.)
"""
# Update entire game state.
self.step()
# Decide if we clear the menu stack
if clear_stack:
self.stack.clear()
# Add label to stack.
if add_to_stack:
self.stack.push(label)
# Have Ren'py jump to the label. We cannot pass it empty kwargs or args,
# so we go through many cases.
if kwargs and args:
self.renpy.call(label, *args, **kwargs)
if kwargs:
self.renpy.call(label, **kwargs)
if args:
self.renpy.call(label, *args)
else:
self.renpy.call(label)
- nyaatrap
- Crawling Chaos
- Posts: 1824
- Joined: Mon Feb 13, 2012 5:37 am
- Location: Kimashi Tower, Japan
- Contact:
Re: Ren'Py Gripes
It would be good if transform also support named spaces, something likeBecause transforms are one of the most frequently used global variables but simple names, so they conflict many times.
Code: Select all
transform gui.right:
- Imperf3kt
- Lemma-Class Veteran
- Posts: 3794
- Joined: Mon Dec 14, 2015 5:05 am
- itch: Imperf3kt
- Location: Your monitor
- Contact:
Re: Ren'Py Gripes
Is there or can we get, some sort of inspector tool?
Sort of like what Google Chrome has for checking the source code of websites.
I ask because I want to be able to click on an image _in the game_, not from a file list in the developer tools, and see exactly why and how it is called, so I can work out how to get rid of it.
Sort of like what Google Chrome has for checking the source code of websites.
I ask because I want to be able to click on an image _in the game_, not from a file list in the developer tools, and see exactly why and how it is called, so I can work out how to get rid of it.
Warning: May contain trace amounts of gratuitous plot.
pro·gram·mer (noun) An organism capable of converting caffeine into code.
Current project: GGD Mentor
Twitter
pro·gram·mer (noun) An organism capable of converting caffeine into code.
Current project: GGD Mentor
Re: Ren'Py Gripes
Can someone please update the image and sound gallery to fit the new GUI, new functions and 2017 way of things? It's a pain to rewrite everything when I'm asked for.
The button system is quite outdated and having dedicated button styles will be REALLY helpful.
The button system is quite outdated and having dedicated button styles will be REALLY helpful.
If you want to debate on a reply I gave to your posts, please QUOTE ME or i'll not be notified about. << now red so probably you'll see it.
10 ? "RENPY"
20 GOTO 10
RUN
10 ? "RENPY"
20 GOTO 10
RUN
- xavimat
- Eileen-Class Veteran
- Posts: 1461
- Joined: Sat Feb 25, 2012 8:45 pm
- Completed: Yeshua, Jesus Life, Cops&Robbers
- Projects: Fear&Love
- Organization: Pilgrim Creations
- Github: xavi-mat
- itch: pilgrimcreations
- Location: Spain
- Discord: xavimat
- Contact:
Re: Ren'Py Gripes
Maybe you know those already, but there are more developer options than the developer tools menu:Imperf3kt wrote:Is there or can we get, some sort of inspector tool?
Shift + E Shows the text editor: https://www.renpy.org/doc/html/develope ... or-support
Shift + I Shows the Style inspector: https://www.renpy.org/doc/html/develope ... inspecting
Comunidad Ren'Py en español: ¡Únete a nuestro Discord!
Rhaier Kingdom A Ren'Py Multiplayer Adventure Visual Novel.
Cops&Robbers A two-player experiment | Fear&Love Why can't we say I love you?
Honest Critique (Avatar made with Chibi Maker by ~gen8)
Rhaier Kingdom A Ren'Py Multiplayer Adventure Visual Novel.
Cops&Robbers A two-player experiment | Fear&Love Why can't we say I love you?
Honest Critique (Avatar made with Chibi Maker by ~gen8)
-
- Miko-Class Veteran
- Posts: 680
- Joined: Wed Jun 05, 2013 11:02 am
- Completed: Colette and Becca
- Projects: Rainbow Love (HIATUS), The Haunting of Blackbird School, Cry of the Roses [TBA]
- Organization: Velveteen Rabbit Productions
- Deviantart: Velveteen-Rabbit-CL
- itch: caveat_lector
- Location: My chair
- Contact:
Re: Ren'Py Gripes
***EDIT: PROBLEM HAS BEEN FIXED, MUCH THANKS TO EBIHIME! JUST DELETE THE GUI.RPY FILE!!!
So, I’ve been having difficulties with programming my project “Colette and Becca”. Morhigan has been helping me out, but we’ve come across a major problem that has left us both stumped. That problem being, the textbox is flipped upside down to go at the top of the screen, instead of at the bottom (and I have tested this out on both my Windows 7 laptop AND Windows 10 desktop—exact same problem on both). However, Morhigan has NOT had this problem with the test build on her computer.
We were both stumped over this for a while, until I went in to test out another one of my projects, The Haunting of Blackbird School, a few days ago. The textbox for that ALSO got flipped to the top of the screen.
And here’s what both of these projects have in common:
I had updated both CaB AND Blackbird to be compatible with the NEW updated version of Renpy! I hadn’t encountered this problem BEFORE the update. I was working with the default old-school Renpy GUI in Blackbird, and Morhigan’s GUI in CaB. So what is the problem?
So, I’ve been having difficulties with programming my project “Colette and Becca”. Morhigan has been helping me out, but we’ve come across a major problem that has left us both stumped. That problem being, the textbox is flipped upside down to go at the top of the screen, instead of at the bottom (and I have tested this out on both my Windows 7 laptop AND Windows 10 desktop—exact same problem on both). However, Morhigan has NOT had this problem with the test build on her computer.
We were both stumped over this for a while, until I went in to test out another one of my projects, The Haunting of Blackbird School, a few days ago. The textbox for that ALSO got flipped to the top of the screen.
And here’s what both of these projects have in common:
I had updated both CaB AND Blackbird to be compatible with the NEW updated version of Renpy! I hadn’t encountered this problem BEFORE the update. I was working with the default old-school Renpy GUI in Blackbird, and Morhigan’s GUI in CaB. So what is the problem?
Who is online
Users browsing this forum: No registered users