Hello!
I would like to use the player location. I want the player to take a selfie in her room. Her room is a label.
the player already opened her mobile phone in her room. The player on the room label and show screen mobile.
and I want to put a textbutton on the mobile to take a selfie but only in the bedroom.
if #player in the bedroom#:
textbutton "Take a selfie" action SetVariable("selfie", 1)
I hope it is clear.
Thank you
[SOLVED]How can I use the player location?
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.
[SOLVED]How can I use the player location?
Last edited by Mord87 on Wed Oct 02, 2019 6:36 pm, edited 1 time in total.
-
- Regular
- Posts: 58
- Joined: Tue Aug 29, 2006 10:55 am
- Contact:
Re: How can I use the player location?
I would use a variable to track player location, i.e when you call or jump to the location label, update the variable to the current location. Then you can check that variable, and only show the text button and the selfie option if it matches. Hope that made sense....
Eezergoode - AKA Rabid Penguin
Team Lead
It does not matter how slowly you go so long as you do not stop.
Confucius
Chinese philosopher & reformer (551 BC - 479 BC)
Team Lead
It does not matter how slowly you go so long as you do not stop.
Confucius
Chinese philosopher & reformer (551 BC - 479 BC)
Re: How can I use the player location?
Hi!eezergoode wrote: ↑Tue Oct 01, 2019 6:59 pm I would use a variable to track player location, i.e when you call or jump to the location label, update the variable to the current location. Then you can check that variable, and only show the text button and the selfie option if it matches. Hope that made sense....
It makes sense and I was thinking of this option. The problem with it, it is a lot of extra writing to write for each jump the label names cos in the future I want to add different locations for selfies and other things. I can make your way but I was hoping there is some code to check the actual label the player on.
Thank You for your help anyway!
-
- Miko-Class Veteran
- Posts: 793
- Joined: Fri Feb 09, 2018 12:05 am
- Location: Canada
- Contact:
Re: How can I use the player location?
that why you make notes by using the # sign so you know what they are for something like this
Code: Select all
# this for the bathroom label
label bathroom:
a "hello there"
-
- Regular
- Posts: 58
- Joined: Tue Aug 29, 2006 10:55 am
- Contact:
Re: How can I use the player location?
That is one reason my label for the location is the same as my name for the location. I set the location before actually moving to it with a simple variable, like
then return to my main game loop. In the main game loop I have
Which then calls the block for whatever location it is, since I use that same "loc_mcbr" for the label as well.
Not sure how well i explained that, since I'm just getting home after a very, very long work day.
I honestly surprised my earlier answer made any sense, I answered from my phone while on break
Code: Select all
$ location = "loc_mcbr"
Code: Select all
call expression (location)
Not sure how well i explained that, since I'm just getting home after a very, very long work day.
I honestly surprised my earlier answer made any sense, I answered from my phone while on break
Eezergoode - AKA Rabid Penguin
Team Lead
It does not matter how slowly you go so long as you do not stop.
Confucius
Chinese philosopher & reformer (551 BC - 479 BC)
Team Lead
It does not matter how slowly you go so long as you do not stop.
Confucius
Chinese philosopher & reformer (551 BC - 479 BC)
Re: How can I use the player location?
I just used what you told me earlier. It is working. Thank Youeezergoode wrote: ↑Tue Oct 01, 2019 11:41 pm That is one reason my label for the location is the same as my name for the location. I set the location before actually moving to it with a simple variable, likethen return to my main game loop. In the main game loop I haveCode: Select all
$ location = "loc_mcbr"
Which then calls the block for whatever location it is, since I use that same "loc_mcbr" for the label as well.Code: Select all
call expression (location)
Not sure how well i explained that, since I'm just getting home after a very, very long work day.
I honestly surprised my earlier answer made any sense, I answered from my phone while on break
Who is online
Users browsing this forum: Amazon [Bot], Bing [Bot], Google [Bot], Silac