Adventure Game Studio

AGS Support => Beginners' Technical Questions => Topic started by: esper on Sun 16/10/2005 11:04:16

Title: import/export character stats
Post by: esper on Sun 16/10/2005 11:04:16
I did a search for several things, including ".dat," which is how I figured this would work. I found several similar topics, but none that helped me at all, or were about exactly what I want to do.

I want to make an AGS game where you can make your character (think QFG, only more in-depth) and use him in the game, then, at the end of the game, you could export his stats, possessions, etc. for use in another game. I can't find out how to do this. I'm sure it's possible, because I could program that to happen in QBasic (and once did, actually)...

This is the closest I could find to what I'm talking about: http://www.adventuregamestudio.co.uk/yabb/index.php?topic=12409.0

It still isn't exactly what I want, plus Migs never explains exactly how to do it...
Title: Re: import/export character stats
Post by: RickJ on Sun 16/10/2005 11:32:55
I recently wrote a module to read/write/etc inifile that may be of use to you.  It's here  (http://www.adventuregamestudio.co.uk/yabb/index.php?topic=22599.0).  Just download the module and read the documentation.  What's an inifile?  They are those windows configuration files ending with ".ini" such as win.ini, system.ini.
Title: Re: import/export character stats
Post by: esper on Thu 20/10/2005 10:01:36
Maybe you are the right person to ask then, but instead of cluttering up your inbox I'll post it for anyone to answer.

If I could conceivably write a character creation program in VB6, is there any way I could make it part of my AGS file, so it runs the program when you select "New Game" and then takes the stored variables from the external program and runs them through AGS? I guess what I'm asking is, if I have the know-how to make a character creation program, how do I turn it into an AGS character creation module?
Title: Re: import/export character stats
Post by: Gilbert on Thu 20/10/2005 10:17:39
An AGS game cannot run a non-AGS programme itself (unless you do it via a plugin of course). If there aren't many reasons you must make the character creation programme with VB, you can always script it with AGS.
Title: Re: import/export character stats
Post by: esper on Thu 20/10/2005 10:25:04
Quote from: esper on Thu 20/10/2005 10:01:36
I guess what I'm asking is, if I have the know-how to make a character creation program, how do I turn it into an AGS character creation module?

That's what I mean. I'm not sure how to make a VB program into a plugin that is compatible with AGS. The manual is of little help. I taught myself everything I know about computers, programming, and AGS, and so I don't necessarily understand everything the manual is trying to say on the matter of plugins.
Title: Re: import/export character stats
Post by: Gilbert on Thu 20/10/2005 10:32:51
Actually what I was saying is, I don't recommend making a plugin, if you can really make it directly with AGS scripting, in my opinion, making a plugin would probably mean more work, unless there're reasons you must make that programme with VB.
Title: Re: import/export character stats
Post by: esper on Thu 20/10/2005 10:41:17
Ah, I see. I'm just not that great with AGS scripting, and I don't know how "clean" I could get it to look, whereas I already know exactly how it would look with VB (since I already made it for another game before I ever found AGS). But if you don't suggest making a plugin, and I already said I'm not that good with AGS scripting, I should probably listen to you.
Title: Re: import/export character stats
Post by: Gilbert on Thu 20/10/2005 10:45:55
If you don't really need the two programmes linked together, you can always make the VB programme a separate programe, which creates binary character stat files, then from within your AGS game you can use the File functions to read the data back byte by byte.
Title: Re: import/export character stats
Post by: Elliott Hird on Thu 20/10/2005 10:55:18
Well, there's an encryptedfile module so people don't edit it, and just write it like this:

4
2
3
Name

and read it as first line strength (etc.)

with the file functions.

Can't be too hard.
Title: Re: import/export character stats
Post by: Janik on Fri 21/10/2005 03:53:31
Quote from: esper on Thu 20/10/2005 10:41:17
Ah, I see. I'm just not that great with AGS scripting, and I don't know how "clean" I could get it to look, whereas I already know exactly how it would look with VB (since I already made it for another game before I ever found AGS). But if you don't suggest making a plugin, and I already said I'm not that good with AGS scripting, I should probably listen to you.
If you know Visual C++ reasonably well, then you can make a plugin. If you start with the template, plugins aren't that hard to make. You should probably forget about making the plugin in VB, though; as much as I like VB, it can't handle something like that.

Conceivably, though, you could make a small "wrapper" plugin in VC++, and all it does is launch your separate executable (made in VB or whatever). I haven't tried it, but I can't see why it wouldn't work.

Title: Re: import/export character stats
Post by: esper on Fri 21/10/2005 07:16:41
argh, nay.... I only know just enough C++ to do a couple mathmatical equations and print to the screen. I can program in every incarnation of BASIC, from the original to VB6, but you're right, it isn't very powerful...
Title: Re: import/export character stats
Post by: Elliott Hird on Fri 21/10/2005 10:47:36
None of this is needed with the file functions and encryptedfile module. I'll step-by-step guide you through by pm if you want, then I'll post the result here.