ID:154105
 
Okay, I need (or want) to build a program that will divide up the map into chunks of different areas - well, the same area, but with a different variable for each, such as their tag or a number. Basically you can imagine a map that is divided into sections, such as desert, swamp, grassland, mountains, etc... Only instead of using turfs, you're using areas. I don't have a lot of experience with areas, so I'm looking for some advice on how I'd build something like this. Any suggestions?

A poor example, where each letter represents an area type:
XXXXXXXXZZZZZZZZ
OOXXXXqqqqqqZZZZ
OOOXXXXqqqqXXXZZ
OOOOqqqqqqqXXXXX
OOOOOqqqqqXXXXXX
OOOTTTqqqXXXXXXX
OTTTTTTTPPPPPPPP
You can edit area instances in the map editor just like anything else.

If you want to change the area a turf is in at runtime, there is a demo of it in my OutsideArea demo. You can't directly manipulate a turf's loc var, but you can add turfs to an area's contents. Different method, same result.

You can create areas at runtime and add turfs to it. Areas don't occupy map space, since the map is actually just a grid of turfs. You don't need to worry about where an area is when it's created. You add the wheres (turfs) later.