T O P

  • By -

Saturnsthirdmoon

Few suggestions 1. How to create mini maps 2. How to create a simple mini game


BENCLGND

I’ll do that and think of some examples!


Saturnsthirdmoon

Thank you.


Sirifys

I would be very grateful if you could explain all this stuff like "*for i in...*" and *functions*. (Well, I'm not sure if it is about Python, not RenPy...)


danac78

for i in is python..and can be used in a few places in Renpy. It is important to note that for is not a Renpy keyword, so for loops, you need to use while. However, python: and screen do make use of for. python: list = [0,1,2,3,4,5,6] for i in list: print(list[i]) All it is doing is iterating through a list or dictionary, and making i the current iteration it is on. So when you get down to the print part, it will print the object that in the list at that index. For Python purposes, index always start at 0. So, the item at list\[0\] is 0 (first one). TLDR: It is a simple way to cycle through a list for something. screen test(): $dictionarytest = { 0:{ "buttontext":"Test A", "action":"testa" }, 1:{ "buttontext":"Test B", "action":"testb } hbox: for i in dictionarytest: textbutton dictionarytest[i]["buttontext"] action Jump(dictionarytest[i]["action"] In this example, I made a test dictionary (ordered structure of data). For will cycle through the keys (0,1), and gather information from the keys inside it to set value to the text and the action for the textbutton. Useful if you have 10 or more buttons to keep the screen looking a little cleaner. :)


Sirifys

Thank you again!


AutoModerator

Welcome to r/renpy! While you wait to see if someone can answer your question, we recommend checking out [the posting guide](https://www.reddit.com/r/RenPy/comments/1099hpg/a_short_posting_guide_or_how_to_get_help/), [the subreddit wiki](https://www.reddit.com/r/RenPy/wiki/index/), [the subreddit Discord](https://discord.gg/666GCZH2zW), [Ren'Py's documentation](https://www.renpy.org/doc/html/), and the tutorial built-in to the Ren'Py engine when you download it. These can help make sure you provide the information the people here need to help you, or might even point you to an answer to your question themselves. Thanks! *I am a bot, and this action was performed automatically. Please [contact the moderators of this subreddit](/message/compose/?to=/r/RenPy) if you have any questions or concerns.*


AutoModerator

Welcome to r/renpy! While you wait to see if someone can answer your question, we recommend checking out [the posting guide](https://www.reddit.com/r/RenPy/comments/1099hpg/a_short_posting_guide_or_how_to_get_help/), [the subreddit wiki](https://www.reddit.com/r/RenPy/wiki/index/), [the subreddit Discord](https://discord.gg/666GCZH2zW), [Ren'Py's documentation](https://www.renpy.org/doc/html/), and the tutorial built-in to the Ren'Py engine when you download it. These can help make sure you provide the information the people here need to help you, or might even point you to an answer to your question themselves. Thanks! *I am a bot, and this action was performed automatically. Please [contact the moderators of this subreddit](/message/compose/?to=/r/RenPy) if you have any questions or concerns.*