Extending the generic property system

Properties not being modular is a very broad statement that should not be the case in that generality (except by bug). Likely we are just talking about inheritance semantics that are easy to change.

Please specify what XML exactly you tried and what you expected to happen and what instead happened.

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.
 
The code changes I mentioned (commenting out those 3 lines) should make it behave as you desire.
 
The code changes I mentioned (commenting out those 3 lines) should make it behave as you desire.

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.
 
@AIAndy & TB

Wait so can it be fixed or not? :crazyeye:
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.
 
:bump:

Reference material.
 
:bump: Again
 
Top Bottom