Roster System?

This forum is meant for posting anything related to Adventure Maker that doesn't fit in the other forums.Please post technical questions in the Technical Support Forum!

Moderators: time-killer-games, Vengeance66, Candle, reneuend, GM-Support

Roster System?

Postby JasonMc » Tue Jul 13, 2010 12:51 am

I've been looking through Doggy's tutorials for custom load/save functions, and I can't find exactly what I'm looking for.

I want to override AM's Save/Load and create a roster save/load system, in which someone enters their name the first time they play, only, and then it shows up on a login screen each time after that.

These are the functions I would ideally like in the system:

>Load screen replaced with in-frame list with all the saved "users" (Users enter their name one time only, and then select their name from the list for all future launches.

>Uses .ini format (file extension will be changed to .paw)

>All saves throughout the game are written to a user's .ini file that is only selected ONCE in the game.

>Automatic Save (no need to keep clicking "save")

>Progress tracked for each concept (multi-variable scoring system)

I know this is possible. However, I have no idea where to start. ANY help would be greatly appreciated!!

(P.S. Yes, this is definitely the way I want the system to work, as I'm doing educational games.)
-Jason McDonald
Manager, Programmer
MousePaw Games

--
PocketWatch 1.0 Plugin now available in the Plugins Corner!
User avatar
JasonMc
Active Member
 
Posts: 99
Joined: Sun Jul 04, 2010 10:27 pm
Location: Pacific Northwest, USA

Postby Lyberodoggy » Tue Jul 13, 2010 12:59 am

Well, the tutorial I 've made is totally customizable. You can use the code partially to create the effect you want. For example what I 'd do is create an ini file that would store the usernames and then name every savefile ini according to the username.

For example, let's say there's a file named users.ini and it looks like this:

[users]
1=lyberodoggy
2=jasonmc

Then there should be two more ini files named lyberodoggy.ini and jasonmc.ini storing the necessary info
It's totally possible.
User avatar
Lyberodoggy
Administrator
 
Posts: 2526
Joined: Sat Feb 17, 2007 3:31 pm
Location: Athens

Postby JasonMc » Tue Jul 13, 2010 1:17 am

Well, being incredibly novice to this coding, I can't figure out how to do that, exactly, and I don't know how to do those other features I mentioned above.

Especially, how do I have a clickable list of all the users to select from, and how do I make the system automatically save to the username file selected at the beginning?
-Jason McDonald
Manager, Programmer
MousePaw Games

--
PocketWatch 1.0 Plugin now available in the Plugins Corner!
User avatar
JasonMc
Active Member
 
Posts: 99
Joined: Sun Jul 04, 2010 10:27 pm
Location: Pacific Northwest, USA

Postby Lyberodoggy » Tue Jul 13, 2010 3:00 pm

According to AM's manual, the program supports vblists. (the dropdown lists where you select an item)
I know you can create a listbox using the command
LoadControl ListBoxObject(index)
and then make it visible etc but I don't know how you add items to the list... If someone can help us figure that out, that is going to be your clickable username list.

As for the other question, that one is easily solved. You can create a variant variable, storing the selected username during runtime and saving the progress to the right file.
User avatar
Lyberodoggy
Administrator
 
Posts: 2526
Joined: Sat Feb 17, 2007 3:31 pm
Location: Athens

Postby JasonMc » Wed Jul 14, 2010 3:08 am

Well, I'm searching for info about the drop down box...

How EXACTLY do I program the autosave? (Step by step, please. I'm a MAJOR novice, lol)

EDIT: I built this code, but it doens't like the "ReadIniValue" command. What am I doing wrong??

LoadControl ListBoxObject(index)
ListBoxObject.AddItem ReadIniValue("Users.ini")
-Jason McDonald
Manager, Programmer
MousePaw Games

--
PocketWatch 1.0 Plugin now available in the Plugins Corner!
User avatar
JasonMc
Active Member
 
Posts: 99
Joined: Sun Jul 04, 2010 10:27 pm
Location: Pacific Northwest, USA

Postby Lyberodoggy » Wed Jul 14, 2010 12:43 pm

first of all you must replace index with a number of your choice. let's say the index is 1
Then what you have wrong is the syntax of the ReadINI command. It needs the filename, the section and the key. So if for example the users.ini is like the one described above and add another section named usercount with one key storing the number of users saved, then your code should look something like this:

Code: Select all
LoadControl ListBoxObject(1)
for i=1 to ReadINI("users.ini","usercount",1)
ListBoxObject(1).AddItem ReadIniValue("users.ini","users",i)
next


As for the autosaves, you just need to create a saving procedure and have it executed in each autosave frame
User avatar
Lyberodoggy
Administrator
 
Posts: 2526
Joined: Sat Feb 17, 2007 3:31 pm
Location: Athens

Postby JasonMc » Wed Jul 14, 2010 4:42 pm

I don't know how to build the saving procedure...
-Jason McDonald
Manager, Programmer
MousePaw Games

--
PocketWatch 1.0 Plugin now available in the Plugins Corner!
User avatar
JasonMc
Active Member
 
Posts: 99
Joined: Sun Jul 04, 2010 10:27 pm
Location: Pacific Northwest, USA

Postby Lyberodoggy » Wed Jul 14, 2010 10:48 pm

it is already in the tutorial.
User avatar
Lyberodoggy
Administrator
 
Posts: 2526
Joined: Sat Feb 17, 2007 3:31 pm
Location: Athens

Postby JasonMc » Thu Jul 15, 2010 12:44 am

It is returning null values. Where should I be saving the .ini file?

Futhermore, is this the code you were looking for for writing TO an .ini?

Code: Select all
Sub WriteINIStringVirtual(Section, KeyName, Value, FileName)
  WriteINIString Section, KeyName, Value, _
    Server.MapPath(FileName)
End Sub


Also, I was trying out the Custom Save/Load tutorial (http://adventuremaker.com/phpBB2/viewtopic.php?t=3741). That is pretty close to what I need, however, I don't know how exactly to script everything. Since I will have SOO MANY variables, I don't know how to enter it all.

I'm sorry to be such a pain. This is really the first time I've ever done anything like this, and I have a looming deadline.
-Jason McDonald
Manager, Programmer
MousePaw Games

--
PocketWatch 1.0 Plugin now available in the Plugins Corner!
User avatar
JasonMc
Active Member
 
Posts: 99
Joined: Sun Jul 04, 2010 10:27 pm
Location: Pacific Northwest, USA

Postby Lyberodoggy » Thu Jul 15, 2010 10:31 pm

The .ini will be automatically created in the External folder of your project.
The code you gave me was in the manual?

Anyways, in a post under the tutorial there's some code I 've written to prevent adding every variable manually. This one:

Code: Select all
For i = 1 To WindowObject.Variables.Count
Action.WriteINI filename+".save",2,i,WindowObject.Variables.Item(i).Name
Action.WriteINI filename+".save",3,i,WindowObject.Variables.Item(i).Value
Next
For i = 1 To WindowObject.VariablesVariant.Count
Action.WriteINI filename+".save",4,i,WindowObject.VariablesVariant.Item(i).Name
Action.WriteINI filename+".save",5,i,WindowObject.VariablesVariant.Item(i).Value
Next
User avatar
Lyberodoggy
Administrator
 
Posts: 2526
Joined: Sat Feb 17, 2007 3:31 pm
Location: Athens

Postby JasonMc » Fri Jul 16, 2010 4:33 am

On what button do I put that VBScript you just posted?

BTW, the code I just posted I pulled from a site on VBScripts, and I figured it could be tweaked to work.
-Jason McDonald
Manager, Programmer
MousePaw Games

--
PocketWatch 1.0 Plugin now available in the Plugins Corner!
User avatar
JasonMc
Active Member
 
Posts: 99
Joined: Sun Jul 04, 2010 10:27 pm
Location: Pacific Northwest, USA

Postby Lyberodoggy » Fri Jul 16, 2010 12:21 pm

Unfortunately I don't think it can cause it uses calls unknown to the AM engine.

The code I gave you replaces the variable storing section of the saving routine
User avatar
Lyberodoggy
Administrator
 
Posts: 2526
Joined: Sat Feb 17, 2007 3:31 pm
Location: Athens

Postby JasonMc » Fri Jul 16, 2010 4:29 pm

So, what code do I enter for this thing to track all the users in the list? Once I have that aspect figured out, I think I can combine what you've given me on here, and your tutorials, and get the system built.
-Jason McDonald
Manager, Programmer
MousePaw Games

--
PocketWatch 1.0 Plugin now available in the Plugins Corner!
User avatar
JasonMc
Active Member
 
Posts: 99
Joined: Sun Jul 04, 2010 10:27 pm
Location: Pacific Northwest, USA

Postby Lyberodoggy » Sat Jul 17, 2010 1:27 pm

Can you please build a sample project with the save menu etc? I could work on it and provide the necessary code. That's if you can wait because I 'm leaving for vacation tommorow and I probably won't access the internet for the next week.
User avatar
Lyberodoggy
Administrator
 
Posts: 2526
Joined: Sat Feb 17, 2007 3:31 pm
Location: Athens

Postby JasonMc » Mon Jul 19, 2010 6:34 am

Here's the file. I'm working with the "openmenu" frame, mostly.

Please ignore the "save" button on the "menu" frame, and only put the autosave code into the frame properties of "1", "2", "map" "quitconfirm", and "pause", if you can.

I programmed KeyGuard to pause on the openmenu frame, as it was interfering with the code.

I've been fighting with this all evening, and I think I have the New Agent (new user) aspect mostly debugged, but the Returning Agent button still has a "null" error.

"Start Mission" is the second "OK" button.

Thanks for the help! I'm going to start building the rest of the game while I wait for this component, and then I'll duplicate it on the new file.

I'll be sure to put your name in the credits. :D

Here's the link...

http://mousepawgames.com/WORD4WORDMASTER-1.zip
-Jason McDonald
Manager, Programmer
MousePaw Games

--
PocketWatch 1.0 Plugin now available in the Plugins Corner!
User avatar
JasonMc
Active Member
 
Posts: 99
Joined: Sun Jul 04, 2010 10:27 pm
Location: Pacific Northwest, USA


Return to Adventure Maker General Discussion

Who is online

Users browsing this forum: No registered users and 0 guests

cron