Don't code at 1am folks.
Can't seem to find how to delete a topic so leavng it here so people can witness my dumbassery.
__________________________________________________________________________________
Hello everyone !
I have a little card game that triggers a renpy.random.sample variable. After that, I call a screen and the results of the variable appear as imagebuttons. Like this :
Don't mind the grey-ish imagebutton, it's another thing.
My problem is, sometimes my imagebuttons appear and sometimes not :
Here's my code :
Code: Select all
default card_list = ["sandwitches_card", "lee_card", "typhon_card", "ruben_card"]
...
$ card_for_choices = renpy.random.choice(card_list)
call screen choix_carte_x_1 with fastdissolve
...
screen choix_carte_x_1:
if card_choices_1_pick == True or card_choices_2_picks == True: ### This one works fine.
imagebutton:
focus_mask True
xpos 750
ypos 50
idle "cardgame/card_for_choice_2.png"
action NullAction()
if card_choices_1_pick == True: ### and this one too.
imagebutton:
focus_mask True
xpos 475
ypos 50
idle "cardgame/card_for_choice.png"
action [ SetVariable("picked_random", True), Jump("jeu")]
if 'garland_card' in card_for_choices:
imagebutton:
focus_mask True
if 'garland_card' in card_for_choices[0]:
xpos 475
else:
xpos 200
ypos 50
idle "cardgame/ib_choice_garland.png"
action Jump("carte_choix_garland")
if 'ruben_card' in card_for_choices:
imagebutton:
focus_mask True
if 'ruben_card' in card_for_choices[0]:
xpos 475
else:
xpos 200
ypos 50
idle "cardgame/ib_choice_ruben.png"
action Jump("carte_choix_ruben")
if 'lee_card' in card_for_choices:
imagebutton:
focus_mask True
if 'lee_card' in card_for_choices[0]:
xpos 475
else:
xpos 200
ypos 50
idle "cardgame/ib_choice_lee.png"
action Jump("carte_choix_lee")
From what I understand, the 2 picks of my renpy.random.sample are stored as card_for_choices[0] and card_for_choices[1], so I don't understand why sometimes one appear and the other not. And it's completely random. Sometimes it's the left one, sometimes it's the right one.
Begging for your help. Brain is a mess.