I ve got a new task and I am open for advises on how to realise that:
Task - we have a building owned by AI, it will become invert able after its HP reaches critical, and it should stay for the certain moment with its HP which it had while it become inveruable. Problem, that the ai is going and repairing this buildings. Question, how to force ai to not repair this building.
Next task - if the needing building is a tower, than I need to make it ignore all enemies around itself. Ideas?
Third task - if the building is animal farm or other production building except stone cottages or warehouses or food production, how to prevent ai using inveruable farm to train units in it?
Would be very thankful for all possible ideas for MIRAGE.
Locking buildings for AI
- ParaworldFan
- - SEAS -
- Posts: 482
- Joined: Tue Nov 26, 2019 19:36 pm
- Location: Russia, Surgut
- AnthonyCole
- - Admin -
- Posts: 2134
- Joined: Sat Apr 18, 2009 13:17 pm
Re: Locking buildings for AI
Is this for a mission? You can give the building to another player with the same name & color as the supposed owner. Then it will look like the building is part of the settlement, but won't be repaired, won't attack (depends on diplomacy), won't produce...
I've never seen code like this.
CEP Moddb | CEP download
ParaWelt TicTacToe | Multiplayer TicTacToe/Connect four/etc
CEP Moddb | CEP download
ParaWelt TicTacToe | Multiplayer TicTacToe/Connect four/etc
- ParaworldFan
- - SEAS -
- Posts: 482
- Joined: Tue Nov 26, 2019 19:36 pm
- Location: Russia, Surgut
Re: Locking buildings for AI
Yes, this for my multicampaign project and singleplayer remastered project also. Good advice, though too much need to add for a few buildings, a whole player, plus it’s impossible to do for maps where all players already taken, like mission 13. So, I would like to know more ways…AnthonyCole wrote: ↑Sun Jul 25, 2021 15:24 pm Is this for a mission? You can give the building to another player with the same name & color as the supposed owner. Then it will look like the building is part of the settlement, but won't be repaired, won't attack (depends on diplomacy), won't produce...
- AnthonyCole
- - Admin -
- Posts: 2134
- Joined: Sat Apr 18, 2009 13:17 pm
Re: Locking buildings for AI
There is a possibility to "lock" unit objects for the AI. It may be possible to lock buildings in this way too, but you would have to check/modify the code for this. Check the code where the AI searched for a building to be repaired or to produce units from, and if there already is a way to let it ignore certain objects.
I've never seen code like this.
CEP Moddb | CEP download
ParaWelt TicTacToe | Multiplayer TicTacToe/Connect four/etc
CEP Moddb | CEP download
ParaWelt TicTacToe | Multiplayer TicTacToe/Connect four/etc
- ParaworldFan
- - SEAS -
- Posts: 482
- Joined: Tue Nov 26, 2019 19:36 pm
- Location: Russia, Surgut
Re: Locking buildings for AI
I am not good in .USL files. Its darkness for meAnthonyCole wrote: ↑Wed Jul 28, 2021 19:59 pm There is a possibility to "lock" unit objects for the AI. It may be possible to lock buildings in this way too, but you would have to check/modify the code for this. Check the code where the AI searched for a building to be repaired or to produce units from, and if there already is a way to let it ignore certain objects.