The Expression System

I think that like many other important documents it is liked to in the first post of the Modders Documentation document. That is one of the reasons for that thread:D
 
I think that like many other important documents it is liked to in the first post of the Modders Documentation document. That is one of the reasons for that thread:D

I have an issue.
I want to merge both.
Tech Chiefdom Increases Air Pollution by 5 for X Building. (Hypothetical)
Code:
                      <ConstructCondition>
                             <And>
				<Has>
				   <GOMType>GOM_TECH</GOMType>
				   <ID>TECH_CHIEFDOM</ID>
				</Has>
                             </And>
			</ConstructCondition>

Code:
<PropertyManipulators>
			  <PropertySource>
			    <PropertySourceType>PROPERTYSOURCE_CONSTANT</PropertySourceType>
			    <PropertyType>PROPERTY_AIR_POLLUTION</PropertyType>
			    <iAmountPerTurn>5</iAmountPerTurn>
			  </PropertySource>
			</PropertyManipulators>

How do I Increase Air Pollution by 5 to a Building when Tech Chiefdom is Discoverd?

I know you can add a :gold::food::culture::hammers::science::espionage: increase to Techs but how do you do that for a Property?

Or is it like these?

Code:
			    <CommerceChanges> 
                            <iCommerce>0</iCommerce>[COLOR="RoyalBlue"]gold[/COLOR]
				<iCommerce>0</iCommerce> [COLOR="RoyalBlue"]beakers[/COLOR]
				<iCommerce>0</iCommerce> [COLOR="RoyalBlue"]culture[/COLOR]

				<iCommerce>5</iCommerce> [COLOR="RoyalBlue"]air pollution[/COLOR]

				<iCommerce>0</iCommerce> [COLOR="RoyalBlue"]water pollution[/COLOR]
                               <iCommerce>0</iCommerce> [COLOR="RoyalBlue"]flammabilty[/COLOR]
                             <iCommerce>0</iCommerce> [COLOR="RoyalBlue"]education[/COLOR]

Basically do we would have to create new Commerce Tags? Is that possible?

Edit: :hammers: and :gold: are both a requirement for buildngs and can be produced. .
 
Definitely not the second example (AT ALL!!!)

I believe it would be a property manipulator on the tech that would act to modify the output of the building or on the building that would act to modify the output when a given tech is had. I'm quite certain AIAndy could explain the answer to that - and maybe Koshling could. It's a bit beyond me though at the moment.
 
Perhaps via the Active tag, perhaps something like this on the building:
Code:
			<PropertyManipulators>
				<PropertySource>
					<PropertySourceType>PROPERTYSOURCE_CONSTANT</PropertySourceType>
					<PropertyType>PROPERTY_AIR_POLLUTION</PropertyType>
					<iAmountPerTurn>5</iAmountPerTurn>
					<Active>
						<Has>
				   			<GOMType>GOM_TECH</GOMType>
				   			<ID>TECH_CHIEFDOM</ID>
						</Has>
					</Active>
				</PropertySource>
			</PropertyManipulators>

I don't know if this would actually work or not. It looks like it should. Probably. Can't hurt to try it.
 
God Emperor

It worked! :) :) ;)




I changed the Text Formatting in Properties_Civ4GameText:

Code:
<TEXT>
		<Tag>TXT_KEY_PROPERTY_ACTIVE</Tag>
		<English>[COLOR="RoyalBlue"]with [/COLOR]</English>
		<French>Si</French>
		<German>if</German>
		<Italian>if</Italian>
		<Spanish>si</Spanish>
	</TEXT>



I don't know how to change color like it did with Looter.

This was just with Tech.
 
We need to figure out how to order manipulate commerce and yeiilds with Properties.
 
Usually done with autobuildings. What specific issues are you considering here?

If I wanted to makes stats like these

+1 :gold: with flammability
+1 :food: with crime
+1 :mad: with disease
-1 :science : with air pollution
-1 :culture: with water pollution
-1 hammers with crime
+1 espionage with crime

Basically be able to modify the existing things like Gold, science , hammers with Properties. It's a very big deal if we can, it allows access to everything.
 
There are buildings that are autobuilt if you are within some range of property values (currently they are all from some lower limit to a high that you will hopefully never get to, so effectively exist if you are above some value). They can do anything any other building can do. Currently it is mostly uhhappiness and loss of gold from crime buildings and unhealthiness from pollution buildings, but it could be anything (everything in your examples should be possible).
 
I work on the xsd schema and now i have a little problem.
We have two If expressions one Boolean and the other Integer that is a problem because the Integer If can have both as subexpressions.
There can't be two different tags with the same name and there is no good way around it, so can i rename them or one of them?
 
I work on the xsd schema and now i have a little problem.
We have two If expressions one Boolean and the other Integer that is a problem because the Integer If can have both as subexpressions.
There can't be two different tags with the same name and there is no good way around it, so can i rename them or one of them?
Sure. I don't think anyone is even using it at the moment.
 
Sure. I don't think anyone is even using it at the moment.

Ok i name them BIf and IIf and i make another change to then. There are now the Then and Else Tags because it is easier to see how it works.
Code:
                            <IIf>
                                <Has>
                                    <GOMType>GOM_RELIGION</GOMType>
                                    <ID>RELIGION_JUDAISM</ID>
                                </Has>
                                <Then>
                                    <Constant>4</Constant>
                                </Then>
                                <Else>
                                    <Constant>1</Constant>
                                </Else>
                            </IIf>
 
:bump:

For my learning experience and how to get % in crime instead of constants.

JosEPh
 
Whomever can assist:
The following is apparently not valid:
Code:
			<TrainCondition>
				<And>
					<Has>
						<GOMType>GOM_BONUS</GOMType>
						<ID>BONUS_FIREARMS</ID>
					</Has>
					<Has>
						<GOMType>GOM_BONUS</GOMType>
						<ID>BONUS_AMMO</ID>
					</Has>
					<Has>
						<GOMType>GOM_BONUS</GOMType>
						<ID>BONUS_AUTOMOBILES</ID>
					</Has>
					<Has>
						<GOMType>GOM_BONUS</GOMType>
						<ID>BONUS_TIRES</ID>
					</Has>
					<Has>
						<GOMType>GOM_BONUS</GOMType>
						<ID>BONUS_DIESEL</ID>
					</Has>
				</And>
				<Or>
					<Has>
						<GOMType>GOM_BUILDING</GOMType>
						<ID>BUILDING_POLICE_STATION</ID>
					</Has>
					<Has>
						<GOMType>GOM_BUILDING</GOMType>
						<ID>BUILDING_POLICE_PRECINCT</ID>
					</Has>
				</Or>	
			</TrainCondition>
I'm trying to say, needs all of the resources AND either of the buildings. Does anyone know how this is supposed to be setup?
 
Perhaps an additional AND around the AND and OR (I hope that isn't ambiguous).
 
Put the Or in the And, not outside of it (in other words, move the closing And tag to below the closing Or tag).
Alternatively do what tmv suggested.
 
Perhaps an additional AND around the AND and OR (I hope that isn't ambiguous).

Put the Or in the And, not outside of it (in other words, move the closing And tag to below the closing Or tag).
Alternatively do what tmv suggested.

I tried the first suggestion. I'll go with yours AIAndy. Thanks!

EDIT: Worked like a charm! Thanks AIAndy!
 
Top Bottom