Page 1 of 1

The neverending game loop...

Posted: Thu Jul 25, 2019 10:29 am
by bdaywans
Hopefully this is pretty basic but I'm not sure what I did to break this.
SO per some previous posts I've made I've got a minigame as part of my story that can be called once a day. Simple enough... and I lifted it from the Memoria minigame that I found online which I've since then learned is VERY out of date. But its working for my purposes so I'm using it for now.

The premise is that in when you play the game you will go against an npc. For each npc ('challenger' tag) option I'm writing 1-3 interaction scenarios. Each scenario ('match' tag) would consist of an intro conversation between the two characters a 'cutscene' between each round based on if you win or lose (along with a special optional scene (BONUS) if you win your first two rounds in a row, and then a win/loss dialogue based on your win/loss count.

This was working before - originally I hard coded the win/loss dialogue in the win/los fame options for testing purposes, only seems to have broken once I started using calls) and still works through the 'BONUS' call but where the game is supposed to end at 3 wins or end regardless at 5 rounds it just keeps going. It jumps to cutscene 1 2 and special just fine and even changes the images accordingly (winImg) but I can't tell what I'm doing wrong to force it to stop and 3 wins OR 5 rounds:

Code: Select all

label memo_game_win:
    hide screen memo_scr
    $ renpy.pause (0.1, hard = True)
    $ renpy.pause (0.1, hard = True)
    "You win!"
    $ gameSet += 1
    $ win += 1
    if win == 1:
        call expression challenger + "_" + match + "_win_1"
    elif win == 2:
        call expression challenger + "_" + match + "_win_2"
    else:
        jump memoria_game
    $ winImg += 1
    if winImg >= 5:
        $ winImg == 4
    if gameSet == 2:
        if win == 2:
            call expression challenger + "_" + match + "_bonus"
            jump memoria_game
    if gameSet <= 4:
        if win == 3:
            call expression challenger + "_" + match + "_won"
        elif win <= 2:
            jump memoria_game
    elif gameSet == 5:
        if win == 3:
            call expression challenger + "_" + match + "_won"
        elif loss <= 2:
            call expression challenger + "_" + match + "_lost"
NOTE: When the BONUS is called it also calls an options menu. I was thinking having the call in the call was the problem but when I removed the call entirely it still went on and on...