IIRC GetNumRealBuilding returns the number constructed, GetNumFreeBuilding returns the number gifted and GetNumBuilding returns the sum of those two.
So your code is behaving as expected, you're just using the wrong method
IIRC the problem is not with the AI wanting to build anti-air units, but with the AI building anti-air units as offensive/defensive land units because the "unit power" maths is broken and makes them look like super-powerful general-purpose units.
EDIT: This is my original spreadsheet.
Col A is...
The anti-air spam is due to some dodgy maths in the (unmodded) DLL that applies promotion bonuses to all forms of attack and not just to those limited by the domain (so the AA guns are being boosted up the list of good land units to build because of their bonuses against air units). From the...
The XML code given above sets all values TO 1 while the SQL SUBTRACTS 1 from the current value
SQL
Before After
3 --> 2
2 --> 1
1 --> 0
XML
Before After
3 --> 1
2 --> 1
1 --> 1
To do the same with XML you'd need multiple updates with an extra Where parameter
Where Yield=1, Set Yield=0
Where...
Short answer, that code is trying to ADD a new entry with ID=0, which is already in the database so will generate an error (see the link in my sig for enabling the error logs).
What you need to do is UPDATE the existing entry. There are several tutorials on the XML you need to do that.
It's a DLL fix and you won't find any of those for vanilla, as almost every modder move to BNW
https://www.picknmixmods.com/mods/CivV/Global/Units%20Awake%20In%20Danger.html
My "minor civs" do you mean City States? There is code in the DLL for city states that makes them always raise a captured city if it would take their happiness below 0 - which is most of the time as they tend not to build happiness buildings. A City State with multiple cities is almost...
Welcome back to the Land of Rust!
Didn't check the code (too much rust myself to be able to just scan it any longer)
pCity:IsCapital(), pCity:IsOriginalCapital() and pCity:IsOriginalMajorCapital() are the methods you're interested in (not so much rust that I can't find my spreadsheets!)
W
Correct, apart from bug fixes (science overflow and many others), all game play changes are disabled without the corresponding mod that turns them on
Most mods are XML/SQL (database) and LUA (UI/Logic) and are "swappable" (enabled/disabled). The problem is that for DLL (C++) mods you can only...
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.