Modmodding Q&A Thread

Do you know how I could access a specific version of con.iArtillery, so I make sure I am picking the tech info rather than the unit info? I am not very knowledgeable with how Python communicates with the XML. So if I were to, say, rename iArtillery to iArtilleryTech on RiseAndFall.py and Consts.py, would I need to change TECH_ARTILLERY to TECH_ARTILLERY_TECH on Civ4TechInfos.xml? Or is there another better workaround than renaming?

Changing iArtillery to iArtilleryTech should do the job.

iArtillery is just an integer. (82 for the tech) setHasTech(iArtillery, True, iCiv, False, False) gives the 82nd tech defined in the XML to iCiv.
 
Yes, that should be fixed. Funny that this problem has never surfaced before.
 
How would you have a newly spawned civ "flip" its capital rather than destroy whatever city is on tCapitals plot and than its found its capital? Similar to the way Mexico flips Mexico City.
 
You need to add them to the lConditionalSpawns list in the initBirth method in RiseAndFall.py.
 
:goodjob:
 
Quick question. Since I am adapting the 1700 AD Python code to 1900 AD, it means there are some civs that would have spawned in 1700 AD that should start already present in 1900. When adding these civs to the map, they do not seem to integrate with the dynamic civ names. For instance, these are the names that show up, despite them having all up-to-date techs and civics set to industrial era civics:

American Peoples
Lombard Peoples
Mexica Peoples
Brazilian Peoples
Andean Peoples
Maya Peoples
Argentine Peoples

Where in the code do I need to update to specify that these civs are not expected to spawn in the scenario but should start out with the correct names and leaders from the start?
 
I would simply set the correct leader in the scenario file.

For the names themselves (assuming you are on v1.13.0), go to the setup method in DynamicCivs.py and replicate what is there for the 1700 AD scenario.
 
Soooooo I more or less merged my modmod with the current Git version. What I did was download the current state of DoC as zip archive and unpacked it as its own mod. Then I copied all files I changed (exclusively XML plus the art assets for my police unit) and let them overwrite the downloaded folder, followed by renaming it, editing the .ini and scenarios to get it to run.

Then I started the thing, skimmed trough the Civilopedia and saw that everything was as it should be, and decided to try a test game as Rome, partly to see if the accursed city of Carthage would now be where it ought to. Weeeelllllll... the good news is that Carthage really was in position (while you still have to go to the Gulag for your many crimes this does qualify you for doubled rations on Taco Tuesdays), but my starting units... I had four Jaguars and three Skirmishers instead of Legions and Archers. :crazyeye: How did that happen? After giving myself Archery with Worldbuilder (cool new thing btw, you shall be given double rations on Soup Saturdays as well) and looking in the city screen and around the world it seems this doesn't affect what you can build in cities, there I had the usual list of Archers, Warriors, Axes, Spears, Legions (the last three greyed out because no metal), only starting units. (AI Carthage also had a Skirmisher or two)

I then started some more games to see what starting units this or that civ would get, and the results are as follows:

Egypt - Warrior (everything in order)
Greece - Axes instead of Phalanxes
Persia - Skirmishers instead of Archers and Impis instead of Immortals
Arabs (600AD) - Skirmisher instead of Archer, but Camel Archers as ussual; playing a few turns with Arabia and giving myself Explorers around the world revealed Viking Patiyodhas, Aucacs and Legions, Tibetan Aucacs, Skirmishers and Numidian Cavalry, Korean Legions, Skirmishers and one regular Archer for some reason, China with Skirmishers, regular Spears and regular Archers, and Japan with Samurais, Cho-Ko-Nus, Skirmishers, Aucacs, and one regular Archer.
France (1700AD) - Redcoats and Conquistadors in Paris, oh my! All other cities of mine have rifle garrisons though.

Well... something somewhere obviously went wrong. :lol: Could it be that the three new units I added messed up the numbering the game uses to assign each civ its starting units or something? I don't see any misplaced unique buildings in France for example, Notre Dame and Versailles are where they should be, in fact absolutely everything seems to be working fine, with the exception that most starting units are unique units of a different civ than the one they belong to. :crazyeye:

So, erm, Christmas miracle?
 
You have to adjust the unit constants in Consts.py to reflect the new units you have added.
 
Why is that problem only surfacing now with the Git version then and not back when I added the units originally when DoK was based on the 1.13 release version?
 
It wouldn't.
 
But that should be reflected in the constants from the original mod? Unless the Python file has just been plain overwritten, which is of course a bad idea in any case.
 
Unless the Python file has just been plain overwritten, which is of course a bad idea in any case.

By me or this sgtBears? :confused:
 
Anyway I changed iNumUnits to 166 and overwrote the list of units (the content of the brackets between iNumUnits = 163/166 and = range(iNumUnits) with the 1.13.0 version, while adding iHeavyHorseman, iModernInfantry and iPolice at the end just to make sure. Rolling a Greek start gave me Phalanxes as it should, so I suppose this issue should be resolved now.
 
Yeah that's exactly how it works.
 
No, that was confirmation that what you did was how it works.
 
For some reason Jerusalem keeps building the Temple of Kukulkan instead of the Temple of Solomon in my modmod. I assume more Python reordering shenanigans because this is scripted? I neither added nor removed any buildings, so why would that happen?
 
Back
Top Bottom