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.
GoldenD
Regular
Posts: 43 Joined: Thu Jan 16, 2020 2:01 am
Contact:
#1
Post
by GoldenD » Mon Jan 20, 2020 2:02 pm
is it possible to have a list i call by a personnal string index and that would look like this :
Code: Select all
define listEvents = [
["Event1", False],
["Event2", False],
["Event3", False],
.../...
]
I would like use this list giving the string ("Event1" for example) as index, and read or append its boolean value.
Clear ?
Last edited by
GoldenD on Mon Jan 20, 2020 2:19 pm, edited 1 time in total.
gas
Miko-Class Veteran
Posts: 842 Joined: Mon Jan 26, 2009 7:21 pm
Contact:
#2
Post
by gas » Mon Jan 20, 2020 2:06 pm
EDIT (my bad).
That's exactly what dictionaries are made for.
Code: Select all
default mylist = {"Event1": False, "Event2": False}
and use default, not define, you want to apply some change.
If you want to debate on a reply I gave to your posts, please QUOTE ME or i'll not be notified about. << now red so probably you'll see it.
10 ? "RENPY"
20 GOTO 10
RUN
GoldenD
Regular
Posts: 43 Joined: Thu Jan 16, 2020 2:01 am
Contact:
#3
Post
by GoldenD » Mon Jan 20, 2020 2:19 pm
Hi,
and sorry.
Apparently I didn’t read the dictionaries correctly.
Thanks
Users browsing this forum: Google [Bot] , Lucyper , Majestic-12 [Bot]