Counting Villages

The place to post your WML questions and answers.

Moderator: Forum Moderators

Forum rules
  • Please use [code] BBCode tags in your posts for embedding WML snippets.
  • To keep your code readable so that others can easily help you, make sure to indent it following our conventions.
Post Reply
Posts: 5
Joined: January 28th, 2008, 9:04 pm

Counting Villages

Post by DibiZibi »

How Can I count all villages of the selected terrain letter that are under control of selected side?
Inactive Developer
Posts: 1272
Joined: August 27th, 2004, 8:05 am
Location: Berlin, Germany

Post by Rhuvaen »

I don't know what you mean by "selected", but this is a way to count villages:

Code: Select all

    variable = villages
    owner_side = 3 # whatever side you're looking for
    terrain = Gg^Vh # whatever specific villages you're looking for
$villages.length will then be the number of villages that match the above filter.

The example is for the 1.3+ version.
Post Reply