This may be a question that has already been answered, but I couldn't find anything that explains how to use the 'counters'. I only found it on whislist.
I don't know if this is right, but is this a counter that starts when you create an extra on the terrain? If so, does it reset after loading the game?
How do I work with it in ruleset and in LUA?
Thanks
How to use counters correctly?
Re: How to use counters correctly?
Currently there are only city counters (counting things related to a city). Typical use of a counter is that it works as an requirement for an effect, but there's some lua support too: https://www.freeciv.org/wiki/Lua_refere ... al#Counter
Counters are defined in game.ruleset, and supplied rulesets have documentary comments.
Counters are defined in game.ruleset, and supplied rulesets have documentary comments.
-
- Posts: 22
- Joined: Mon Jan 01, 2024 3:22 am
Re: How to use counters correctly?
Great! Found it! Thanks!cazfi wrote: ↑Sat Jan 18, 2025 3:26 pm Currently there are only city counters (counting things related to a city). Typical use of a counter is that it works as an requirement for an effect, but there's some lua support too: https://www.freeciv.org/wiki/Lua_refere ... al#Counter
Counters are defined in game.ruleset, and supplied rulesets have documentary comments.
Re: How to use counters correctly?
There are city counters currently, such like how many turns owner owned city (reset, when city change owner), how many turn city celebrates and how many turn city is in disorder state. Counters are connected with triggers - you define checkpoint value, which told, when trigger connected to counter is activated. It is active, when counter is at least checkpoint value. In req list, you define which counter/trigger will activate effect. And counters are preserved between game save/load.
Sorry for my English - I still learning.
Sorry for my English - I still learning.