A few questions

A place to discuss things that aren't specific to any one creator or game.
Forum rules
Ren'Py specific questions should be posted in the Ren'Py Questions and Annoucements forum, not here.
Post Reply
Message
Author
User avatar
Dis
Regular
Posts: 33
Joined: Sat Apr 22, 2006 6:00 am
Projects: Angel of Love,Forgotten,War's Fate, D
Location: Hungary
Contact:

A few questions

#1 Post by Dis » Sun Jul 24, 2011 6:32 pm

1st question:
Is it possible to make an input field? No, I know that there is the input name script, but first of all, I want the input field in the middle of the screen, with a given color and a given size and form.

I want to make 2 input fields at the main menu screen instead of the Start Game, Load Game, etc. buttons. In one you would input your name, and in the other, something else, for example your password.

And bellow the two fields would be the Log in/Submit button and next to it the Quit button.

The inputed data would be stored as variables.

Can the inputed variables be stored somehow? I mean, after you quit and come back later, and type in the data and it will match it up to the stored variable.

In short, I want to make some sort of login section.

2nd question:

Can the following be done in RenPy.

After you log in, it brings up the next part of the game, with a default 2D/3D character model (depends on our artist), and for example similar to the working principle of those character art creation tools, you could select how your character looks, and it would store the selected details, for example with variables.

Can this be done?

And then, when the character is done and you give him/her a name, the game finally starts and the next time you log in, you can select your character and continue or create a new one or quit back to the main menu. We could say that the login part decides what characters and what saved games the player can see and load/play.

Player A creates a profile, then a character on the profile and starts the story. Later on he/she saves and quits. He/she can only access his/her own saves, unlocked extras page, etc. Player B can't access/see them if he/she doesn't know his/her profile information.


Fell free to ask if something is not understandable.

And no, we don't want to make a game, just a fan made, visual novel, of a very good visual novel type game, that sadly closed down recently because of money problems.
Where there's a will there's a way.

Project D:AoL
Special Thanks for their motivation and support to: BCS, Enerccio, mikey, monele, PyTom, yvanc, mugenjohncel, Sai

User avatar
Spiky Caterpillar
Veteran
Posts: 252
Joined: Fri Nov 14, 2008 7:59 pm
Completed: Lots.
Projects: Black Closet
Organization: Slipshod
Location: Behind you.
Contact:

Re: A few questions

#2 Post by Spiky Caterpillar » Sun Jul 24, 2011 9:07 pm

It can be done (and I've done some of it in Magical Diary).

Coming up with a new style for a single input field is fairly easy; having multiple working input fields at once onscreen is harder and will require a fair bit of Python work. (Unless there's an easy way that I don't know about, which is possible.).

You can use persistent variables to store the player's previous settings for use as defaults next time around. Setting up multiple passworded profiles is more complicated and will definitely require you to mess around with Python a fair bit. (the easiest way is probably to change the save directory when you change profiles, but I've never done anything like that myself so am not sure what would be involved). However, doing authentication within Ren'Py is pointless for most projects - if the *game* can save files under both my profile and my brother's profile, my brother can just copy my saves and settings into his profile directory and get all my unlocks - then replace my old settings with whatever he'd like them to be. It's better to leave authentication to the OS - all the OSes Ren'Py currently supports are multiuser, so the saves and settings will be stored in a different directory depending on what user saved them, and users who care about protecting them can set their permissions accordingly.
Nom nom nom nom nom LEAVES.

User avatar
papillon
Arbiter of the Internets
Posts: 4038
Joined: Tue Aug 26, 2003 4:37 am
Completed: lots; see website!
Projects: that magical diary sequel, that vampire-raising game
Organization: Hanako Games
Tumblr: hanakogames
Contact:

Re: A few questions

#3 Post by papillon » Sun Jul 24, 2011 10:00 pm

if the *game* can save files under both my profile and my brother's profile, my brother can just copy my saves and settings into his profile directory and get all my unlocks
I have actually had people ask for separate profiles, not because they were afraid the other player on the computer would 'cheat' but because they wanted the experience of exploring and finding all the things for themselves instead of having them automatically available.

I just haven't cared enough to request that you implement it. :)

User avatar
Spiky Caterpillar
Veteran
Posts: 252
Joined: Fri Nov 14, 2008 7:59 pm
Completed: Lots.
Projects: Black Closet
Organization: Slipshod
Location: Behind you.
Contact:

Re: A few questions

#4 Post by Spiky Caterpillar » Sun Jul 24, 2011 10:24 pm

I'm not saying that separate profiles are pointless, but that putting password protection on them *inside Ren'Py* will be pointless for most projects.
Nom nom nom nom nom LEAVES.

User avatar
PyTom
Ren'Py Creator
Posts: 15436
Joined: Mon Feb 02, 2004 10:58 am
Completed: Moonlight Walks
Projects: Ren'Py
IRC Nick: renpytom
Github: renpytom
itch: renpytom
Location: Kings Park, NY
Contact:

Re: A few questions

#5 Post by PyTom » Sun Jul 24, 2011 10:51 pm

Hm... multiple profiles lead to something of a chicken-and-egg scenario, when it comes to persistent data. We need to know the path to the save directory in order to load persistent, but in the multiple profiles scenario, we'd want to use the persistent data to pick a profile to use.

What would be pretty easy to do would be to tweak the __filename function in screens.rpy to take an optional profile name. This would easily give profile-specific saving and loading. Things like achievements could be implemented by having profile-persistent object that is accessed through a field on persistent, if you choose to code it that way.

The only problem would be things like the automatic tracking of seen images and music. I'm not sure if that's a big deal, and if it was, I could probably document the fields that needs to be switched around when profiles are updated.

Alternatively, it would be possible to have a file in the default savedir that specifies the name of a profile directory to use. That would make this whole thing transparent - but one would have to do a complete restart of Ren'Py in order to switch profiles.
Supporting creators since 2004
(When was the last time you backed up your game?)
"Do good work." - Virgil Ivan "Gus" Grissom
"Silly and fun things are important." - Elon Musk
Software > Drama • https://www.patreon.com/renpytom

Post Reply

Who is online

Users browsing this forum: Majestic-12 [Bot]