I've got a building that modifies the industry of all targets - supply line connected planets with population centers. That, I can do fine. What I'd like do is to measure that effect against the size of the source planet, so the bigger the source planet, the bigger the effect on the targets.
For instance - see how I'm trying to reference the planet size of the source's planet, which fails:
Code: Select all
effects = And [
If condition = Source.PlanetSize = value = Huge
effects = SetTargetIndustry value = Value + 5
else =
If condition = Source.PlanetSize = Large
effects = SetTargetIndustry value = Value + 2
else =
If condition = Source.PlanetSize = Medium
effects = SetTargetIndustry value = Value + 1
else =
If condition = Source.PlanetSize = Small
effects = SetTargetIndustry value = Value + .5
else = Source.PlanetSize = Tiny
effects = SetTargetIndustry value = Value + .25
]
I think I've got nested if statements working to differentiate the sizes, but for the life of me, I cannot reference the source planet size. Source.PlanetSize and the like break the building. The only thing I have successfully done is to use "Planet Size" in the If statement, but since it's referring to the target (defined by the "scope" of the effects group), that makes the adjustment according to the target.
Anyone care to point me to how to point to the source in an effectsgroup effects? ...or otherwise make the effect contingent on the source's planet size?
By the way - if there's a clean breakdown of programming objects - classes, properties, and nesting structure (exposed to FOCS... I'm not a C++ guy) - I'd sure love to have it.