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

Extending the generic property system

Discussion in 'Civ4 - Caveman 2 Cosmos' started by AIAndy, Jan 20, 2012.

  1. Hydromancerx

    Hydromancerx C2C Modder

    Joined:
    Feb 27, 2008
    Messages:
    16,281
    Location:
    California, USA
    Here is an example of a modular piece of code.

    Code:
    	<BuildingInfo>
    		<BuildingClass>BUILDINGCLASS_POLLUTION_SMOG1</BuildingClass>
    		<Type>BUILDING_POLLUTION_SMOG1</Type>
    			<PropertyManipulators>
    			  <PropertySource>
    			    <PropertySourceType>PROPERTYSOURCE_CONSTANT</PropertySourceType>
    			    <PropertyType>PROPERTY_TOURISM</PropertyType>
    			    <iAmountPerTurn>-1</iAmountPerTurn>
    			  </PropertySource>
    			</PropertyManipulators>
    		</BuildingInfo>
    And then here is the part of the code from the original building.

    Code:
    			<PropertyManipulators>
    			  <PropertySource>
    			    <PropertySourceType>PROPERTYSOURCE_CONSTANT</PropertySourceType>
    			    <PropertyType>PROPERTY_DISEASE</PropertyType>
    			    <iAmountPerTurn>5</iAmountPerTurn>
    			  </PropertySource>
    			</PropertyManipulators>
    If the top file is placed last then it will show -1 Tourism on the building. If the bottom file is placed last then +5 Disease is shown on the building.
     
  2. AIAndy

    AIAndy Deity

    Joined:
    Jun 8, 2011
    Messages:
    3,420
    The code changes I mentioned (commenting out those 3 lines) should make it behave as you desire.
     
  3. Hydromancerx

    Hydromancerx C2C Modder

    Joined:
    Feb 27, 2008
    Messages:
    16,281
    Location:
    California, USA
    I don't know how to do that. Could someone do this? :(
     
  4. Thunderbrd

    Thunderbrd C2C War Dog

    Joined:
    Jan 2, 2010
    Messages:
    27,936
    Gender:
    Male
    Location:
    Las Vegas
    DH showed me that one module's setting on those tags will overwrite whatever's loaded before it. It's not NOT modular capable, it's just not WoC capable if that makes sense. WoC would declare those additional defining lines within the XML statements to be additive and we're getting more of a replacing mechanism.
     
  5. Hydromancerx

    Hydromancerx C2C Modder

    Joined:
    Feb 27, 2008
    Messages:
    16,281
    Location:
    California, USA
    @AIAndy & TB

    Wait so can it be fixed or not? :crazyeye:
     
  6. AIAndy

    AIAndy Deity

    Joined:
    Jun 8, 2011
    Messages:
    3,420
    It can.
    The three lines of code I mentioned, once removed (or commented out), change the behavior from replacing sources to adding to the source list.

    I just changed it myself in the source code file and committed it but it won't have any effect until someone compiles the DLL.
    Note: If someone relied on the old behavior, then he needs to add a WoC override now.
     
  7. JosEPh_II

    JosEPh_II TBS WarLord

    Joined:
    Jun 20, 2007
    Messages:
    16,255
    Gender:
    Male
    Location:
    Western IL. cornfields
    :bump:

    Reference material.
     
  8. JosEPh_II

    JosEPh_II TBS WarLord

    Joined:
    Jun 20, 2007
    Messages:
    16,255
    Gender:
    Male
    Location:
    Western IL. cornfields
    :bump: Again
     

Share This Page