Looking for some renpy help - beyond the basics

bdaywans

Newbie
Apr 15, 2017
35
22
New to building games so if there are tutorial threads for what I'm looking for I just don't know where to look...

I've decided to try to build a few games I have been considering for a bit and the first is a combo of VN and minigames. I've seen a few renpy games that have minigames and while I want them to eventually get better I figure I'll start simple for conceptual purposes and found a script for a card match game. Basic concept I have in mind is player can play a best 2 out of 3 match game once per day, and different variables like purchased items and stats can effect time remaining. So I am trying to figure out how to plug the variables into the game and have the games results effect the variables. Can anyone advise me where to start, or point me towards tutorials? Or is something that complex better to just try to learn Unity for?

Also, how do you 'map' out your renpy stories? I was actually using twine since its pretty visual but as far as I can tell once I finish it I've got to rewrite everything back in renpy and I'm fine doing that but it feels redundant.
 

Epadder

Programmer
Game Developer
Oct 25, 2016
568
1,064
Ren'Py's Official Forum has the Which contains pieces of code you can use to solve certain problems, some of it may be out of date if you dig too far inside though and some of it may not be very well explained :confused:.

I'm not sure exactly how the card game is structured, but if it's written in python this is how I understand it to work...
If you want to read variables you can just call them by name, but if you want to change variables you need to prefix them with 'store'.

So for the example below you have a variable called itemcount_Tickets that represents Tickets that give you more time to match, you only use one Ticket per attempt.

The Default time is 60 and a ticket adds 15 (the values will have to be adjusted to how the actual card game counts time, this is supposed to be time in seconds).

The main function calls the sub-function to set the time allowed for matching.

Python:
    def example_GameMainFunction():
        tempvar_TimeToMatch = example_GameSubFunction()
        ### rest of the code

    def example_GameSubFunction():
        tempvar_AmountOfTime = 60
        if itemcount_Tickets > 0:
            tempvar_AmountOfTime += 15
            store.itemcount_Tickets -= 1
        return tempvar_AmountOfTime
You can always run this kind of test for multiple things and without consuming them if they are permanent buffs, if for say you had an intelligence stat and once it reached a certain threshold or thresholds, you could give bonus time to match.

As a side note on my variable naming scheme, they are long which a lot of programmers tend to avoid... but I like using the longer more descriptive names so that they act like self documentation without having to write lots of comments.

As for mapping the story, I don't really know a better way than using a separate program(or pen and paper) so that you can visualize the structure of the game.

To help though you can try and keep any variable names and passage titles how you would want them to be in your game. Then when it comes time to actually push it into Ren'py you can export twine to twee source and using a text editor and just replace all the twine specific commands with Ren'py equivalents. :D
 
  • Like
Reactions: bdaywans

anne O'nymous

I'm not grumpy, I'm just coded that way.
Modder
Donor
Respected User
Jun 10, 2017
10,964
16,209
I've seen a few renpy games that have minigames
Note that if they are few it's not because it's difficult to do mini-games with Ren'py, but because players tend to dislike mini-games.


Or is something that complex better to just try to learn Unity for?
It's definitively possible to do this with Ren'py. But how to do it depend totally of what you effectively want to do.


Ren'Py's Official Forum has the
Be cautious with the cookbook, it's officially outdated since many years now ; I mean, there's more than one code that don't even use the second version of the Screen Language. It should be used as a guide explaining the process, not the code itself. Once you've understood the said process, you should search in Ren'py documentation (on your hard drive, in the same directory than the SDK) how you can do it now.
 

bdaywans

Newbie
Apr 15, 2017
35
22
Ren'Py's Official Forum has the Which contains pieces of code you can use to solve certain problems, some of it may be out of date if you dig too far inside though and some of it may not be very well explained :confused:.

I'm not sure exactly how the card game is structured, but if it's written in python this is how I understand it to work...
If you want to read variables you can just call them by name, but if you want to change variables you need to prefix them with 'store'.

So for the example below you have a variable called itemcount_Tickets that represents Tickets that give you more time to match, you only use one Ticket per attempt... :D
Thanks, I honestly am not that far into coding yet but I do get what that means. I'll probably just have to break it a few times to figure it out.

Note that if they are few it's not because it's difficult to do mini-games with Ren'py, but because players tend to dislike mini-games.
Hm, well that could be a project killer. The basic idea is that you're in a competition. You play against a competitor (which is really just beat the mini game in time) and if you win you get money and stats. If you lose you... well, that's why its a porn game (but not in a rape-y way, also female protag). Think games like HuniePop where the vn relationships evolve and are separate from the minigames but you advance your story and scenes through them.

The alternate I proposed in an older thread when brainstorming this was there is no 'game' but when you challenge your competitor the outcome is just determined by your stats, you don't actually play, you just see cutscenes then end with the result.

Not to go into lengthy detail there, but those are the two methods - play the mini game or let it be on autopilot - I was considering.
 

anne O'nymous

I'm not grumpy, I'm just coded that way.
Modder
Donor
Respected User
Jun 10, 2017
10,964
16,209
Hm, well that could be a project killer. The basic idea is that you're in a competition.
If the whole game revolve around the inside games, perhaps that it will be perceived differently, I can't say for sure. What people tend to dislike is more useless mini-games, those that add absolutely nothing to the game and can easily be replaced by a directly earned reward without changing anything to the game itself.
But as you describe it, the base of the game play, so, who know ? It will mostly depend of the global interest of the game and the mini-games.
 

Palanto

Active Member
Game Developer
Oct 4, 2017
964
1,841
As all the others said, but if you want to get help with implementing some variables into something else, you'd first need to show us a little bit of code to understand the whole process so we can at least point you in the right direction of "where" you'd have to start ;)

I mean adding variables to a minigame is simple, but "where" to put them and where to ask for the values or write to the variable is another story ;) Without a little code to show us how your minigame is setup and what you want to achieve with it it's nearly impossible to give you more hints then showing you the way to the documentation or the lemmasoft.renai.us forum
 

bdaywans

Newbie
Apr 15, 2017
35
22
As all the others said, but if you want to get help with implementing some variables into something else, you'd first need to show us a little bit of code to understand the whole process so we can at least point you in the right direction of "where" you'd have to start ;)

I mean adding variables to a minigame is simple, but "where" to put them and where to ask for the values or write to the variable is another story ;) Without a little code to show us how your minigame is setup and what you want to achieve with it it's nearly impossible to give you more hints then showing you the way to the documentation or the lemmasoft.renai.us forum
Thanks, I'm laying out my intro in twine now and going to convert to renpy. Making some illustrations for characters (I wanted to go 2d and not 3d but we'll see how far my skills can take that) and once I get to the first I'll post it here
 
  • Like
Reactions: Palanto