Comment 9 for bug 1770901

Revision history for this message
hessenfarmer (stephan-lutz) wrote :

> You could place it manually in the starting condition. But of course there will be no 'action' > (e.g. no wares get transported).

The Mission Thread script tries to do exactly this when the Player has discovered the territory of the monastery. But as Player 3 isn't initialized, you can't place buildings for player 3. Placing them for player 1 would be no solution as you can't conquer the monastery. Placing them for Player 2 would lead to the same results as seen in this bug.

> Such a loop may result a 'scripting vs. AI battle' where the ai removes the building, the > script places a building and the ai removes it again... and so on.

As this happens only occasionally the chance of having to replace it would be very low. After reinstating the building this is a new entity for the AI so it does take time to gather enough "uselessness" points for the new building to get dismantled again. At least this is my understanding of the AI mechanisms.

> I think the better solution would be to check if the immovable is NIL before trying to remove it.

Problem is that after removal exactly the same buildings will be placed on the map again. But this time for player 1. So suddenly there will exist a building that has been dismantled or destroyed before. This replacement was done to reflect the story that the monastery has switched to the side of the player.
If the loop wont't work or perhaps as alternative solution I could Try to play around with the team property but I am afraid this won't work properly.