If the X and Y coordinates of your source and destination locations were about the same (i.e. diagonal movement) replacing X for Y doesn't make much of a difference, especially since you can be 10 tiles off both up and down while still being in range, but in my case I had a massive difference.
Thanks for the site blockage investigation.
My current plan is to make a PSV world and a civ placement world gen breakout script for it once the next DF version is released. While DFHack won't be available, the release notes should help inform me on how to make the PSV world, and the script can be tried out using the current version and then wait for DFHack to catch up for the "real" world to be generated.
I'm hazy on how nomadic necros work, but it's not important to me anyway. It does sound nifty to be able to generate a lot of towers for those who aren't satisfied with one or two, though.
Edit: I've tried habitation movement during world gen, and it doesn't work as desired. I've been able to move the sites, but when the source and destination are on the same landmass new sites are sprouted near the original site locations, not near the targets. When moved between landmasses the sites become sterile. I've found an unnamed structure at the end of the civ data that contains region and landmass pointers, but changing those to match the destination didn't do anything (haven't tried that on the same landmass, though). In one case moved human sites transplanted into forest resulted in tombs sprouting around them, but that's not exactly the kind of expansion we want. Gobbos moved from one low savagery plain landmass to another low savagery plain landmass still become sterile. It also seems the civ's claim data gets wiped somewhere, even though I've changed the claim from the original tile to the destination one as part of the transplantation.
It all indicates there are required connections missing, so for the time being we should probably stick to transplanting "simple" things like necro towers.
When it comes to keeping your races to stick to desired starting positions, it might be better to hack the gobbos to have a single starting biome (like dwarves have), and remove that biome from other races starting set.
Edit 2:
Still no success on the habitation movement front. What I've found so far:
- The site has a position
- There are entity links with the site's position. During world gen "market" links can be made to nearby moved sites, but these links differ from ordinary links in that each of the sites in the pair has its own (rather than a shared link) with the own location as the position. (The necro tower I've played with had a market link that had a position at a human hamlet).
- The civ entity has a claim area consisting of the location of the site during world gen. It grows during history. I can make no sense out of the global claim1/2 structures, though.
- The civ entity has a pair of fields in the form of unknonwn2.unk14 and .unk15 pointing to the starting site's locations region and landmass entries, although the pointers seem to be mixed up by the DFHack layout description.
- There's a "resource allotments" structure in world data for each starting site and it contains the site coordinates. The site government refers to this allotment. During world gen more allotments are generated with coordinates of new sites, but they are fewer than the number of sites.
I've adjusted all of the coordinates above as well as the region/landmass pointers, but DF stubbornly generates new habitations around the original site location if the site is moved "short" distances only (my 33 * 33 test world contains 4 landmasses with uniform biomes on each), but refuse to produce anything but tombs (humans), refugees, and performance troupes when moved to a different landmass. Somewhere there is a structure where DF holds the locations from which to spread habitations, but I can't find it. With a mixture of moved and untouched sites 3*3 "holes" are left unsettled on landmasses otherwise completely filled with habitations after running the history. These holes form around moved sites, but I think the empty holes mark where sites were located before being moved.