Locking buildings for AI

Post Reply
User avatar
ParaworldFan
- SEAS -
- SEAS -
Posts: 482
Joined: Tue Nov 26, 2019 19:36 pm
Location: Russia, Surgut

Locking buildings for AI

Post by ParaworldFan »

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.
User avatar
AnthonyCole
- Admin -
Posts: 2134
Joined: Sat Apr 18, 2009 13:17 pm

Re: Locking buildings for AI

Post by AnthonyCole »

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...
User avatar
ParaworldFan
- SEAS -
- SEAS -
Posts: 482
Joined: Tue Nov 26, 2019 19:36 pm
Location: Russia, Surgut

Re: Locking buildings for AI

Post by ParaworldFan »

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...
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…
User avatar
AnthonyCole
- Admin -
Posts: 2134
Joined: Sat Apr 18, 2009 13:17 pm

Re: Locking buildings for AI

Post by AnthonyCole »

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.
User avatar
ParaworldFan
- SEAS -
- SEAS -
Posts: 482
Joined: Tue Nov 26, 2019 19:36 pm
Location: Russia, Surgut

Re: Locking buildings for AI

Post by ParaworldFan »

AnthonyCole 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.
I am not good in .USL files. Its darkness for me
Post Reply

Return to “English”