Since there's so much interest in map scripts, let me explain how they work using the example of forest terrain.
- type: FOREST <-- script name
commands: <-- this is where the scripting starts
- type: addUFO <-- place the UFO (or building); no extra positioning parameters, so it spawns in a random place; landing block will be placed under it
- type: addCraft <-- place the X-Com vehicle; also no positioning; landing block will be placed under it
- type: addLine <-- place road
label: 1 <-- conditional label, used later
direction: vertical <-- road's direction 1
executionChances: 12 <-- how likely it is for this command to be executed, in %
- type: addLine <-- place road
label: 2 <-- conditional label, used later
conditionals: -1 <-- this command can only be executed if the command with label 1 is not executed
direction: horizontal <-- road's direction 2
executionChances: 10 <-- how likely it is for this command to be executed, in %
- type: addLine <-- place roads in both directions, with a crossroad
conditionals: [-1, -2] <-- this command can only be executed if the commands with labels 1 and 2 are not executed
executionChances: 15 <-- how likely it is for this command to be executed, in %
direction: both <-- both directions
- type: addBlock <-- place a map block
size: 3 <-- ...with size 30x30
groups: 0 <-- default group for normal blocks
executionChances: 75 <-- how likely it is for this command to be executed, in %
- type: addBlock <-- place a map block
size: 2 <-- ...with size 20x20
executions: 4 <-- ...and do it 4 times
- type: fillArea <-- place map blocks to fill the entire map; no size means only 10x10 blocks will be used
Now, what can we do with this to improve the situation? We could expand the commands like this:
- type: addUFO
rects:
- [0,0,3,3]
This will cause the UFO to always spawn in the top corner of the map, no further than 40 tiles from it (since we count starting with 0). Why 40 tiles and not for example 10? Because that area would be too small for anything bigger than 10x10 to spawn, so we need to ensure enough space.
Even if we do that, we still need to control where the X-Com craft spawns, otherwise it may also be spawned near the same corner. We can, of course, do something similar:
- type: addCraft
rects:
- [4,4,2,2]
So it will spawn at least 50 tiles from the upper corner.
Problems:
1. Depending on map size and UFO/craft involved, this will often result in a crash, when the engine cannot place the UFO or craft in the specified location.
2. Even if it worked, every mission would have both objects placed in roughly the same places, which would be repetitive and go against the design of X-Com.
I hope this clarifies the matter.