Ren'Py Callisto - Strip Club Coding Assistance

Xavster

Well-Known Member
Game Developer
Mar 27, 2018
1,249
7,625
The strip club development is coming along nicely, with assignment of dancers to various stages and the transparent animations already completed. To polish off this content, I need a little assistance in creating a tipping system, to have the dancer advance to the next more lewd routine. There are current 5 dancers, each of which be assigned to any of three stages.
Python:
label club_pole2:
    scene expression "strip" + str(club_croud) + "_cam2"
    show expression pole2_dancer + "01"
    call screen pole_interface
Note that the show expression calls up transparent animations that are defined by the following:
Python:
image chiara01 = Movie(play="sc_chiara01.webm", side_mask=True, loops=-1)
image chiara02 = Movie(play="sc_chiara02.webm", side_mask=True, loops=-1)
image felicity01 = Movie(play="sc_felicity01.webm", side_mask=True, loops=-1)
image felicity02 = Movie(play="sc_felicity02.webm", side_mask=True, loops=-1)
image jool01 = Movie(play="sc_jool01.webm", side_mask=True, loops=-1)
image jool02 = Movie(play="sc_jool02.webm", side_mask=True, loops=-1)
image paige01 = Movie(play="sc_paige01.webm", side_mask=True, loops=-1)
image paige02 = Movie(play="sc_paige02.webm", side_mask=True, loops=-1)
image vera01 = Movie(play="sc_vera01.webm", side_mask=True, loops=-1)
image vera02 = Movie(play="sc_vera02.webm", side_mask=True, loops=-1)
The current pole_interface screen looks like the following.
Python:
screen pole_exit:
    grid 1 1:
        style "cbut"
        xpos 0.95
        ypos 0.9
        imagebutton auto "b_back_%s.webp" action [Hide("pole_exit"),Jump("club")]
What I need to do is to increment the screen above to include another button that keeps track of tips made to each dancer. Hence when the button is pressed it would do the following:
1) deduct credits from your balance
2) increment a temporary tipping variable to have the animation switch to the 02 variant.
3) track the total amount of tips given to the performing dancer (going to be used to trigger quests for your favourite dancers)
What I want to do, is drag the dancer name into the screen (eg call screen pole_interface(pole2_dancer)) and then have that variable choose the correct variable to increment (eg tip_total_chiara) via the SetVariable action. I just can't work out the syntax.
You don't have permission to view the spoiler content. Log in or register now.
 
  • Like
Reactions: Saint Blackmoor

anne O'nymous

I'm not grumpy, I'm just coded that way.
Modder
Donor
Respected User
Jun 10, 2017
10,979
16,236
1) deduct credits from your balance
Code:
action SetVariable( "credit", credit - 10 )

2) increment a temporary tipping variable to have the animation switch to the 02 variant.
Code:
action [ SetVariable( "credit", credit - 10 ), 
             SetVariable( "tmpTipping", tmpTipping + 1 ) ]

3) track the total amount of tips given to the performing dancer (going to be used to trigger quests for your favourite dancers)
Code:
action [ SetVariable( "credit", credit - 10 ), 
             SetVariable( "tmpTipping", tmpTipping + 1 ),
             SetVariable( "totalTips{}".format( girlName ), getattr( store,  "totalTips{}".format( girlName ) ) + 1 )  ]

This being the "big lines", now, reported to the practical problem :


Python:
default chiaraTotalTip = 0
default felicityTotalTip = 0
[...]

label club_pole2:
    $ pole2_variant = 1
    scene expression "strip" + str(club_croud) + "_cam2"
    # Format the number with two digit, filled by "0".
    show expression pole2_dancer + "{:02d}".format( pole2_variant )
    call screen pole_interface

screen pole_interface():
   [...]
   textbutton "tip":
        action [ SetVariable( "credit", credit - 10 ), 
                 # Do not go further than the available animation.
                 If( pole2_variant  < 2, SetVariable( "pole2_variant", pole2_variant  + 1 ), NullAction() )
                 SetVariable( "{}totalTip".format( pole2_dancer ), getattr( store,  "{}totalTip".format( pole2_dancer ) ) + 1 )  ]
 
  • Like
Reactions: BartPS