How to check if I can adventure in an area

Gandalph

New member
I'm trying to make a script to tell me where good farming opportunities are, but I am having trouble figuring out how to limit the search to areas that I currently have access to. How do I check if I can adventure in a given area? Or should I just make a map of all the places that I don't want to consider?
 
OK, instead of making a new thread, I'll put this up here instead:

Is there a way to make a map of maps? I've tried making a record where one of the fields is a map, but I can't save/load this to a file, and the whole point of doing this would be to avoid recalculating the pickpocketing rates every time I run the script. Should I try doing this by using some sort of multiple indexing instead, or can I somehow make a map of maps which I can save to a file?

Never mind, solved by making a second map to store that data, and then reading in the data from two files instead of one.
 
Last edited:
Any value in a map can be a map:
PHP:
string [ int ] mysubmap1;
mysubmap[ 0 ] = "zero";
mysubmap[ 1 ] = "one";

string [ int ] mysubmap2;
mysubmap[ 2 ] = "two";
mysubmap[ 3 ] = "three";

string [ int ] [ int ] mymap;
mymap[ 0 ] = mysubmap1;
mymap[ 1 ] = mysubmap2;

map_to_file( mymap, "test.txt" );

results in the text file:
Code:
0	0	zero
0	1	one
1	2	two
1	3	three

So, you can assign a map to be the value in map, but you are bound by however you define mymap to start with anyway.

EDIT: maps of records can be saved via map_to_file() too, what was your problem exactly ?
 
Last edited:
Also see this wiki page for more information (yes, I actually got around to updating that at some point).

Records can also have maps as fields, but as noted, map_to_file() can't take a record as its first arg.
 
Back
Top