Any way to have Renpy give the player a random question from a list, and then remove that question from the list?
Posted: Mon Jul 26, 2021 12:05 pm
Edit: Really sorry, after a few hours playing with this I have managed to get it working! If any mods see this the thread can be deleted.
I’ll try my best to explain - English is not my first language so apologies if some of this comes out wrong or confusing.
So, in my game I have a character who poses the player with ethical questions at regular intervals. Rather than me choosing which questions are asked and in what order, I’d like to have a list or a pool of questions and have Renpy pick one from that pool at random to ask the player. The player can then make a choice on their answer using Renpy’s usual menu system. And then that question is removed from the pool for the rest of the game, so it doesn’t get asked again.
It is a bit more complicated than just having a normal list for Renpy to pick from at random, because I need to set each question out as a menu and then include a variable change as the consequence of each answer.
Is there any way to do this? Maybe I would need to set up labels before each question and have Renpy jump to a label at random? Also, although I have managed to get a random selection from a list working, I’m not sure how to remove list items that have been picked already.
Thank you so much for reading - any ideas or advice are greatly appreciated.
I’ll try my best to explain - English is not my first language so apologies if some of this comes out wrong or confusing.
So, in my game I have a character who poses the player with ethical questions at regular intervals. Rather than me choosing which questions are asked and in what order, I’d like to have a list or a pool of questions and have Renpy pick one from that pool at random to ask the player. The player can then make a choice on their answer using Renpy’s usual menu system. And then that question is removed from the pool for the rest of the game, so it doesn’t get asked again.
It is a bit more complicated than just having a normal list for Renpy to pick from at random, because I need to set each question out as a menu and then include a variable change as the consequence of each answer.
Is there any way to do this? Maybe I would need to set up labels before each question and have Renpy jump to a label at random? Also, although I have managed to get a random selection from a list working, I’m not sure how to remove list items that have been picked already.
Thank you so much for reading - any ideas or advice are greatly appreciated.