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]]
]
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]]
]
]
Ophiuchus wrote: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?
No; Planets or ships have a species. Buildings are on a planet, which can have a species, but don't themselves have a species. So use Source.Planet.Species rather than Source.Species for a building source object.
Ophiuchus wrote: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?
No; Planets or ships have a species. Buildings are on a planet, which can have a species, but don't themselves have a species. So use Source.Planet.Species rather than Source.Species for a building source object.
Thats even better. Somehow missed (or forgot) that you could chain those references.
Works great now. Thaaanks for your help again
Any code or patches in anything posted here is released under the CC and GPL licences in use for the FO project.