[solved] Effect if species on source building & target match
Posted: Wed Jun 07, 2017 9:04 am
Hi I got a problem with FOCS with an effectsgroup for a building.
I am having a building and one of it effects is that it should add some happiness to all the empires planets with the same kind of species.
This didnt work, I think buildings match no species condition:
This doesnt work as well:
Current code is in EFFECTS_GROUPS_GOVERNMENT_FUNCTION_HAPPINESS macro.
Any help greatly appreciated. I was bumping my head against this one last night.
Also, shouldnt buildings "have" a species (there is a one-to-one-relationship) for the Species condition to match?
I am having a building and one of it effects is that it should add some happiness to all the empires planets with the same kind of species.
This didnt work, I think buildings match no species condition:
Code: Select all
EffectsGroup /* add happiness for species */
scope = And [
PopulationCenter
Species name = Source.Species
OwnedBy empire = Source.Owner
]
activation = Source
effects = [
SetTargetHappiness value = Value + [[GOVERNMENT_FUNCTION_HAPPINESS_FOR_SPECIES]]
]
Code: Select all
EffectsGroup /* add happiness for species */
scope = And [
PopulationCenter
OwnedBy empire = Source.Owner
]
activation = Source
effects = [
If condition = And [
Object id = Source.PlanetID
Planet
Species name = Target.Species
] effects = [
SetTargetHappiness value = Value + [[GOVERNMENT_FUNCTION_HAPPINESS_FOR_SPECIES]]
]
]
Any help greatly appreciated. I was bumping my head against this one last night.
Also, shouldnt buildings "have" a species (there is a one-to-one-relationship) for the Species condition to match?