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.
I'm not sure if the question makes sense but basically this is the code I'm working on.
I'm trying to get it so that after picking a random burger (in this case the "beefburger") from a list, it then has it list out the fillings of the beefburger ("beefpatty"). I want it so that whatever burger it randomly picks out, it'll be able to fill in the gaps of Burger.[random burger choice].fillings
Oh. I didn't notice that possible_burgers do not contain actual objects. You will need either to place actual objects here or go an extra step of extracting object information from class: $ fillings_str = ', '.join(getattr(Burger, pick_burger).fillings)
Ocelot wrote: ↑Wed Apr 14, 2021 5:17 am
Oh. I didn't notice that possible_burgers do not contain actual objects. You will need either to place actual objects here or go an extra step of extracting object information from class: $ fillings_str = ', '.join(getattr(Burger, pick_burger).fillings)
Ocelot wrote: ↑Wed Apr 14, 2021 5:17 am
Oh. I didn't notice that possible_burgers do not contain actual objects. You will need either to place actual objects here or go an extra step of extracting object information from class: $ fillings_str = ', '.join(getattr(Burger, pick_burger).fillings)
Okay, so I've come across a new problem with this: When I ask for a fillings list for a burger with multiple fillings, it combines them and counts it as one item eg.
[u'chicken, tomato, lettuce'] when I actually want each element to be it's own item in the list.
filling_str is a string intended for displaying as a string, comma-separated and all. You can just skip conversion to string, if you need a list for something else: $ fillings = getattr(Burger, pick_burger).fillings
Ocelot wrote: ↑Wed Apr 14, 2021 6:31 am filling_str is a string intended for displaying as a string, comma-separated and all. You can just skip conversion to string, if you need a list for something else: $ fillings = getattr(Burger, pick_burger).fillings
Got it, thanks! That was the last piece to my puzzle