how to make an infinite loop until the player hits the output image?

zenergyblack

Newbie
Mar 29, 2022
26
3
1659491237614.png 1659491262363.png
Basically what I want to do is that when the player hits the creampie imagebutton (codiyogaexit) it ends and I can continue the story, but in the meantime continue in an infinite loop, could it be done with an if?

I've tried a few things, but they don't work very well.
 

mickydoo

Fudged it again.
Game Developer
Jan 5, 2018
2,446
3,548
View attachment 1962317 View attachment 1962318
Basically what I want to do is that when the player hits the creampie imagebutton (codiyogaexit) it ends and I can continue the story, but in the meantime continue in an infinite loop, could it be done with an if?

I've tried a few things, but they don't work very well.
If the animation itself is looped (which it should be) using
show creampie
pause

will make in infinite loop

Replacing the pause with calling your screen will do the same thing.

show creampie
call screen menuinteractive

Or if you want (as I am unsure)

If you make a default value

default cream = False

You then can after the codiyogaextit label use
$ cream = True

Then in your screen use (This is copied from mine)
Python:
imagebutton:
        idle "icons/camera1.png"
        hover "icons/camera.png"
        xalign 0.98
        yalign 0.03
        action Jump("c_anal_2")

if cream:
        imagebutton:
            idle "icons/two_hover.png"
            hover "icons/two_idle.png"
            xalign 0.98
            yalign 0.15
            action Jump("c_anal_3")
Just be sure any if statement is in the same screen block like that.
 

anne O'nymous

I'm not grumpy, I'm just coded that way.
Modder
Donor
Respected User
Jun 10, 2017
10,398
15,312
Basically what I want to do is that when the player hits the creampie imagebutton (codiyogaexit) it ends and I can continue the story, but in the meantime continue in an infinite loop, could it be done with an if?
Well, then it's probably time to drop the Jump/show approach you're using and pass to something better:

Python:
screen menuinteractive():

    # Actual animation/movie to display - By default nothing
    default anim = None
    # How many animations/movies already displayed
    default count = 0

    # If there's an animation selected
    if anim:
        #  show it centered
        # /!\ I have a sudden doubt, but normally it works with this syntax /!\
        add "[anim]" xalign 0.5 yalign 0.5

    # Unless it's the creampie animation, show those buttons
    if not anim = "codivoreyogaexit":
        imagebutton:
            idle "blowjob.jpg"
            xpos 0.95
            ypos 0.05
            #  Select the corresponding animation/movie
            # and count one more animation/movie shown
            action [ SetScreenVariable( "anim", "codivoreyogablowjob" ), SetScreenVariable( "count", count + 1 ) ]
        imagebutton:
            idle "titjob.jpg"
            xpos 0.95
            ypos 0.15
            #  Select the corresponding animation/movie
            # and count one more animation/movie shown
            action [ SetScreenVariable( "anim", "codivoreyogatitjob" ), SetScreenVariable( "count", count + 1 ) ]

        #  If at least 2 animations have been shown, now the player
        # can possibly end this part.
        if count >= 2:
            imagebutton:
                idle "creampie.jpg"
                xpos 0.95
                ypos 0.20
                #  Select the corresponding animation/movie
                action SetScreenVariable( "anim", "codivoreyogaexit" )

    imagebutton:
        idle "exit.jpg"
        xpos 0.95
        ypos 0.05
        #  Return to the game flow
        action Return()

label whatever:
    call screen menuinteractive
    girl "It was... wow, never had sex like that before."
 
  • Like
Reactions: Musou_Tensei