Character Tracing/Tracking
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.
-
- Newbie
- Posts: 18
- Joined: Tue Mar 14, 2017 3:50 pm
- Tumblr: brixujel
- Deviantart: brixujel
- Contact:
Character Tracing/Tracking
I would like to get an idea of how I would go about making a character location system that tells which where any of the characters in the given building are at along with moving them to a different room if needed. I'm having a hard time trying to think of what angle I should look at this from or where I should start. I know for a fact that I want to eventually make this more than 5 locations
~Your imagination is your only Limitation~
- DannyGMaster
- Regular
- Posts: 113
- Joined: Fri Sep 02, 2016 11:07 am
- Contact:
Re: Character Tracing/Tracking
Interesting... For starters, you could make a building class containing all of the rooms, each room being a list where you add people's names (or instances) as they come and go. Then you would make a screen to display the status of
each room.
Roughly it could be something like this:
This is very primitive but hopefully it will give you an idea.
each room.
Roughly it could be something like this:
Code: Select all
init python:
class Building:
def __init__(self):
self.lobby = []
self.bath = []
self.my_room = []
self.eileen_room = []
#This would be the screen, I know it's crude and lacks styling but it's just to demonstrate
screen building_status(building):
frame:
vbox:
text "Lobby: [building.lobby]"
text "Bath: [building.bath]"
# Here we define the new building instance
default hotel = Building()
label start:
show screen building_status(hotel)
"Lily enters the lobby."
$ hotel.lobby.append('Lily')
"Bob enters the lobby."
$ hotel.lobby.append('Bob')
"[hotel.lobby[0]] and [hotel.lobby[1]] are in the Lobby."
$ hotel.lobby.pop(1)
"Bob leaves the lobby."
The silent voice within one's heart whispers the most profound wisdom.
Who is online
Users browsing this forum: Majestic-12 [Bot]