Adventure Game Studio

AGS Support => Beginners' Technical Questions => Topic started by: A�rendyll (formerly Yurina) on Sat 28/01/2006 15:11:40

Title: How to make User accounts?
Post by: A�rendyll (formerly Yurina) on Sat 28/01/2006 15:11:40
Hi all,

I'm asking a lot around (I'm sure of that), and this time I want to know or it is possible to create a savegame style like in the Zelda games.

With this I mean:
- Give your character a (pre-programmed or text parsed) name,
- being able to save in up to 3 slots only,
- Maybe some kind of password security

This may sound strange, but I want to try this out.

~Yurina
Title: Re: How to make User accounts?
Post by: Ashen on Sat 28/01/2006 16:57:53
Don't worry about asking questions, it's one of the best ways to learn. (As long as they haven't already been answered hundreds of times, of course ;))


Limiting the number of save slots is the easiest bit. You can use SaveGameSlot(..) and RestoreGameSlot(..) to save to / load from specific slots, and provided you avoid the built in save/load functions (SaveGameDialog() RestoreGameDialog(), ListBox.FillSaveGameList()) you can have as few - or as many - save slots as you like.

Password security and user accounts are the trickier parts. You'll probably need to give each player a number, so you know which save slots they can use (Player 1 gets slots 1-3, player 2 gets 4-6, etc). You can either store these and the player's name and password, externally with the File functions and properties (http://www.adventuregamestudio.co.uk/manual/File%20functions%20and%20properties.htm) (you might find the IniFile Module (http://www.adventuregamestudio.co.uk/yabb/index.php?board=10.40) and/or the Encrytped File Module (http://www.adventuregamestudio.co.uk/yabb/index.php?topic=23109.0) useful here), or save them into the game itself.

Sorry if this is a bit vague, but it's the best I can do without giving specifc code, which I don't know off hand. This is all definitely possible though, try starting a new game and seeing what you can come up with by trial and error (another good way to learn).
Title: Re: How to make User accounts?
Post by: A�rendyll (formerly Yurina) on Sat 28/01/2006 18:50:16
Thanks, I'll try it out!

In general I have a new game for testing GUI's and these kinds of things ready. It's the standard game which isn't totally empty (with Roger in it), customized with a grey and empty room and also an other character, a hotspot, a region, an object, etc. This way I can test nearly anything, but sometimes that doesn't totally work of course.