Good day, everyone.
I have a small problem that I would like to ask for help on.
I am a big fan of tabletop roleplaying, and one f my favourite adventures contains a magical forest where the players end up in a random place after having walked for a day. I'm looking to simulate this in a game I'm making, but I'm not sure how t do it.
I've made separate labels for each "location" the player can reach while wandering in the forest, but I don't fully understand how to make the game randomize which label the player ends up going to. Any help would be appreciated. Thank you for your time.
Random Label Problem
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.
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.
Re: Random Label Problem
*goes to read up on it, like a good wannabe-game-developer*
[Edit] Ok, that was fairly easy. Now, when the player enters a location for the first time, I intend the game to give a detailed explanation of the location to the player, but if they reach the same place twice, they won't need that detailed explanation.
A beautiful field of golden flowers surround a large tree where faeries dance amog the leaves could simply become I'm back at the golden field, and the faeries are still dancing or something.
Are there any good places to read up on that? I've done for research on true/false statements, but I'm kinda stupid, so I don't really understand them
[Edit] Ok, that was fairly easy. Now, when the player enters a location for the first time, I intend the game to give a detailed explanation of the location to the player, but if they reach the same place twice, they won't need that detailed explanation.
A beautiful field of golden flowers surround a large tree where faeries dance amog the leaves could simply become I'm back at the golden field, and the faeries are still dancing or something.
Are there any good places to read up on that? I've done for research on true/false statements, but I'm kinda stupid, so I don't really understand them
Re: Random Label Problem
Well, untill you find another solution...
Code: Select all
init:
$ location_one_seen = False # sets the variable value
$ location_two_seen = False
# etc.
label location_one:
if not location_one_seen: # checks the value
$ location_one_seen = True # changes the value
"Detailed explanation"
"And even more"
"Ordinary stuff"
http://en.wikipedia.org/wiki/Boolean_data_typeAre there any good places to read up on that? I've done for research on true/false statements, but I'm kinda stupid, so I don't really understand them
Re: Random Label Problem
^You'll want an 'else' in there, I think.
Otherwise, you'll get something like:
Code: Select all
init:
$ location_one_seen = False # sets the variable value
$ location_two_seen = False
# etc.
label location_one:
if not location_one_seen: # checks the value
$ location_one_seen = True # changes the value
"Detailed explanation"
"And even more"
else
"Ordinary stuff"
This is a beautiful field full of golden flowers and dancing fairies. I'm back at the golden field, and the fairies are still dancing.
Re: Random Label Problem
Ok, I've gotten this part down as well. Thank you for the help.
Who is online
Users browsing this forum: Ahrefs [Bot]