Page 1 of 1

Rule debugging (city walls trade penalty)

Posted: Tue Jun 28, 2016 11:22 am
by Drachefly
I wanted to reduce trade by 1 in each non-adjacent tile, if you have city walls*

So I put this effect in the effects ruleset.

Code: Select all

[effect_city_walls_bad_traffic]
type    = "Output_Penalty_Tile"
value   = 1
reqs = { "type", "name", "range"
         "Building", "City Walls", "City"
         "OutputType", "Trade", "Local"
       }
nreqs = {"type", "name", "range"
         "CityTile", "Center", "Adjacent"
        }
It appeared to have no effect - a paper resource 2 squares away from my test cities continued to yield 2 trade (or 3 with a river) after building city walls.

Any ideas why this doesn't work? Did I do it wrong, or does Output_Penalty_Tile not use the CityTile requirement? Or does it test the city center and find that it is adjacent to the city center and say 'nope' each time it considers what to do?


*(I have changed the effect of Great Wall not to replace city walls)

Re: Rule debugging (city walls trade penalty)

Posted: Tue Jun 28, 2016 3:19 pm
by Alien Valkyrie
It might be possible that Output_Penalty_Tile only works on city level, not on tile level. Also, Output_Penalty_Tile doesn't reduce output by a value, but reduces it by one if it's greater than that value. You could instead use Output_Inc_Tile with an amount of -1; if that works at all (which I assume it should), it'll work on tile level.

Re: Rule debugging (city walls trade penalty)

Posted: Tue Jun 28, 2016 5:58 pm
by cazfi
Caedo wrote:Output_Penalty_Tile doesn't reduce output by a value, but reduces it by one if it's greater than that value.
... and as values from active effects are added together, this might actually cause penalty to be applied less often (if it was applied to all tiles producing any trade (at least 1), it could be now only those tiles producing at least 2 (1 + 1))

Re: Rule debugging (city walls trade penalty)

Posted: Wed Jun 29, 2016 4:49 pm
by Drachefly
So, I tried that. Oddly, it was successful in reducing trade from a non-adjacent whales tile, but a non-adjacent paper tile remained 1-2-2. A distant roads-grassland tile was reduced to 0 trade, a nearby roads-plains tile was left with 1 trade.

I think this reduction is occurring before special resources and getting trimmed, not after.

Eh. Good enough. Thanks!