Latitude

Contribute, display and discuss rulesets and modpacks for use in Freeciv here.
Post Reply
John Campbell
Posts: 13
Joined: Wed Jan 18, 2023 6:57 pm

Latitude

Post 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?
User avatar
Alien Valkyrie
Elite
Posts: 519
Joined: Sun Feb 10, 2013 10:21 pm
Location: Stuttgart, Germany

Re: Latitude

Post 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.
~ AVL
cazfi
Elite
Posts: 3389
Joined: Tue Jan 29, 2013 6:54 pm

Re: Latitude

Post 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.
Post Reply