Search found 23 matches

by GoldenD
Sat Mar 07, 2020 3:00 pm
Forum: Ren'Py Questions and Announcements
Topic: [SOLVED]Assigning Variables "variable name" ?
Replies: 1
Views: 181

Re: Assigning Variables "variable name" ?

Ok, the solution :
$ currentStory = getattr(store, "dlgStory_{:03d}".format(counter))
by GoldenD
Sat Mar 07, 2020 2:19 pm
Forum: Ren'Py Questions and Announcements
Topic: [SOLVED]Say statement in Menu
Replies: 5
Views: 293

Re: Say statement in Menu

Ok guys, these are the tracks I was studying. I think I have no choice to re-think my code. Just for curiosity: what you dialogue function did? In fact there is a little lie with my function. I always and only call 1 function for all game scenes just passing a list of dialogs (each dialog is a comp...
by GoldenD
Sat Mar 07, 2020 2:02 pm
Forum: Ren'Py Questions and Announcements
Topic: [SOLVED]Assigning Variables "variable name" ?
Replies: 1
Views: 181

[SOLVED]Assigning Variables "variable name" ?

Hõla todos, have a global list variable. During process, I have to assign some lists variables to this global variable. The only thing which change in those variables is the suffix. Sample better than words. default currentList = [] default list_001 = [(elt1, elt2,...)] default list_002 = [(elt1, el...
by GoldenD
Sat Mar 07, 2020 4:00 am
Forum: Ren'Py Questions and Announcements
Topic: [SOLVED]Say statement in Menu
Replies: 5
Views: 293

Re: Say statement in Menu

Ok guys,
these are the tracks I was studying. I think I have no choice to re-think my code.
by GoldenD
Fri Mar 06, 2020 3:40 pm
Forum: Ren'Py Questions and Announcements
Topic: [SOLVED]Say statement in Menu
Replies: 5
Views: 293

[SOLVED]Say statement in Menu

Hi, we know we can or may have a say statement in menu block. So for some reasons, I have a function that supports management of say statement, and till now, it's the only way I use to display say statement. So, the question is : can I replace the say statement in Menu block by a call to my function...
by GoldenD
Fri Mar 06, 2020 5:59 am
Forum: Ren'Py Questions and Announcements
Topic: [SOLVED]Conditional ToggleDict ?
Replies: 2
Views: 225

Re: Conditional ToggleDict ?

Ok, now I'll try to explain all my questions about Toggle... and actions I join 3 screenshots to understand the use of ToggleField and multiple "checkbox" (using textbutton) Have a screen to choose 5 spells in a list of 10. The list is on the left of the 1st screen (textbuttons) and you can have a d...
by GoldenD
Wed Mar 04, 2020 10:21 am
Forum: Ren'Py Questions and Announcements
Topic: [SOLVED]Conditional ToggleDict ?
Replies: 2
Views: 225

Re: Conditional ToggleDict ?

Ok, I think I found a solution. Sure it's not the best but I have no more ideas. In fact, I invert my conditions before Toggle switch True/False values. def updateCounter(idToSelect): #Invert before toggle if store.counterSelected != MAX_SELECT: # Here I do what i want to do for the next True value ...
by GoldenD
Wed Mar 04, 2020 9:50 am
Forum: Ren'Py Questions and Announcements
Topic: [SOLVED]Conditional ToggleDict ?
Replies: 2
Views: 225

[SOLVED]Conditional ToggleDict ?

Ok, it follows a first thread about ToggleDict. The first was simple but now, the reality is I have some conditions or some controls before using ToggleDict correctly. I tried to use action instead of Toggle, but when I do it, I have no more the effects of textbutton style. Ok, the following code wo...
by GoldenD
Wed Mar 04, 2020 5:11 am
Forum: Ren'Py Questions and Announcements
Topic: [SOLVED]ToggleDict in a loop
Replies: 5
Views: 277

Re: ToggleDict in a loop

Ok guys, cleaning code and reading your notice, all is fine for this part. Bottom, the code "cleaning" and working. # default _var = None init python: class Item: def __init__(self, id, name=""): self.id = id self.name = name def updateCounter(): store.counterSelected = 0 for eltSelect in store.list...
by GoldenD
Tue Mar 03, 2020 1:45 am
Forum: Ren'Py Questions and Announcements
Topic: [SOLVED]ToggleDict in a loop
Replies: 5
Views: 277

Re: ToggleDict in a loop

The logic of action is quite simple, but you have many variables named '_var', that might confuse the program. Also, you need to track if two lists have the same length... And screens are refreshed from time to time - that makes code run again and again. So, this might be easyer to operate single l...
by GoldenD
Mon Mar 02, 2020 3:19 pm
Forum: Ren'Py Questions and Announcements
Topic: [SOLVED]ToggleDict in a loop
Replies: 5
Views: 277

Re: ToggleDict in a loop

If you have a list of 'spells' and those spells are objects, why won't you try to add another property to spell object (like 'selected') and toggle its value upon clicking? Thanks for your reply. I could do that but what's the change ? I don't understand the operating logic of action Toggle... if i...
by GoldenD
Mon Mar 02, 2020 11:50 am
Forum: Ren'Py Questions and Announcements
Topic: [SOLVED]ToggleDict in a loop
Replies: 5
Views: 277

[SOLVED]ToggleDict in a loop

Code first, explain following default _var = None default _counter = 0 default list_select = dict() label start: python: for _var in listOfSpells: store.list_select[_var.id] = False call screen setupHero(listOfSpells, maxItems=5) screen setupHero(listOf, maxItems=1): modal True zorder 200 add "gui/o...
by GoldenD
Mon Mar 02, 2020 12:56 am
Forum: Ren'Py Questions and Announcements
Topic: [SOLVED]List of CheckBox And ToggleVariable
Replies: 5
Views: 276

Re: List of CheckBox And ToggleVariable

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...
Great Thanks Remix,
I can fix that.
by GoldenD
Sun Mar 01, 2020 11:38 am
Forum: Ren'Py Questions and Announcements
Topic: [SOLVED]List of CheckBox And ToggleVariable
Replies: 5
Views: 276

Re: List of CheckBox And ToggleVariable

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 T...
by GoldenD
Sun Mar 01, 2020 8:17 am
Forum: Ren'Py Questions and Announcements
Topic: [SOLVED]List of CheckBox And ToggleVariable
Replies: 5
Views: 276

Re: List of CheckBox And ToggleVariable

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 !