<- CRPL reference <- Script Commands

GetScriptVar

ArgumentsResultNotation
Unit UID, script name, var name i1 s1 s2 – d1

Description

Gets the named variable on the specified unit script.

List of variables for existing units(for builds 1.66 and newer):

Returns a special null value if the script or unit does not exist. This value is the same as zero for most intents and purposes.

Emitter

Script: 0

STARTTIME
  Number of frames before emitter starts production.
FINISHTIME
  Untested. Probably number of frames before emitter halts production.
PRODUCTIONINTERVAL
  Number of frames between each creeper production.
PRODUCTIONAMT
  The amount of creeper produced per production, multiplied by 1000000.

SporeTower

Script: 0

STARTTIME
  The number of frames before the tower starts producing spores.
WAVEINTERVAL
  The number of frames between each wave of spores.
WAVECOUNT
  The number of spores in each wave.
SPOREPAYLOAD
  The amount of creeper that each spores dumps on the map when it lands, multiplied by 1000000.

AETower

Script: 0

RANGE
  The size of the exclusion zone.

RunnerNest

Script: 0

SPAWNINTERVAL
  The number of frames between the production of each runner
MAXPOPULATION
  The maximum number of runners produced by this nest on the map at any given time.
MOVESPEED
  The movement speed in pixels per second of each runner.
RUNNERMAXHEALTH
  The maximum health and starting health of each runner.
CREEPERPAYLOAD
  The amount of creeper that each runner dumps to the map when it dies or is killed, multiplied by 1000000.

Inhibitor

Script: 0

STARTTIME
  The number of frames before the inhibitor starts producing creeper.
PRODUCTIONINTERVAL
  The number of frames between each production of creeper.
PRODUCTIONAMT
  The amount of creeper produced.
RANGE
  The range of the aerial exclusion zone. Set to 0 for none.

ResourcePack

Script: 0

AMT
  The starting amount that the pack carries. Must be less than MAXAMT.
MAXAMT
  The maximum amount that the pack carries.
RESOURCETYPE
  The type of resource that the pack carries. Either ENERGY, ORE or AETHER.
  

Guppy Pad (added in 1.68)

Script: ""

MODE
  The type of cargo that the guppy ferries. Either PACKET, ORE or AC.
 

Artifact of Odin (AOO)

Script: 0

TYPE
  The type of AoO. Either FREEZE, MASS or CONVERT.

Examples

@CreateBullet

<-unit "CRBullet.crpl" "targetX" GetScriptVar trace


:CreateBullet
	"CRPLCore" CurrentX CurrentY CreateUnit ->unit
	<-unit "CRBullet.crpl" AddScriptToUnit
	<-unit "CRBullet.crpl" "targetX" <-targetX SetScriptVar
	<-unit "CRBullet.crpl" "targetY" <-targetY SetScriptVar
	<-unit "CRBullet.crpl" "payload" <-payload SetScriptVar
	<-unit "main" "Custom2" SetImage
	<-unit "main" -0.01 SetImagePositionZ
	<-unit "main" self "barrel" GetImageRotation SetImageRotation