This is the situation:
I'm working on a chess map. There is a static grid made of burrowed P8 Infested Terrans; every 3rd box (normal size grid, SCM Draft2) there's an Infested Terran so they are not too close to each other. An IT represents a single position. By casting Disruption Field with your Corsair you can select an unit (unburrowed unit, not an IT) and by casting it again on another location you order it to move there, but only if the path to it is free.
To check if the path between starting and ending point is free I use the static grid of IT's. First I move a location ontop of the unit which covers all the spaces around it as well (a 3x3 location). Then by giving a number of IT's to another player (P7) I select one IT and center the 3x3 location and a checking location on it. Then I just repeat the process until all the spots between starting and ending point have a checking location on them. This is done practically instantly in all possible directions.
As it is chess, certain units can only move in specific directions like only diagonal or vertical, etc.
When all the checking locations are in place, it checks if the selected unit is able to move to that location and if the spots between start and end are not already taken.
This is the problem:
I noticed that when I ordered an unit to the edge of the game-board and tried to move it from there something went wrong. Suddenly a Bishop could not move diagonal but only horizontal/vertical and vica versa for the Rook.
After hours of testing I am pretty sure about what is going wrong. In the case of the Bishop the check locations should be at North West, NE, SE and SW. However sometimes it is NW, E, SE and SW; or NW, NE, E, W; or something similair wrong.
The stupid thing is, is that I have not discovered any pattern in when it does or not does go wrong. Sometimes the locations are placed perfectly but when you move one box to the left the locations are NOT placed as they should. They stay constant though: so if at one spot the locations are placed as they should then every time you are at that spot they will be placed as they should, same goes for errors.
In case it is all a bit confusing I created two masterpieces of art. See attached images.
What I have already tried:
- I've removed and replaced the Infested Terrans static grid multiple times
- Extended the size of the grid not rule out 'bounce' errors (like bouncing locations near edge of the map)
- Removed and changed terrain multiple times
- Re-checked all triggers for possible errors
- Re-checked all locations for possible size errors
If someone is up to it I'll send the map but it has nearly 1300 lines of code, though a lot are just triggers which repeat themselves slighty different.
Attachments:
None.