Page 1 of 1

Latitude

Posted: Mon Aug 04, 2025 6:09 am
by John Campbell
I've been trying to make it so Solar Plants have latitude-dependent output, ranging from the standard +25% Production around the equator to a mere +5% at the poles (with a +2% bonus if there's any Desert in the city radius).

So I changed the Solar Plant effect to a series of declarations like so:

Code: Select all

[effect_solar_plant_factory_solar_25]
type    = "Output_Bonus"
value   = 25
reqs    =
    { "type", "name", "range", "present"
      "Building", "Factory", "City", TRUE
      "OutputType", "Shield", "Local", TRUE
      "Building", "Solar Plant", "City", TRUE
      "Building", "Nuclear Plant", "City", FALSE
      "Building", "Fusion Plant", "City", FALSE
      "MaxLatitude", "200", "Tile", TRUE
      "MinLatitude", "-200", "Tile", TRUE
    }
    
[effect_solar_plant_factory_solar_20N]
type    = "Output_Bonus"
value   = 20
reqs    =
    { "type", "name", "range", "present"
      "Building", "Factory", "City", TRUE
      "OutputType", "Shield", "Local", TRUE
      "Building", "Solar Plant", "City", TRUE
      "Building", "Nuclear Plant", "City", FALSE
      "Building", "Fusion Plant", "City", FALSE
      "MaxLatitude", "400", "Tile", TRUE
      "MinLatitude", "201", "Tile", TRUE
    }
; etc...

[effect_solar_plant_factory_solar_desert]
type    = "Output_Bonus"
value   = 2
reqs    =
    { "type", "name", "range", "present"
      "Building", "Factory", "City", TRUE
      "OutputType", "Shield", "Local", TRUE
      "Building", "Solar Plant", "City", TRUE
      "Building", "Nuclear Plant", "City", FALSE
      "Building", "Fusion Plant", "City", FALSE
      "Terrain", "Desert", "City", TRUE
    }
And now my Solar Plants don't work. None of them are showing any output other than the occasional single Shield from the Desert bonus (which is working fine) even though any latitude from pole to pole should match one of the Latitude rules. This is the same syntax sandbox uses in its examples. If I change the range on the Latitude rules to Local or City, it just refuses to load the ruleset at all. What's up? Can I not use Latitude in effect requirements? Is it only for buildings and extras?

Re: Latitude

Posted: Tue Aug 05, 2025 7:44 am
by Alien Valkyrie
The Output_Bonus effect is only evaluated against the city, not against the tile it's on, so any Tile-ranged requirements in general won't work there. This could be changed in principle; there doesn't seem to be any particular reason for this.

Re: Latitude

Posted: Tue Aug 05, 2025 9:46 pm
by cazfi
Alien Valkyrie wrote: Tue Aug 05, 2025 7:44 amThis could be changed in principle; there doesn't seem to be any particular reason for this.
Please open a ticket.