You must be logged in to post messages.
Please login or register

AI & RM Scripting
Moderated by Sebastien, Leif Ericson

Hop to:    
Welcome! You are not logged in. Please Login or Register.1 reply
Age of Kings Heaven » Forums » AI & RM Scripting » How to make an AI repair his damaged buildings?
Bottom
Topic Subject:How to make an AI repair his damaged buildings?
Serchant92
Squire
posted 12-16-19 05:54 AM CT (US)         
I think sn-object-repair-level is used for repairing units/buildings but i dont know which numbers make sure that the AI repairs buildings.

So far ive managed the AI to repair his siege towers but not his buildings, how do i do that?
AuthorReplies:
Promiskuitiv
Squire
posted 12-20-19 04:30 PM CT (US)     1 / 1       
Hello Serchant92, yes that is the correct strategic number.

Here is the description: "Add bit flags together to generate a value: 0 = wonder; 1 = castle, monastery; 2 = town-center; 4 = barracks; 8 = archery-range; 16 = stable; 32 = siege-workshop; 64 = dock; 128 = market; 256 = university; 512 = blacksmith; 1024 = lumber-camp, mining-camp, mill; 2048 = house; 4096 = towers; 8192 = walls and gates; 16384 = siege weapons. For scenarios and campaigns, the default is 1 for compatibility." (Source)

That means if you set it to a value of 64 that the AI will only repair wonders and docks, if you add 2 for town-centers and 1 for castles for a total value of 67 then it will also repair those buildings. Just add together what you need, verify the calculation once more and you should be good.

Be aware that buildings that have recently been under attacked will not be assigned a repairer immediately, there is a time window that a building has to have been "safe" before a new repairer will be sent.

Creator of Promi.
Any feedback is greatly appreciated.
You must be logged in to post messages.
Please login or register

Hop to:    

Age of Kings Heaven | HeavenGames