1. We have added the ability to collapse/expand forum categories and widgets on forum home.
    Dismiss Notice
  2. Photobucket has changed its policy concerning hotlinking images and now requires an account with a $399.00 annual fee to allow hotlink. More information is available at: this link.
    Dismiss Notice
  3. All Civ avatars are brought back and available for selection in the Avatar Gallery! There are 945 avatars total.
    Dismiss Notice
  4. To make the site more secure, we have installed SSL certificates and enabled HTTPS for both the main site and forums.
    Dismiss Notice
  5. Civ6 is released! Order now! (Amazon US | Amazon UK | Amazon CA | Amazon DE | Amazon FR)
    Dismiss Notice
  6. Dismiss Notice
  7. Forum account upgrades are available for ad-free browsing.
    Dismiss Notice

AI doesn't build added buildings?

Discussion in 'Civ 4 - K-Mod: Far Beyond the Sword' started by fyermind, Mar 15, 2017.

Tags:
  1. fyermind

    fyermind Chieftain

    Joined:
    Apr 26, 2008
    Messages:
    93
    I've been merging K-Mod 1.44b with Gods of Old and I've come into a strange set of problems. It seems that the Python Callbacks don't get called (even with callback values in the XML set to 1), and the AI doesn't seem to build newly added buildings such as the shrines.

    This seems to be true for any mods I'm doing to K-Mod, so I don't think I broke something by adding Gods of Old files.

    Is this a known issue? Is there a solution?
     
  2. Zholef

    Zholef Chieftain

    Joined:
    Feb 20, 2014
    Messages:
    178
    K-Mod blocks a number of python callbacks by default. You can unblock whichever ones you need in "Assets/xml/PythonCallbackDefines.xml".

    EDIT: Never mind, that's probably the "XML" you're referring to.
     
    Last edited: Mar 15, 2017
  3. Zholef

    Zholef Chieftain

    Joined:
    Feb 20, 2014
    Messages:
    178
    Here, I've compiled the DLL with the K-Mod-introduced callback blocks disabled. See if it works with that.
     

    Attached Files:

  4. fyermind

    fyermind Chieftain

    Joined:
    Apr 26, 2008
    Messages:
    93
    Thank you! It seems to be an issue with iValue for new buildings as buildings that found a religion using python don't appear to have any use to the AI at the c++ level. It looks like I need to figure out how to hack the AIs production queue to add these in the appropriate place or change lots of things so that it realizes the buildings found religions and that religions are significantly more powerful.

    Is there a visual flowchart anyone has compiled for how the AI makes build/tech decisions?
     
  5. Leoreth

    Leoreth Knight of Time Moderator

    Joined:
    Aug 23, 2009
    Messages:
    28,483
    Gender:
    Male
    Location:
    Land of Heat and Clockwork
    You should consider the iAIWeight value in the building XML, or use additional Python callbacks for building value calculation if you need something more involved.
     
  6. fyermind

    fyermind Chieftain

    Joined:
    Apr 26, 2008
    Messages:
    93
    Those aren't seeming to work. I'm not sure why the iAIWeight value doesn't do the thing, but it seems not to. It may be that the buildings are being invalidated from the start because I did something else wrong, I'm unsure. The human can build them just fine.
     
  7. Leoreth

    Leoreth Knight of Time Moderator

    Joined:
    Aug 23, 2009
    Messages:
    28,483
    Gender:
    Male
    Location:
    Land of Heat and Clockwork
    I suggest you try to debug the DLL / add some logging to see if the code actually reaches the value calculation.
     
  8. DarkLunaPhantom

    DarkLunaPhantom Chieftain

    Joined:
    Feb 4, 2013
    Messages:
    276
    iAIWeight should work (K-Mod will "interpret" it as additional value equivalent to iAIWeight/4 commerce per turn). But I think that the problem is that those building probably have positive iReligionChange for their religion, but the AI will never build such building if they don't own that religion's holy city. That works ok for K-Mod, but obviously not for a mod where building the shrine founds religion.

    This can be fixed if you're able to edit the sourcecode and recompile the DLL; or if you're ok with shrines not making the religions more likely to spread (by setting iReligionChange to 0).
     
    Last edited: Apr 21, 2017
  9. fyermind

    fyermind Chieftain

    Joined:
    Apr 26, 2008
    Messages:
    93
    @DarkLunarPhanto You are exactly right! Thank you so much. Months of confusion has been solved. I have already split the shrines from the foundations, I just didn't remove spreading from the foundations. I removed that and everything works perfectly!

    Now I just need to estimate the value of a holy city in commerce and add the appropriate flavors so Montezuma favors the religion of war and Surry favors the religion of life etc.
     
    DarkLunaPhantom likes this.

Share This Page