User Tools

Site Tools


crpl:docs:createunit

This is an old revision of the document!


~~DISCUSSION~~ <- CRPL reference <- Unit Commands

CreateUnit

ArgumentsResultNotation
Unit Name and coordinates Unit UID s1 i1 i2 – i3

Description

Creates a unit at the specified coordinates. Unit names must be one of the follow strings. Names are NOT case sensitive.

  • COLLECTOR
  • RELAY
  • REACTOR
  • OREMINE
  • SIPHON
  • TERP
  • GUPPY
  • PULSECANNON
  • MORTAR
  • STRAFER
  • BOMBER
  • SPRAYER
  • NULLIFIER
  • SHIELD
  • BEAM
  • SNIPER
  • FORGE
  • BERTHA
  • POWERZONE
  • OREDEPOSIT
  • RESOURCEPACK
  • SHIELDKEY
  • TECHARTIFACT
  • MESSAGEARTIFACT
  • AOO
  • THOR
  • CRPLCORE
  • RESOURCEPACK
  • TOTEM
  • EMITTER
  • SPORETOWER
  • RUNNERNEST
  • AETOWER
  • INHIBITOR

Examples

"CRPLCORE" 10 10 CreateUnit ->unitUID
# Build an emitter or spore tower at current location.  (From Arca by virgilw.)
RandFloat ->rand
if (<-rand lt(0.5))
	CreateUnit("EMITTER" CurrentCoords) ->child
	SetScriptVar(<-child 0 "productionInterval" 10)
	SetScriptVar(<-child 0 "productionAmt" 25000000)
else
	CreateUnit("SPORETOWER" CurrentCoords) ->child
	SetScriptVar(<-child 0 "startTime" GetGameTimeFrames add (3600))
	SetScriptVar(<-child 0 "waveInterval" 3600)
	SetScriptVar(<-child 0 "waveCount" 1)
	SetScriptVar(<-child 0 "sporePayload" 25000000)
endif
crpl/docs/createunit.1412190170.txt.gz · Last modified: 2015/04/07 02:30 (external edit)