I think this operation may be available in all script hooks where you can get a pointer to a tile via
BattleGame.getTile.
As for the general algorithm for handling this function, I came up with the following (at least for the story I want to implement):
1. On the map block, you specify where a special spawner item will be located (using the
spawnUnit parameter), which will create a special tech unit instead when the map is created.
2. When this technical unit is created, the script hook
createUnit is triggered. Here the current coordinates of this unit are written to the global tags of the battle game via
BattleGame.setTag. After that it is forcibly destroyed, so that there is no corpse in its place.
3. Now the script hook
newTurnUnit checks the current turn and its correspondence to the planned scenario. If it does, the “transforming” of the tiles takes place:
3.1. Based on the previously specified global tags of the game, which contain the coordinates of the technical unit, using the operation
BattleGame.getTile the necessary tiles are selected and then this new function of converting them into “dead” variants is used.
3.2. In another global tag it is written that the tile changes have taken place and when moving to the next unit in the
newTurnUnit all these tile conversions do not need to be performed.
4. Further, after a few more game turns, according to the idea of the scenario, this script again performs the transformation of tiles into their “dead” versions.
5. To make the transformations between tiles look more correct I came up with the idea of looping their dead versions on each other: tile1 has tile2 as its dead version, and tile2 has tile1 as its dead version. This way, from the player's point of view, the structure of these tiles is indestructible, which is what I need in my scenario.
As for the name of the operation - make it as convenient and clear as you like. It is important for me that this function works, and how it is called is not important