- Joined
- Oct 29, 2011
- Messages
- 13
Alright, so I, once again, find i need the community's help. I'm trying to create a road building system that, when finished, will work as such:
When the Road unit is built, the terrain under it changes to a Village-Stone Path, The Road unit is replaced with an invisible road unit that is walkable, but not buildable. When this unit is destroyed, the terrain under it changes to Rough Dirt.
All of this works fine. The problem I'm having is this:
Since you can build buildings on half-tiles of terrain, if you build the road unit on a half-tile, the terrain that changes is half under, half not-under, the built Road Unit. Thusly, the unbuildable;walkable unit that replaces the built unit is half on, half off the road.
I'm looking for a trigger that can detect whether the x value and y value of the replaced building's center is a multiple of 128(the center x and y of a terrain block 1 is always a multiple of 128, at least on the map I'm using) so that I can move the replaced unit as needed up(for y), or right(for x) by 64(To make it a multiple of 128).
If anybody knows how to do this, that would be awesome.
When the Road unit is built, the terrain under it changes to a Village-Stone Path, The Road unit is replaced with an invisible road unit that is walkable, but not buildable. When this unit is destroyed, the terrain under it changes to Rough Dirt.
All of this works fine. The problem I'm having is this:
Since you can build buildings on half-tiles of terrain, if you build the road unit on a half-tile, the terrain that changes is half under, half not-under, the built Road Unit. Thusly, the unbuildable;walkable unit that replaces the built unit is half on, half off the road.
I'm looking for a trigger that can detect whether the x value and y value of the replaced building's center is a multiple of 128(the center x and y of a terrain block 1 is always a multiple of 128, at least on the map I'm using) so that I can move the replaced unit as needed up(for y), or right(for x) by 64(To make it a multiple of 128).
If anybody knows how to do this, that would be awesome.