Character Tracing/Tracking

Discuss how to use the Ren'Py engine to create visual novels and story-based games. New releases are announced in this section.
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.
Post Reply
Message
Author
Dreamulex
Newbie
Posts: 18
Joined: Tue Mar 14, 2017 3:50 pm
Tumblr: brixujel
Deviantart: brixujel
Contact:

Character Tracing/Tracking

#1 Post by Dreamulex »

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~

User avatar
DannyGMaster
Regular
Posts: 113
Joined: Fri Sep 02, 2016 11:07 am
Contact:

Re: Character Tracing/Tracking

#2 Post by DannyGMaster »

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:

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."
This is very primitive but hopefully it will give you an idea.
The silent voice within one's heart whispers the most profound wisdom.

Post Reply

Who is online

Users browsing this forum: No registered users