Arrays

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.
Post Reply
Message
Author
monele
Lemma-Class Veteran
Posts: 4101
Joined: Sat Oct 08, 2005 7:57 am
Location: France
Contact:

Arrays

#1 Post by monele »

A search for "array" doesn't return anything so I'm asking in a new topic :

Can we create arrays in Ren'Py ? Or maybe lists ? Stacks ?

Let's say I define a bunch of numbers or strings standing for quests and I'd like to "put them in a bag" standing for "quests to do". *thinks*... I guess I would also need to display this list somehow at some point too...

EDIT : Argh! I hate finding an answer right after posting the question XD...

Code: Select all

$ var = [2, 4, 8]
$ num = var[0]
"num : %(num)d" # will display "2"
It seems I can't use

Code: Select all

"num : %(var[0])d"
directly though. I know it wants an integer but... nya~ :3

Post Reply

Who is online

Users browsing this forum: Bing [Bot], Ocelot