The terran siege tanks, like many units, has an odd size. According to DatEdit:
"Left: 16"
"Right: 15"
Contrast this with the terran ghost, which is:
"Left: 7"
"Right: 7"
This means that the siege tank is 31 pixels wide. However if you create a 31 pixel wide location that's inverted along the x axis, then say:
Code
Trigger("Player 1"){
Conditions:
Always();
Actions:
Move Location("Current Player", "Men", "Anywhere", "30 pixel inverted");
}
//-----------------------------------------------------------------//
Trigger("Player 1"){
Conditions:
Bring("Current Player", "Men", "30 pixel inverted", At least, 1);
Actions:
Display Text Message(Always Display, "Unit exists.");
Preserve Trigger();
}
Conditions:
Always();
Actions:
Move Location("Current Player", "Men", "Anywhere", "30 pixel inverted");
}
//-----------------------------------------------------------------//
Trigger("Player 1"){
Conditions:
Bring("Current Player", "Men", "30 pixel inverted", At least, 1);
Actions:
Display Text Message(Always Display, "Unit exists.");
Preserve Trigger();
}
The "Unit exists" message will not display.
It's tempting to think from that that the siege tank can not fit inside the location for some reason. However that is not the case.
If you were to divide the siege tank in half, the extra pixel of its width would be on the left of the halfway point. Here's a little picture, the line is the half way point, the periods are pixels:
Code
................|...............
When you center the inverted location on the siege tank, the extra pixel of the locations falls to the right of the halfway point.
Code
...............|................
If you center the location on the siege tank, you have something that looks like this:
Code
................|...............
...............|................
...............|................
As you can see, the there's parts of the location outside of the siege tank, therefore the tank is not at that location.
However if you create a 0x0 pixel location 1 pixel to the left of the siege tank, and then you center the 31 pixel x inverted location around that location, then the condition "brings at least 1 tank to 31 pixel x inverted" would trip.
Here's the map that I used to figure this out. There's probably some people out there who've known this for a while. I really wish that they had shared it with the rest of us.
Attachments:
Post has been edited 1 time(s), last time on Jul 8 2009, 10:45 pm by scwizard.
None.