User Tools

Site Tools


crpl:docs:getunittype

<- CRPL reference <- Unit Commands

GetUnitType

ArgumentsResultNotation
Unit UID Unit name i1 – s1

Description

Returns the name of the unit type as a string. Names are NOT case sensitive.

Unit Types

  • COMMANDNODE
  • COLLECTOR
  • RELAY
  • REACTOR
  • OREMINE
  • SIPHON
  • TERP
  • GUPPY
  • GUPPYAIR (as of 1.15)
  • SHIELD
  • PULSECANNON (use CANNON for Tech Artifacts)
  • MORTAR
  • STRAFER
  • STRAFERAIR (as of 1.15)
  • BOMBER
  • BOMBERAIR (as of 1.15)
  • SPRAYER
  • NULLIFIER
  • BEAM
  • SNIPER
  • FORGE
  • BERTHA
  • THOR
  • POWERZONE
  • OREDEPOSIT
  • RESOURCEPACK
  • TOTEM
  • AOO
  • ANTIEMITTER
  • SHIELDKEY
  • TECHARTIFACT
  • MESSAGEARTIFACT
  • CRPLCORE
  • EMITTER
  • SPORETOWER
  • RUNNERNEST
  • RUNNER (as of 1.15)
  • AETOWER
  • INHIBITOR

Notes:

  • COMMANDNODE, RUNNER, BOMBERAIR, STRAFERAIR and GUPPYAIR cannot be created using CreateUnit.
  • Tech Artifacts can only be player unit types excluding the AIR-suffix units.

Flying guppies, strafers, bombers, and runners will return an empty string as their unit type if your version of CW3 is 1.14 or lower.

Examples

:GetUnitTypeCount
	->unitType
	0 ->count
	do (GetUnitsInRange(0 0 9999) 0)
		->unitUID
		if (GetUnitType(<-unitUID) eq(<-unitType))
			<-count add(1) ->count
		endif
	loop
	<-count
crpl/docs/getunittype.txt · Last modified: 2021/02/05 11:44 by Karsten75