User Tools

Site Tools


crpl:docs:createunit

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
Next revision
Previous revision
Next revisionBoth sides next revision
crpl:docs:createunit [2013/03/17 15:26] virgilwcrpl:docs:createunit [2015/04/08 00:13] Karsten75
Line 1: Line 1:
-~~DISCUSSION~~ 
 <- [[crpl:crplreference| CRPL reference]] <- [[crpl:crplreference#unit_commands|Unit Commands]] <- [[crpl:crplreference| CRPL reference]] <- [[crpl:crplreference#unit_commands|Unit Commands]]
 =====  CreateUnit  ===== =====  CreateUnit  =====
Line 10: Line 9:
 Creates a unit at the specified coordinates.  Unit names must be one of the follow strings.  Names are NOT case sensitive. Creates a unit at the specified coordinates.  Unit names must be one of the follow strings.  Names are NOT case sensitive.
  
-  * CRPLCORE 
   * COLLECTOR   * COLLECTOR
   * RELAY   * RELAY
Line 27: Line 25:
   * BEAM   * BEAM
   * SNIPER   * SNIPER
 +  * FORGE
   * BERTHA   * BERTHA
   * POWERZONE   * POWERZONE
   * OREDEPOSIT   * OREDEPOSIT
-  * ENERGYDEPOSIT0 +  * RESOURCEPACK
-  * ENERGYDEPOSIT1 +
-  * ENERGYDEPOSIT2 +
-  * ENERGYDEPOSIT3+
   * SHIELDKEY   * SHIELDKEY
 +  * TECHARTIFACT
 +  * MESSAGEARTIFACT
 +  * AOO
 +  * THOR
 +  * CRPLCORE
 +  * RESOURCEPACK
 +  * TOTEM
 +  * EMITTER
 +  * SPORETOWER
 +  * RUNNERNEST
 +  * AETOWER
 +  * INHIBITOR
  
 === Examples === === Examples ===
Line 40: Line 48:
 "CRPLCORE" 10 10 CreateUnit ->unitUID "CRPLCORE" 10 10 CreateUnit ->unitUID
 </code>  </code> 
 +<code>
 +# 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
 +</code>
crpl/docs/createunit.txt · Last modified: 2020/05/30 11:18 by Sanian