For those who want to use CRPL heavily, this ultra condensed reference puts everything you need to know in a single page. For learning the language, refer to the other CRPL pages.
For enhanced rapid access, every command and constant is organized into a story, with stuff that is needed in multiple stories going into basics and stuff that fits no story going into leftovers. Commands will be in the first appropriate story.
*special* indicates that this command works differently than a normal one. Pay close attention to usage and examples.
*special* may also indicate a constant that does not start with CONST_ and does not work with GetUnitAttribute or SetUnitAttribute. The full name will be listed.
*bugs* indicates known bugs may affect the functioning of this command.
Argument types: i=integer, f=float, n=integer or float, s=string, u=unit ID, x=integer x coordinate, y=integer y coordinate, z=integer z coordinate, b=TRUE or FALSE (1 or 0), *=any, l=list, {u}=bunch of unit IDs, CONST_= one of the normal constants.
Default values or legal values in ().
Commands | |||
---|---|---|---|
*special* # | *special* $VARNAME:DEF_VAL | ||
*special* <-VARNAME *(0) | *special* * ->VARNAME | ||
??? @FUNC_NAME ??? | *special* :FUNC_NAME | ||
n n gt b | n n gte b | n n lt b | n n lte b |
n n eq b | n n neq b | n eq0 b | n neq0 b |
b b and b | b b or b | b not b | |
* * swap * * | * dup * * | * * dup2 * * * * | |
n n add n | n n sub n | n n mul n | *special* n n div n |
n max n | n min n | n n mod n | |
* asfloat f | * asint i | n neg n | n sqrt f |
*special* once endonce | *special* b if else endif | ||
*special* n n do loop | *special* while b repeat endwhile | ||
*special* break | *special* return | *special* delay | |
*special* u CONST_ GetUnitAttribute ??? | *special* u CONST_ ??? SetUnitAttribute | ||
CurrentCoords x y | RandFloat f[0,1) | i i RandInt i | |
x y CellToPixel x y | x y PixelToCell x y | ||
b OperateWhilePaused *bugs* | |||
* * Concat s | s SetPopupText |
Builtin Functions | ||
---|---|---|
:destroyed | :awake | :GameLoaded |
Commands | ||
---|---|---|
u s AddScriptToUnit | u s s GetScriptVar * | u s s * SetScriptVar |
s * GetCoresWithVar {u} i | ||
x y GetDigitalis f | x y f SetDigitalis | |
x y GetDigitalisRaw i | x y i SetDigitalisRaw | |
x y n GetUnitCountInRange i | ||
x y n GetUnitsInRange {u} i | x y n b GetAllUnitsInRange {u} i | |
x y f RandCoordsInRange x y | RandUnitCoords x y | RandCoords x y |
s x y CreateUnit u | u f Damage | u i(none,flash,BOOM,quiet) Destroy |
x y GetUnitAt | u GetUnitType | |
x y z i i i CreateMist | i x y z f f f CreateEffect | i x y z f f f i CreateEffectClipped |
f i i f b EnableTowerField *bugs* | DisableTowerField | |
AscendToOrbit | x y DropFromOrbit | |
u s s SetImage | u s x y z SetImagePosition | u s f f SetImageScale |
u s f SetImageRotation | u s i i i i SetImageColor | u RemoveImages |
s PlaySound | ||
x y i AddCreeper | x y i f i i b DamageCreeper | |
x y i SetCreeperNoLower | x y i SetCreeper | x y GetCreeper i |
i f MakeRain | x y x y f(1) f(20) CreateSpore | x y f(2) f(10) f(5) CreateRunner |
GetRunnerCount i | GetGlobalRunnerCount i |
Constants | ||
---|---|---|
CellHeight i(3) | CellWidth i(3) | ThorTarget b(FALSE) |
NullifierDamageAmt f(0) | HealRate f(0.001) | DestroyOnDamage b(TRUE) |
ShowAmmoACBar b(?) | ShowAmmoBar b(?) | ShowHealthBar b(?) |
Unit type names: (not case sensitive) CommandNode, 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.
Extended unit type names: (Cannot be directly created) GuppyAir, StraferAir, BomberAir, Runner.
Effects: 0=ShotExplosion, 1=MortarShellExplosion, 2=BerthaShellExplosion, 3=RunnerExplosion, 4=SporeExplosion, 5=TotemExplosion, 6=CreeperAAShellExplosion, 7=UnitExplosion, 8=MoveTrail, 9=ShortTrail, 10=SporeTrail, 11=SmokeRingEffect, 12=ParticleBeamDamage, 13=PulseCannonShellEffect, 14=StunnedEffect, 15=TerraModCell, 16=TotemFiring.
Script 0 vars: Emitter(STARTTIME, FINISHTIME, PRODUCTIONINTERVAL, PRODUCTIONAMT), SporeTower(STARTTIME, WAVEINTERVAL, WAVECOUNT, SPOREPAYLOAD), AETower(RANGE), RunnerNest(SPAWNINTERVAL, MAXPOPULATION, MOVESPEED, RUNNERMAXHEALTH, CREEPERPAYLOAD), Inhibitor(STARTTIME, PRODUCTIONINTERVAL, PRODUCTIONAMT, RANGE), ResourcePack(AMT, MAXAMT, RESOURCETYPE{ENERGY, ORE, AETHER}), Guppy(MODE{PACKET,ORE,AC}), AOO(TYPE{FREEZE, MASS, CONVERT}), TechArtifact(COUNT).
Commands | ||
---|---|---|
f f atan2 f | f cos f | f sin f |
f ShortestAngle f | ||
x y f QueueMove | AbortMove | i SuspendMove |
GetQueuedMoveCount i | ClearQueuedMoves | |
x SetTargetOffsetX | y SetTargetOffsetY | |
CurrentPixelCoords x y | ||
u s y SetImagePositionY | x y x y Distance f |
CONSTANTS | ||
---|---|---|
*special* PI f | ||
BeamTarget b(FALSE) | SniperTarget b(FALSE) | SniperIgnoreLOS b(FALSE) |
NullifierDamages b(TRUE) | IsLanded b(TRUE) | TakeMapSpace b(TRUE) |
PixelCoordX i | PixelCoordY i |
Commands | ||
---|---|---|
GetMousePosition x y | GetMouseCell x y | |
i GetMouseButton b | i GetMouseButtonDown b | i GetMouseButtonUp b |
u GetUnitTargetOffsetX x | u GetUnitTargetOffsetY y | |
x y n GetEnemyUnitsInRange {u} i | x y x y IsTerrainLOS b *bugs* | |
x y i i b b i FloodFillTerrain l | x y n b b b b GetNearestGroundEnemy x y | |
x y f i b b b IsCreeperInRange b | ||
s GetTechLimit i | s i SetTechLimit | s i SetBuildLimit (use unit names) |
s(Freeze,Mass,Convert) x y FireAoo | u s SetTechArtifactType | |
GetDeepestCreeperCell x y |
Constants | ||
---|---|---|
Ammo f(0) | MaxAmmo f(0) | PacketRequestDelay i(15) |
AmmoAC f(0) | MaxAmmoAC f(0) | ACPacketRequestDelay i(15) |
CanRequestAmmo b(FALSE) | RequestPackets b(FALSE) | |
BuildCost f(0) | IsBuilding b(FALSE) | |
Connectable b(FALSE) | ||
CountsForVictory b(TRUE) | CreatePZ b(TRUE) | SupportsDigitalis b(TRUE) |
Tech limit names: (not case sensitive) EnergyStorage, ACStorage, PacketSpeed, EnergyEfficiency, OreEfficiency, BuildSpeed, MoveSpeed, FireRate, FireRange.
key codes: http://docs.unity3d.com/Documentation/ScriptReference/KeyCode.html
Commands | ||
---|---|---|
GetMouseScreenPixelPosition x y | GetMouseScreenPosition x y | |
s GetKey b | s GetKeyDown b | s GetKeyUp b |
b EnableAlternateControlMode | ||
b EnableNormalMouse | b EnableNormalKeyInput | b EnableNormalZoomControl |
GetCurrentBuildTab s | ||
s x y CreateIndicatorArrow | s DestroyIndicatorArrow | |
s s s s x y ShowGameEventTag | ||
s x y ShowMessage | s x y ShowMessageDismissible | WasMessageDismissed b |
ScreenHeight y | ScreenWidth x | |
b SetScreenMode | x y SetScreenCoords | x y SetScreenPixelCoords |
GetCameraPosition x y | x y SetCameraPosition | |
GetCameraZoom i | i(4) SetCameraZoom | |
s SetText | iORs SetTextAnchor | i i i i SetTextColor |
f(1) SetTextSize | x SetTextX | y SetTextY |
Builtin Functions |
---|
:UserCancelAction |
Build tabs: STRUCTURE, WEAPONS, TITANS, ORBITAL.
Text Anchors: 0=UpperLeft, 1=UpperCenter, 2=UpperRight, 3=MiddleLeft, 4=MiddleCenter, 5=MiddleRight, 6=LowerLeft, 7=LowerCenter, 8=LowerRight.
Builtin Functions |
---|
:ShowMessageDialogCallback |
Speakers: 0=Skarsgard Abraxis, 1=Lia, 2=Loki Hive, 3=Abrax… Imper…???, 4=Loki Imperator, 5=Aliana, 6=(nameless man with red background), 7=(nameless man with green background).
Commands | ||
---|---|---|
CreateList l | i CreateListStartingSize l | |
l GetListCount i | l i GetListElement * | l i * SetListElement |
l i * InsertListElement | l i RemoveListElement | |
l * AppendToList | l * PrependToList | |
x y GetTerrain i | x y i SetTerrain | |
x y GetTerrainOverride i | x y i SetTerrainOverride | |
x y GetWall f | x y f SetWall | |
x y GetVoid b | x y b SetVoid | |
x y GetDigitalisGrowth b | x y b SetDigitalisGrowth | |
x y GetCellOccupiedCount i | x y i SetCellOccupiedCount | |
f(.2) SetCreeperFlowRate | f(1) SetCreeperFlowRateOnDigitalis | |
f SetCreeperFlowRateRL | f SetCreeperFlowRateOnDigitalisRL | |
f SetCreeperFlowRateUD | f SetCreeperFlowRateOnDigitalisUD | |
i i SetWind | i(1000) SetCreeperEvaporationLimit | |
i(0) SetCreeperMax | i(0) SetAntiCreeperMax | |
x y GetPinFieldCell b b | x y b b SetPinFieldCell | |
x y i i i i SetFieldCell | x y GetFieldCell i i i i |
Commands | ||
---|---|---|
ClearStack | StackSize i | |
* Trace | * * Trace2 | * * * Trace3 |
* * * * Trace4 | * * * * * Trace5 | TraceStack |
ShowTraceLog | ClearTraceLog | HideTraceLog |
GetUpdateCount i | ElapsedTime f | |
b PersistCore | s NotPersist | InvocationCount i |
IsEditMode b |
CONSTANTS | |
---|---|
*special* E f |