Skip to content
#3773
Auto-translated
}{0TT@6bI4
It definitely doesn't find anything using "BUILDING_GARRISON"?

Yes, unfortunately... Neither BUILDING_GARRISON nor BUILDING in general. I decided to test this on one of the maps where the bot owns mines, houses, and garrisons. I used BUILDING to get an array of the bot's possessions and then used SetObjectOwner, and the owner of all the bot's buildings, except for the garrisons, changed. Even the garrisons that have names are not tracked.



Added 8 hours 26 minutes ago
I wrote a small script for myself:
function NoFlee( n1, n2, n3, n4, n5, n6, n7, n8, n9, n10, n11, n12, n13, n14, n15, n16, n17, n18, n19, n20 )
heroeslist = { n1, n2, n3, n4, n5, n6, n7, n8, n9, n10, n11, n12, n13, n14, n15, n16, n17, n18, n19, n20 }
for key, heroes in heroeslist do
if IsObjectExists( heroes ) ~= nil then
DenyAIHeroFlee( heroes, 1 )
print("Hero ", heroes, " will no longer leave battles until he dies")
end
end
end

It all works, but the console constantly complains about an incorrect first argument in IsObjectExists, which occurs because of the unfilled arguments. Is it possible to rewrite the script or add something so that the array is filled only with filled arguments? Or rewrite it so that the console doesn't complain about empty arguments.

Statistics

Welcome our newest member: dodoD0D0

Users Online 2 users 1370 guests