Next War + BBATAI

Hey man, the code is being read by the game, however it gives error on function and hence, it doesn't work. "Error in cityLost event handler <function onCityLost at 0x1EA4F070>" The rest doesn't seem to work either (tried arcology and you can build older ones if you have newer ones.

I checked if the code works in Next War and it is veeeeery iffy. In short, build 3 cities with arcology and raze them, after which 2 won't have the ruins but 1 will (that's not a feature as I can tell from the code). Reinstalled the game just to check this.
 
If you turn logging on you will get python errors reported in PythonErr.log. Once an error is found the rest of the code is ignored.

The XML error I am getting must be something to do with the way I installed Better BAT AI or the way I am running it.

D'o it is because I don't have the rest of the NextWar stuff:lol:
 
Try this. I have merged the game utils code in with the other code. This should fix the XML error in the config file. You no longer need the NextWar_GU.py file.
 
There is a problem in the XML for the definition of the city ruins with arcology - it is missing:lol: Attached is the fix. I am still testing the Python but the missing definition would cause the problem encountered.
 

Attachments

  • CIV4ArtDefines_Improvement.7z
    1.4 KB · Views: 82
Thanks a lot man, I will test it when I get back and post back.

Tried, doesn't work. the ruins don't appear, and one arcology doesn't limit building the previous one. Tried with 20 cities or so just in case it was as random as it was in Next War.
 
I just realised that The Next War stuff uses ScriptData. If Better BUG AI also uses ScriptData more work is needed to ensure the same style is used etc.
 
I have found my mistake in the python that was causing the arcology ruins not to appear.

I have also found replacements for the ScriptData. I expect Next War was developed originally for an earlier version of Civ IV as the things stored in the script data are all available via normal BtS python code.

I need to test all these things, which would work best with the scenarios but I am not sure how to convert them to this mod.

By the way what are you calling the mod as the mod name is hard coded in a couple of places?

I have also figured out how to get rid of some of the hard coded paths. I am surprised that Better BUG AI did not get rid of one of them. Maybe I should give them the code and suggest they incorporate it in their next release.
 
I need to test all these things, which would work best with the scenarios but I am not sure how to convert them to this mod.

If by scenarios you mean scenarios, don't bother really. Is it really necessarry?

By the way what are you calling the mod as the mod name is hard coded in a couple of places?

Honestly, I think you should name it what ever you want. You did all the work :bowdown:

Thank you for everything, cannot wait to try it, as I am sure many others.
 
If by scenarios you mean scenarios, don't bother really. Is it really necessarry?

Much of the python is about the scenario. The different starting screen and the "everyone lost" screen as well as the Nuke Countdown. Even some of the resource depletion only makes sense in the scenario. Otherwise why would bananas or other plant/animals deplete?
 
Well, so long as it will be easy to edit (change the number of chance or comment out the line, or it happening in scenario altogether so that it will work in regular game) why not.

Really, the only things that are needed

Events
Resource depletion (currently in code its limited by scenario although that line was commented out iirc in original, if you can delete that limitation or make it an optional by tick boxes, or even possibility of simply commenting out the line in script file) it would be great
Shielding limitations (cannot build two and each replaces the other)
Different ruins if shielding was in the city.
 
The Depletion is working and I have one more test to prove the city ruins are correct.

Can you explain exactly what is supposed to happen with the Arcology and shielding? I am a bit confused by what is being done as I think it can all be done in the XML.
 
upon being built, the previous version of the building is removed and is also removed from the list of available buildings.so you have shielding, arc shielding and deflector shielding. if you have arc shielding, you will never be able to build shielding. if you build deflector shielding, you can never build any kind of other shielding. the removing is done so that the graphics dont look silly (3 shield walls) and that bonuses didn't stack.
 
upon being built, the previous version of the building is removed and is also removed from the list of available buildings.so you have shielding, arc shielding and deflector shielding. if you have arc shielding, you will never be able to build shielding. if you build deflector shielding, you can never build any kind of other shielding. the removing is done so that the graphics dont look silly (3 shield walls) and that bonuses didn't stack.

That is what I thought. It would be better done with individual buildings that require the previous and stack bonuses but have no graphics and the graphics associated with an unbuildable set of buildings which are shown as needed ie solving it as the two problems it is rather than as a single problem which requires slow python call backs.
 
but the graphics for each building are slightly different, how can you make them appear as necessary through xml?

plus what happens to buildings that have a required building destroyed through capture, do they get destroyed as well?
 
There are three graphics which don't look good with each other
- arcology
- arcology shielding
- deflector shielding​

We remove the graphics from the building and have a set of graphical only buildings that have the graphics. We also split out the benefits of the buildings so that they accumulate. This makes these buildings simple to define with no need to remove or add them in python as they are now just normal buildings. This gets rid of the call to cannotConstruct() which is called for every building before adding it to the queues, slowing things down a lot.

Then in the python we add some processes that capture the building of them and in that code add or remove the graphical only building that provides the graphics to the city. This is done in the onBuildingBuilt which we already use.
 
If you can remove the graphics only on built, that cool.

Now, say arcology gives 3 happines and health, arc shielding gives 3 happiness and 2 health.

After your modification we change that arc shielding will provide only 1 health as bonuses acumulate.

However, if during capture arcology is destroyed, we are left with only arc shielding, which will give 1 health whereas it should give all the bonuses. I doubt its possible to tie them in xml that if one is destroyed, all are destroyed. This is another reason why it was done in python i think.

Do you think this can be achieved with something like oncapture script or onbuilding destroyed, or are those scripts heavy as well?
 
If you can remove the graphics only on built, that cool.

Now, say arcology gives 3 happines and health, arc shielding gives 3 happiness and 2 health.

After your modification we change that arc shielding will provide only 1 health as bonuses acumulate.

However, if during capture arcology is destroyed, we are left with only arc shielding, which will give 1 health whereas it should give all the bonuses. I doubt its possible to tie them in xml that if one is destroyed, all are destroyed. This is another reason why it was done in python i think.

Do you think this can be achieved with something like oncapture script or onbuilding destroyed, or are those scripts heavy as well?

There is no python for buildings being destroyed as far as I can see and there is the problem.
 
What currently happens is that as you build each building the others are removed. This means you can only loose that building but it also means you have to build them all again.

IE If you have built the Arcology and then build Arcology Shielding when it is complete the Arcology is removed leaving you with just the Arcology Shielding in the city. Thus you can only loose that building, due to bombing or espionage for example, but when you do you don't get the Arcology back because there is no way to capture the loss of a building in Python.

I am going to see what was done in C2C...
 
Something tells me the C2C wouldn't bother so much over something so small, but I hope I am wrong
 
Something tells me the C2C wouldn't bother so much over something so small, but I hope I am wrong

It uses the Next War code almost exactly and they don't need to any more because that sort of thing can be done via the XML as it has been included in the dll. They also reuse the graphics for moon and space colonies.

Thinking on it I may leave it almost as is, just improve the efficiency of the cannotConstruct by placing the requirement for the buildings in the XML and only testing for the Arcology in there. By making the first shielding require the arcology in the city to be built we don't need to test for it as the arcology wont be able to exist after the first shielding is built.
 
Top Bottom