Ren'Py Gripes

In this forum we discuss the future of Ren'Py, both bug fixes and longer-term development. Pre-releases are announced and discussed here.
Message
Author
User avatar
Shakezula
Regular
Posts: 67
Joined: Wed May 20, 2015 8:01 pm
Organization: Digital Sandbox
Contact:

Re: Ren'Py Gripes

#421 Post by Shakezula » Fri Sep 09, 2016 3:59 pm

Hi folks :D

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! :mrgreen:

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

#422 Post by PyTom » Fri Sep 09, 2016 6:18 pm

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
"Silly and fun things are important." - Elon Musk
Software > Drama • https://www.patreon.com/renpytom

User avatar
Shakezula
Regular
Posts: 67
Joined: Wed May 20, 2015 8:01 pm
Organization: Digital Sandbox
Contact:

Re: Ren'Py Gripes

#423 Post by Shakezula » Fri Sep 09, 2016 9:17 pm

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?

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

#424 Post by PyTom » Fri Sep 09, 2016 10:11 pm

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
"Silly and fun things are important." - Elon Musk
Software > Drama • https://www.patreon.com/renpytom

User avatar
Alex
Lemma-Class Veteran
Posts: 2473
Joined: Fri Dec 11, 2009 5:25 pm
Contact:

Re: Ren'Py Gripes

#425 Post by Alex » Mon Sep 19, 2016 11:26 am

Would it be possible to set the number of times the timer in screen will repeat?

User avatar
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

#426 Post by Sleepy » Tue Sep 20, 2016 12:40 am

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.
W.I.P.

Image

Complete

Image Image

AXYPB
Regular
Posts: 95
Joined: Thu Sep 04, 2014 3:04 am
Github: AXYPB
Contact:

Re: Ren'Py Gripes

#427 Post by AXYPB » Wed Oct 05, 2016 5:41 pm

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.

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

#428 Post by PyTom » Wed Oct 05, 2016 9:48 pm

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
"Silly and fun things are important." - Elon Musk
Software > Drama • https://www.patreon.com/renpytom

godot
Newbie
Posts: 7
Joined: Fri May 20, 2016 4:45 pm
Contact:

Re: Ren'Py Gripes

#429 Post by godot » Mon Dec 19, 2016 7:38 pm

I can't delete this post and it probably belongs somewhere else so sorry about that.

User avatar
TaoistFruitbat
Newbie
Posts: 20
Joined: Wed Jun 29, 2016 12:46 am
Projects: Soulshine
Contact:

Re: Ren'Py Gripes

#430 Post by TaoistFruitbat » Fri Dec 23, 2016 11:23 pm

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.

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)
An instance of Conflict stores the data for the current battle, and deals with some battle logic.

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)
The menus.jump is essentially Ren'py's call function in disguise. The conflict_start label looks like

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)
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.)

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)

User avatar
nyaatrap
Crawling Chaos
Posts: 1824
Joined: Mon Feb 13, 2012 5:37 am
Location: Kimashi Tower, Japan
Contact:

Re: Ren'Py Gripes

#431 Post by nyaatrap » Tue Dec 27, 2016 11:16 am

It would be good if transform also support named spaces, something like

Code: Select all

 transform gui.right:
Because transforms are one of the most frequently used global variables but simple names, so they conflict many times.

User avatar
Imperf3kt
Lemma-Class Veteran
Posts: 2942
Joined: Mon Dec 14, 2015 5:05 am
Location: Your monitor
Contact:

Re: Ren'Py Gripes

#432 Post by Imperf3kt » Sat Dec 31, 2016 4:21 am

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.
Image

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.

Twitter
Imperf3kt Blackjack - a WIP blackjack game for Android made using Ren'Py
Free Android GUI - Updated occasionally

User avatar
gas
Miko-Class Veteran
Posts: 717
Joined: Mon Jan 26, 2009 7:21 pm
Contact:

Re: Ren'Py Gripes

#433 Post by gas » Wed Jan 04, 2017 8:01 pm

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.
If you want to debate on a reply I gave to your posts, please QUOTE ME or i'll be not notified about.

10 ? "RENPY"
20 GOTO 10

RUN

User avatar
xavimat
Eileen-Class Veteran
Posts: 1445
Joined: Sat Feb 25, 2012 8:45 pm
Completed: Yeshua, Jesus Life, Cops&Robbers
Projects: Fear&Love, unknown
Organization: Pilgrim Creations
Github: xavi-mat
itch: pilgrimcreations
Location: Spain
Contact:

Re: Ren'Py Gripes

#434 Post by xavimat » Thu Jan 05, 2017 6:22 pm

Imperf3kt wrote:Is there or can we get, some sort of inspector tool?
Maybe you know those already, but there are more developer options than the developer tools menu:
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)

Caveat Lector
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

#435 Post by Caveat Lector » Sun Jan 08, 2017 5:16 pm

***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?
Reader Beware!


The Haunting of Blackbird School: In Progress

Colette and Becca: Complete

Post Reply

Who is online

Users browsing this forum: No registered users