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

My take on developing traits

Discussion in 'C2C mod mods' started by darkkhon, Jun 3, 2016.

  1. Thunderbrd

    Thunderbrd C2C War Dog

    Joined:
    Jan 2, 2010
    Messages:
    24,738
    Gender:
    Male
    Location:
    Las Vegas
    bBansNonStateReligions

    I believe it keeps non-state religions from spreading inside the nation. There could be other effects. Should just be <bBansNonStateReligions>1</bBansNonStateReligions> to turn it on as it is a boolean (you can tell because it starts with 'b' in the name.)

    Code:
    	<ElementType name="bDisallowed" content="textOnly" dt:type="boolean"/>
    	<ElementType name="DisallowedTraitType" content="eltOnly">
    		<element type="TraitType"/>
    		<element type="bDisallowed"/>
    	</ElementType>
    	<ElementType name="DisallowedTraitTypes" content="eltOnly">
    		<element type="DisallowedTraitType" minOccurs="0" maxOccurs="*"/>
    	</ElementType> 
    Basically the above schema declares the syntax to be as such:
    Code:
    <DisallowedTraitTypes>
    	<DisallowedTraitType>
    		<TraitType>TRAIT_WHATEVER</TraitType>
    		<bDisallowed>1</bDisallowed>
    	</DisallowedTraitType>
    </DisallowedTraitTypes>
    or if you are wanting to include multiple disallowed types:
    Code:
    <DisallowedTraitTypes>
    	<DisallowedTraitType>
    		<TraitType>TRAIT_WHATEVER</TraitType>
    		<bDisallowed>1</bDisallowed>
    	</DisallowedTraitType>
    	<DisallowedTraitType>
    		<TraitType>TRAIT_WHATEVER2</TraitType>
    		<bDisallowed>1</bDisallowed>
    	</DisallowedTraitType>
    </DisallowedTraitTypes>
    See if you can figure out how that works and why. It's sometimes harder to explain than to let someone figure it out for themselves.

    What this should do is make it so that if you've selected the specified trait(s), you cannot thereafter select this trait.

    If they aren't working for some reason let me know. Was a while ago I programmed these and I was still learning from a lot of mistakes when I did.
     
  2. darkkhon

    darkkhon Chieftain

    Joined:
    Oct 2, 2010
    Messages:
    31
    After some initial tinkering it seems that DisallowedTraitTypes is working,although the civilopedia does not display any info regarding this at the initial load game,however it does display it after you choose a disallowed trait.
    As for the bBansNonStateReligions there is no civilopedia display of any kind,it might be working but it will require a lot more investigation and more difficult to pin down if its actually working.
     
  3. Dancing Hoskuld

    Dancing Hoskuld Chieftain

    Joined:
    Jul 5, 2004
    Messages:
    22,870
    Gender:
    Male
    Location:
    Canberra, Australia
    The pedia is behind on many of the things added to C2C. There needs to be work on deciding what is needed where and then ensuring that the python can get at it from the dll.
     
  4. Thunderbrd

    Thunderbrd C2C War Dog

    Joined:
    Jan 2, 2010
    Messages:
    24,738
    Gender:
    Male
    Location:
    Las Vegas
    Ok. I'm going to port this statement over to the bugs and crashes thread so as to put these issues on the debug queue.
     
  5. darkkhon

    darkkhon Chieftain

    Joined:
    Oct 2, 2010
    Messages:
    31
    @TB

    Quick question regarding this tag

    <TechResearchModifiers>
    <TechResearchModifier>
    <TechType>TECH_WHATEVER</TechType>
    <iModifier>50</iModifier>
    </TechResearchModifier>
    </TechResearchModifiers>

    Is 50 a flat modifier or a percentage?Civilopedia displays it as being a flat modifier and I find it strange,or is just a display issue?.If indeed is a flat modifier can you change it to a percentage modifier? when you have time of course.
     
  6. Thunderbrd

    Thunderbrd C2C War Dog

    Joined:
    Jan 2, 2010
    Messages:
    24,738
    Gender:
    Male
    Location:
    Las Vegas
    Modifiers should be a percentage so it should be %. It's a simple display text issue that's easy to resolve once I identify what the text key is. What does it say, specifically? That will help me quickly zap it.
     
  7. darkkhon

    darkkhon Chieftain

    Joined:
    Oct 2, 2010
    Messages:
    31
    Actual text display "Researches the tech +50 faster".

    I know what to modify now that I know it's just a display issue. It has the same problem as the iBonusPopulationinNewCities tag-only there it's backwards,it displays a percentage rather than a flat as it should(already tested it in game).
     
  8. Thunderbrd

    Thunderbrd C2C War Dog

    Joined:
    Jan 2, 2010
    Messages:
    24,738
    Gender:
    Male
    Location:
    Las Vegas
  9. darkkhon

    darkkhon Chieftain

    Joined:
    Oct 2, 2010
    Messages:
    31
    Updated first post. V 1.2 is now available.
     
  10. Thunderbrd

    Thunderbrd C2C War Dog

    Joined:
    Jan 2, 2010
    Messages:
    24,738
    Gender:
    Male
    Location:
    Las Vegas
    Keep going with this. I think it may become a valid option set at some point. Probably worthy of it already.
     
  11. darkkhon

    darkkhon Chieftain

    Joined:
    Oct 2, 2010
    Messages:
    31
    The next major thing I plan for the next version is to make it a fully fledged option,not just to overwrite the existing trait file.
     
  12. Thunderbrd

    Thunderbrd C2C War Dog

    Joined:
    Jan 2, 2010
    Messages:
    24,738
    Gender:
    Male
    Location:
    Las Vegas
    Once done that would make it easy for me to test and commit if i feel its ready for core as an option.
     
  13. darkkhon

    darkkhon Chieftain

    Joined:
    Oct 2, 2010
    Messages:
    31
    Updated first post to v 1.3

    There is a civilopedia display issue that goes away once a game is started with the new option on.I was unable to fix it :(
     
  14. Dancing Hoskuld

    Dancing Hoskuld Chieftain

    Joined:
    Jul 5, 2004
    Messages:
    22,870
    Gender:
    Male
    Location:
    Canberra, Australia
    Everything is loaded before you get to the options so the pedia is always wrong the first time round. It takes getting out and loading to get the right information.
     
  15. majaczek

    majaczek Chieftain

    Joined:
    Feb 12, 2013
    Messages:
    282
    Last edited: Jul 29, 2017
  16. Dancing Hoskuld

    Dancing Hoskuld Chieftain

    Joined:
    Jul 5, 2004
    Messages:
    22,870
    Gender:
    Male
    Location:
    Canberra, Australia
    It is not really a bug. The XML is all loaded using the information it has which is the game options from the last game. If you are playing a new game it then asks you for the options you want in this game which may be different but the XML that controls what you will see in the pedia has already been loaded so your new selections may not show up correctly. Saving the game exiting the game and then start with the save will fix it. There was not as much thought given to how and when the XML is loaded as could have been but it has shown up more as modders have added in tags that turn XML things on and off depending on the options chosen.

    Basically the XML is loaded based on the game options in your last session before you get the chance to set the game options in this session. To fix it the game would need to
    1. remember a list of the game options before it loads the XML
    2. load the XML based on this set
    3. if a new game is selected
      1. if any options change
      2. reload all the XML based on those game options
      3. may need to reset some Python
    The pedia would then only be wrong after step 2 and before the new game starts.
     
    Harrier likes this.
  17. Harrier

    Harrier Chieftain

    Joined:
    Feb 19, 2002
    Messages:
    2,345
    Location:
    UK
    Interesting. To try to understand :). When starting a new (same version not updated) game with different options. Once the game is loaded and before playing - save the game and reload, to get the new XML options. Is that right?

    Does deleting the (initially difficult to find) Cache folder (with all the.DAT files) negate this?

    .
     
  18. Dancing Hoskuld

    Dancing Hoskuld Chieftain

    Joined:
    Jul 5, 2004
    Messages:
    22,870
    Gender:
    Male
    Location:
    Canberra, Australia
    It is all because of the GameOptions tags on units, buildings, everything really. The options are stored as a string of 1s and 0s in the Civilization ini. Deleting the cache will have no affect but changing that string to all 0s will do something.

    The problem is that there are two types of tags one which says "only if this option is on" and "not if this option is on". The state of the memory of the XML before you set up the options is based on the options you came in with. If you change the options then that memory XML will be wrong.

    Therefore if you change options you probably should save the game as soon as you start then exit Civ before starting again.
     
  19. majaczek

    majaczek Chieftain

    Joined:
    Feb 12, 2013
    Messages:
    282
    Last edited: Jul 30, 2017
  20. darkkhon

    darkkhon Chieftain

    Joined:
    Oct 2, 2010
    Messages:
    31

Share This Page