I want to create a "map", looking somewhat like this:
ÚÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ¿
5³ . . . . . + . . . . . ³
4³ . . . . . . . . . . . ³
3³ . . . . . . . . . . . ³
2³ . . Û . . . . . . . . ³
1³ . . . . . . . . . . . ³
0³ + . . . . . . . . . + ³
1³ . . . . . . . ° . . . ³
2³ . . . . . . . . . . . ³
3³ . . . . . . . . . . . ³
4³ . . . . . . . . . . . ³
5³ . . . . . + . . . . . ³
ÀÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÙ
5 4 3 2 1 0 1 2 3 4 5
Hey all. I'm trying to create a database contained in a file and then
read from it using MPL. Most of the file functions that I've found documented or that can be read from the sourcecode seem to be removed or not working correctly, for some reason.
I tried to look at how the blackjack.mps script was made, but it was
waaay beyond my level of understanding..
I want to create a "map", looking somewhat like this:
ÚÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ¿
5³ . . . . . + . . . . . ³
4³ . . . . . . . . . . . ³
3³ . . . . . . . . . . . ³
2³ . . Û . . . . . . . . ³
1³ . . . . . . . . . . . ³
0³ + . . . . . . . . . + ³
1³ . . . . . . . ° . . . ³
2³ . . . . . . . . . . . ³
3³ . . . . . . . . . . . ³
4³ . . . . . . . . . . . ³
5³ . . . . . + . . . . . ³
ÀÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÙ
5 4 3 2 1 0 1 2 3 4 5
Where each dot is representing a coordinate, going from 1 to 1.
How would I write this data to a file, and then later read from said
file and print the map to the screen?
The reason I can't just create a .ans file or hardcode it is because I want to have a script that is able to create different versions on a per-user basis.
What sort of "Data" is in each location? I noticed you have 2 different "Blocks" to represent something.
If this is going to be a Database, I will assume that each "Record" in
the database is assigned to a "User"...
The data will be a series of strings containing color codes and characters, the final result typically occupying 1 or in some cases 2 spaces when drawn. The coordinates in my system (represented as dots in the original message) technically are two coordinates in reality, as it has a space after each dot (which in some cases will be a character instead of a space).
That's correct. Either all in one file, or each user will have their own file - it all depends on what's easiest/most efficient to setup.
My problem is mostly how to actually write it to a file and then read the data into variables (probably arrays as you suggested). I studied mainly blackjack.mpl (included with mystic), but I couldn't make any sense out
of the file-related part of the code.
Instead of looking at blackjack.mpl, take a look at (I believe it was xqtr) that has a file called gamestub.mpl ... It shows you how to create/manage/update a simple "User" database in which you could place your array as part of the file.
Gamestub.mpl is in an MPL tutorial and it's a good framework to build
your MPL program.
I couldn't find gamestub.mpl, not in blackflag's file areas, nor in
mystic itself. Upon googling it the file seems to be hosted at cyberia.darktech.org, but I wasn't able to reach it at all. I tried telnet, ftp and http, but all of them seemed to be down (unless they changed their domain or something?)..
Nevermind, I found it! It seems the address had changed from cyberia.darktech.org to CyberiaBBS.Zapto.Org.
What sort of "Data" is in each location? I noticed you have 2 differ "Blocks" to represent something.
The data will be a series of strings containing color codes and characters, the final result typically occupying 1 or in some cases 2 spaces when drawn. The coordinates in my system (represented as dots in the original message) technically are two coordinates in reality, as it has a space after each dot (which in some cases will be a character instead of a space).
If this is going to be a Database, I will assume that each "Record" i the database is assigned to a "User"...
That's correct. Either all in one file, or each user will have their own file - it all depends on what's easiest/most efficient to setup.
My problem is mostly how to actually write it to a file and then read the data into variables (probably arrays as you suggested). I studied mainly blackjack.mpl (included with mystic), but I couldn't make any sense out
of the file-related part of the code.
Instead of looking at blackjack.mpl, take a look at (I believe it was xqtr) that has a file called gamestub.mpl ... It shows you how to create/manage/update a simple "User" database in which you could plac your array as part of the file.
Gamestub.mpl is in an MPL tutorial and it's a good framework to build your MPL program.
I couldn't find gamestub.mpl, not in blackflag's file areas, nor in
mystic itself. Upon googling it the file seems to be hosted at cyberia.darktech.org, but I wasn't able to reach it at all. I tried telnet, ftp and http, but all of them seemed to be down (unless they changed their domain or something?)..
In case you have the file I'd be very thankful if you would upload it somewhere :)
Sysop: | Keyop |
---|---|
Location: | Huddersfield, West Yorkshire, UK |
Users: | 296 |
Nodes: | 16 (2 / 14) |
Uptime: | 59:26:12 |
Calls: | 6,653 |
Calls today: | 5 |
Files: | 12,200 |
Messages: | 5,331,283 |