What I'm trying to do is take the sum of 2 lists, then randomly choose one of the numbers from one of the lists to decrement by one, until the total of both lists is no longer above 10.
Code: Select all
#This code theoretically prevents exposure and desire from being above 10 but only by removing from exposure.
$ i = 0
while (sum(desire_list) + sum(exposure_list)) > 10:
$k = renpy.random.randint(0,9)
if exposure_list[k] > 0:
$exposure_list[k] -=1
$ i += 1
Code: Select all
$k = renpy.random.randint(0,[len(exposure_list)])