1. We have added a Gift Upgrades feature that allows you to gift an account upgrade to another member, just in time for the holiday season. You can see the gift option when going to the Account Upgrades screen, or on any user profile screen.
    Dismiss Notice

Dynamic Traits 2016-10-05

Dynamic Traits

  1. Archid
    This is an implementation of the Dynamic Traits mod described by Grey Fox here. The source code was never released and I wanted to try the concept out so I have reverse engineered the dll code from the description of the functionality on the original mod page. Obviously any errors in the dll are purely mine and nothing to do with Grey Fox.

    In implementing the mod I removed all the python (apart from GUI screen changes) and implemented them via new XML files in the dll. This means that there is no requirement for all the buildings, improvements, etc. to be hard coded in various python files.

    For a list of the functionality please read the original mod page as this mod should be the same, all that has changed is the way that it is implemented. I have also included all the show case changes form the original mod so you can compare how they are implemented and see how the new XML files fit together.

    The core difference between the implementations are the TraitTriggerInfo definitions in the new CIV4TraitTriggerInfos.xml file> Each of these contains the definition of a set of changes to the trait counters contained in triggers that are fired by various events in the game. The triggers have a set of prereqs associated with them to determine when they should be fired and the associated trait changes made. The second part of the puzzle is a new enumeration type TraitHookType defined in the GlobalTypes file. This lists all the points where the triggers may be fired from.

    Forum thread is here

    All changes are marked with DynTraits

    There is a documentation folder with a set of html files that detail all the XML file changes and what they do.

    Credits
    =============
    - Grey Fox for the original concept and the XML schema files that I used to work out what the mod was supposed to be doing from

    Revision History
    =============
    0.5 Fixed bug in CvGameTxtMgr where hovering over theflag for a player that had a trait that modified capital yields/commerce would cause a CTD
    Fixed bug in CvPlayer where a trait may not be correctly decremented if both the bFloorZero and bNegative tags were set

    0.4 Added missing trigger data to v0.3 fix
    Added religion type as trigger Prereq for the Change Religion hook

    0.3 Fixed bug in CvUnit where owner of a unit killed was not passed as an argument

    0.2 Fixed bug in CvGlobals where incorrect loop counter used

    0.1 Initial Release