About destroying/visit villages

Recently I scripted a new chapter which has villages and some bandits in it, so I thought it were a good idea to give the bandits the AI to destroy the villages to give the player some pressure.
At first nothing happens when the bandits loot the villages making them trying to destroy it endlessly. So I figured “Hey, I just forgot the Tile Change” and coded the map change for a destroyed village. But when a player unit visits the village now it get destroyed as well afterwards, even though I have a Tile change for a visitied village. Maybe someone can enlighten me a bit, since I’m completly clueless about that.

Location_events:
Village(0x06,Village1,4,13)
Village(0x07,Village2,11,12)
Village(0x08,Village3,3,7)
Seize(0x09,Ending_event,7,1)
LOCA

ORG 0xCE1EC0
TileChanges:
TileMap(0x00,0x0B,0x0C,0x01,0x01,Village)
TileMap(0x02,0x04,0x0D,0x01,0x01,Village)
TileMap(0x03,0x03,0x07,0x01,0x01,Village)
TileMap(0x07,0x09,0x04,0x03,0x02,Destroyed)
TileMap(0x04,0x03,0x0C,0x03,0x02,Destroyed)
TileMap(0x05,0x0A,0x0B,0x03,0x02,Destroyed)
TileMap(0x06,0x02,0x06,0x03,0x02,Destroyed)
TileMapEnd
ALIGN 4

Village:
SHORT 0x0C80
SHORT

Destroyed:
SHORT 0x0C80
SHORT 0x0C84
SHORT 0x0B98
SHORT 0x0C10
SHORT 0x0C14
SHORT 0x0C18
SHORT

(There is one village that gets destroyed in the first turn via MACC, so that’s why I have one more Destroyed.)

That happens to me too in FE8 so I’d be happy to know what I did wrong! XD
Same thing, I’ve made in Tiled both a “destroyed village” and “closed gates” tiles, but it always triggers the one that destroys the village. Whelp.

Ah, I figured it out.

The Destroyed tile change must come before the Visited tile change. For example, FE8’s Chapter 2 tile changes looks like this (expanded into macro form):

TileMap(0x00,0x03,0x00,0x03,0x03,Destroyed)
TileMap(0x01,0x06,0x00,0x03,0x03,Destroyed)
...etc
TileMap(0x04,0x00,0x04,0x01,0x01,Visited)
TileMap(0x05,0x07,0x02,0x01,0x01,Visited)
...etc
TileMapEnd

By swapping the order of the tile changes for the top left village (IDs 0x00 and 0x04) but keeping everything else the same, that village gets destroyed when you visit, but the others do not.

TileMap(0x00,0x00,0x04,0x01,0x01,Visited)
TileMap(0x01,0x06,0x00,0x03,0x03,Destroyed)
...etc
TileMap(0x04,0x03,0x00,0x03,0x03,Destroyed)
TileMap(0x05,0x07,0x02,0x01,0x01,Visited)
...etc
TileMapEnd

4 Likes

Oh that was counter-intuitive. Thank you! Will try this out this evening.