Ren'Py Ren'py Minigame help

bdaywans

Newbie
Apr 15, 2017
35
22
So I'm still new to Ren'py but I'm trying to make the first version of my first game idea and while I don't want to get overzealous in what I'm trying to do if I can't figure this part out it kind of defeats the purpose. So I'm looking to the community for some help. I can't find what I'm looking for online BUT that may be because I don't know what to call what I'm looking for so if this exists or there are terms for it just let me know. So here it goes.

I've posted before about wanting to make minigames part of the the overall game I'm making and while I don't want these to annoy the user they're part of the overall plot:
Win minigames, get rewarded, advance plot.
Lose minigames, get punished, advance plot.

Problem1:
I followed the renpy tutorial about bringing in a minigame (pong) and having an conclusion for win/lose but when trying it out I can't seem to get it to apply and modify existing stats. When the game starts, it subtracts $X from total, but then will modify time, speed, difficulty based on specific stats. I try calling them but no luck.

Problem2:
Kind of in the same vein but once I finish the game how do I then modify the stats based on the results. I assumed that I could just place the modifiers in the win/lose options but not working so far. Maybe that's because I'm not doing problem1 correctly but thought I'd ask.

Problem3:
This should be fairly easy I assume but how do I 'call' a minigame. I know how to switch scenes but can I do the same thing? Right now it's just in line with the story but i want the user to be able to go back and play it whenever they want (up to 2 times a day). When I look it up I just get HOW to add a minigame... like copy/paste/modify some code

Problem 4:
This is probably me getting too ambitious right out the gate but I want to now if its possible before I go way too deep in something that wont work. I want each game to be a best out of 3 but with each win/loss I wnt there to be an image change. The premise being that the player and competition will both be shown left and right of the game and the results will cause the images to change. I've see things like this is Unity, and maybe if this game had any success thats whre it goes next, but in the short term is it better to just show a whole image rathr than try to swap things in mid-game?
 

anne O'nymous

I'm not grumpy, I'm just coded that way.
Modder
Donor
Respected User
Jun 10, 2017
10,302
15,171
Problem1:
I followed the renpy tutorial about bringing in a minigame (pong) and having an conclusion for win/lose but when trying it out I can't seem to get it to apply and modify existing stats. When the game starts, it subtracts $X from total, but then will modify time, speed, difficulty based on specific stats. I try calling them but no luck.
What you call "stats" here ? The original mini-game have no modifiers. You need to change the code of the displayable to include those modifiers, then change their value depending of whatever you want.


Problem2:
Kind of in the same vein but once I finish the game how do I then modify the stats based on the results. I assumed that I could just place the modifiers in the win/lose options but not working so far.
I assume that here you used "stats" to talk about the variables are directly related to your own game. So, simply modify the variables like you normally do, but in the part corresponding to the result of the game :
Code:
    [...]
    call screen pong
    if _return == "whatever the value for MC winning":
        $ theStat += theGain
    else:
        $ theStat -= theLoose
    [...]

Problem3:
This should be fairly easy I assume but how do I 'call' a minigame.
Like you do for any label. The tutorial shown it :
Code:
    menu:
        e "Would you like to play again?"
        "Sure.":
            jump play_pong
        "No thanks.":
            pass

Problem 4:
I want each game to be a best out of 3 but with each win/loss
Code:
default pongSet = 0
default pongMCWin = 0

label pong:
    $ pongSet = 0
    $ pongMCWin = 0

    [...]

    label .set
        [...]
        call screen pong

        $ pongSet += 1
        if _return == "whatever the value for MC winning":
            $ pongMCWin += 1

    if pongSet < 3
        jump .set
    if $pongMCWin >= 2
        $ theStat += theGain
    else:
        $ theStat -= theLoose
    [...]

I wnt there to be an image change. The premise being that the player and competition will both be shown left and right of the game and the results will cause the images to change.
Just change the screen for this. Make the image displayed depend of the number of set won by the player and the number of set won by the opponent.
 
  • Like
Reactions: bdaywans