Discuss how to use the Ren'Py engine to create visual novels and story-based games. New releases are announced in this section.
Forum rules
This is the right place for Ren'Py help. Please ask one question per thread, use a descriptive subject like 'NotFound error in option.rpy' , and include all the relevant information - especially any relevant code and traceback messages. Use the code tag to format scripts.
Hi guys,
i would a list of checkbox which depends of a list of items.
And for toggle each button, i have a list of true/false values matching with list of items. Look at :
You likely want to iterate the index value... zero to length of list minus one.
Then the ToggleDict action should be good.
Might want to rename your variable too (mixed case and especially CamelCase in Python imply a Class)
Ok,
i'll try but as you maybe not noticed, the list i loop isn't list_select but a list of items. list_select is a second list used to flag toggle state (is clear ?)
But maybe your answer can help me to find the soultion.
I'll be back !
Remix wrote: ↑Sun Mar 01, 2020 7:08 am
You likely want to iterate the index value... zero to length of list minus one.
Then the ToggleDict action should be good.
Might want to rename your variable too (mixed case and especially CamelCase in Python imply a Class)
vbox:
for idx in range(len(list_select)):
textbutton "Item [idx]":
action ToggleDict( list_select, idx, True, False )
Ok, I did tests and it's well but not exactly what I hope. The first sample bottom is ok but list_select is fixed. The second, I would, dynamically assign values in list_select but no reaction when I click on buttons.
Common Code
Remix wrote: ↑Sun Mar 01, 2020 5:39 pm
Because your screen rebuilds the list as all True and when you click any button the screen is redrawn, which rebuilds the list...