GetPlayerTechCount

Parameters
whichPlayer player

The player whose tech level to query.

techid integer

The id of the tech item. Either an upgrade like Iron Plating 'Rhar', a unit type like Footman 'hfoo' or one of the following special equivalent ids:

  • 'HERO' - any hero
  • 'TALT' - any altar
  • 'TWN1' - town hall tier 1
  • 'TWN2' - town hall tier 2
  • 'TWN3' - town hall tier 3
  • 'TWN4' - town hall tier 4
  • 'TWN5' - town hall tier 5
  • 'TWN6' - town hall tier 6
  • 'TWN7' - town hall tier 7
  • 'TWN8' - town hall tier 8
  • 'TWN9' - town hall tier 9
specificonly boolean

When this is false, it will consider some additional dependencies between the techs: When specificonly is false, the Human Guard Tower 'hgtw' will also be considered when querying for the Scout Tower 'hwtw' (even if the Guard Tower is preplaced, i.e. not doing the upgrade on runtime, so this checks the Teechtree - Upgrades To 'uupt' field?). Higher tier townhalls will be considered when querying for lower tier hownhalls, i.e. querying for Great Hall 'ogre' will also consider Stronghold 'ostr' and Fortress 'ofrt' when specificonly is false. Ability morph does not seem to be considered when specificonly is false, tested with Berserker Upgrade of Headhunter. Techtree - Dependency Equivalents 'udep' seems to be considered even if specificonly is true, i.e. when you set Scout Tower as an equivalent for Farm 'hhou', querying for 'hhou' will also consider Scout Towers.

comment

Gets the level of a tech of a player. This could be an upgrade, a unit type or an equivalent as selected in tech requirement fields. In case of an upgrade, this would be the level of the upgrade the given player has and 0 if the player has not researched the upgrade at all. In case of a unit type or an equivalent, it would be the amount of units of that type or which fulfill the equivalent condition for the given player.

patch

1.00

Source
common.j
return type
integer
Source code
constant native GetPlayerTechCount      takes player whichPlayer, integer techid, boolean specificonly returns integer