Hello all,
I have the following that shows the player where they are when they enter a location:
$location.append("hall")
To do this, first I have to remove the previous location from displaying. Is there a way to say
$location.remove("x")
Where x denotes ANY value? For example, if you moved into the hall from the dining room or living room, "remove" would remove EITHER the dining room or living room from displaying.
wildcard question
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.
- Aleema
- Lemma-Class Veteran
- Posts: 2677
- Joined: Fri May 23, 2008 2:11 pm
- Organization: happyB
- Tumblr: happybackwards
- Contact:
Re: wildcard question
That's the actual code. Just doesn't take variables, I believe. $location.remove("hall")
What's your problem? Choosing whether to toggle off the dining room or the living room? That seems a logic problem for you, rather than a magic code for Python. When exiting a room, then you should remove it from the location, rather than try to retrospectively find out where you left from the next location.
Is there a reason you're not just doing: $location = "hall" ? Does the location variable really contain multiple values (are you in more than one place at once)?
What's your problem? Choosing whether to toggle off the dining room or the living room? That seems a logic problem for you, rather than a magic code for Python. When exiting a room, then you should remove it from the location, rather than try to retrospectively find out where you left from the next location.
Is there a reason you're not just doing: $location = "hall" ? Does the location variable really contain multiple values (are you in more than one place at once)?
Re: wildcard question
I solved it. I just have to clear the variable with $location=[] and then append the new location. I realize this isn't how a list is supposed to be used, but I didn't want to have to create a new actual variable for every room. Not that this method saves that much space probably, but...
Anyway thanks Aleema.
Anyway thanks Aleema.
Who is online
Users browsing this forum: Google [Bot], Sugar_and_rice