Table of Contents

4RPL Scripting Language

Want to get started? Read the Overview, or see some Tutorials. Also some help for testing Mverse scripts.

API reference

Variables

$init_var (define)
$$init_var (define)
<-var (read)
->var (write)
-?var (exists)
--var (delete)
<-! (ref read)
->! (ref write)
-?! (ref exists)
--! (ref delete)
Clear Locals | Globals
Copy
DeepCopy
NotPersist

Special var syntax
· Global variables
· Vectors
· Lists
· Tables

Comparators

Note2)
eq
eq0
gt
gt0
gte
gte0
lt
lt0
lte
lte0
neq
neq0



Named Collections
· Unit Types
· Sounds

Logic

Note3)
and
not
or
xor
true
false








Tables

See Special syntax
ClearTable
CreateTable
GlobalTable Get | Set
RemoveTableElement
Table
TableContainsKey
TableCount Get
TableElement Get | Set
TableElementRPN Set
TableKeys Get
TableN
TableValues Get


Timers

Timer0 Get | Set
Timer1 Get | Set
Timer2 Get | Set
Timer3 Get | Set
TimerObeyPause0 Set
TimerObeyPause1 Set
TimerObeyPause2 Set
TimerObeyPause3 Set


Game

ADALogOpen Get | Set
ApplyToDamageMap
BuildUnit Get
BounceFadeBlack
Cancel
CanMoveUnits Get | Set
CloseGameMessage
CModEditMenuName Set
CModPlayerMenuName Set
CreeperGraphAvailable Set
DamageMesh
DarkCell Get | Set
DepartButtonAvailable Set
EcoCounts Get
EditMode Get
EnergyBonus Get
EnergyEco Get
EnergyGeneration Get
EnergyStore Get
EnergyUse Get
ElapsedTime
FieldCell Get | Set
FieldRect Set
FinalDialogOpen Get
FindUnitEnemy
GameFrameCount Get
GameMessageText Set
GameTickCount Get
GameUpdateCount Get
GenerateEnergy
InvocationCount
IsADAMessageRead
IsADAMessageShowing
IsBuildUnitSelected
IsGameMessageShowing
IsV2InMap
IsV3InMap
LastExecutionCount Get
MapSize Get
MeshHealth Get | Set
NearestAirSac Get
NearestSniperTarget Get
NearestSpore Get
OpenBuildTab Get
OrbitalCount Get | Set
Pause Get | Set
RandMapCell Get
RefreshUnitLosCache
RemoveUnitDamageMap
SelectedUnits Get
ShowADAMessage
ShowADAMessageAtCell
ShowADAMessageAtUnit
ShowGameMessage
ShowUIIndicator
SoylentCount Set
SoylentDelay Set
SoylentMode Get | Set
StopConsole
SuppressTotemActivation
TerraformActiveCell Set
TerraformDigSite Get
TerraformMarker Get | Set
TerraformMenuOpen Get
TimeString Get
UnderCreeperEffectEnabled Get | Set
UnitsSelectable Set

Unit

Note5)
AllLegalUnitCells Set
CellOccupiedCount Get | Set
ClearUnitStun
ConstructUnit
CreateUnit
CreateUnitOnTerrain
DamageUnit
DeployUnitShield
DestroyUnit
LegalUnitCells Set
MinerMode Get
MoveTowardsAndAvoid
MoveTowardsCellAndAvoid
NearestSpecialTarget Get
RotateUnit
RotateUnitTowards
RotateUnitTowardsCell
Script1Var Get | Set
ScriptVar Get | Set
SpecialTargets Get
StunUnit
StunUnitsInRange
TotemActivated Get | Set
UnitAmmoWare Get | Set
UnitBuildLimit Get | Set
UnitBuildWare Get | Set
UnitCanBuild Get | Set
UnitCell Get | Set
UnitConnectedToRiftLab Get
UnitConstructing Get
UnitConstructingData Get
UnitCount Get
UnitDebugText Set
UnitERNSimulated Get |Set
UnitForward Get | Set
UnitInCreeper Get
UnitIgnoreDark Get | Set
UnitMiniMapImage Set
UnitMiniMapImageColor Set
UnitMiniMapText Set
UnitMiniMapTimeToEvent Set
UnitMoveCell Get | Set
UnitOrientation Get | Set
UnitOutlineColor Set
UnitOutlineEnabled Set
UnitOutlineMode Set
UnitOutlineWidth Set
UnitPopupEnabled Set
UnitPopupText0 Set
UnitPopupText1 Set
UnitPosition Get | Set
UnitRotation Get | Set
UnitsByType Get
UnitSelectable Get | Set
UnitSelected Get | Set
UnitShieldRange Get | Set
UnitShieldVisible Set
Units Get
UnitsInRange Get
UnitSettings Get | Set
UnitSpecifiedTarget Get | Set | Clear
UnitSpecifiedTargetOccupiesMap Set
UnitSpecifiedTargetPathHeight Set
UnitSpecifiedTargetPathSourceOffset Set
UnitSpecifiedTargetShowPath Set
UnitSuppressedMovement Get | Set
UnitType Get
UnitTrueGuid Get
UnitUIOptions Get | Set
UnitUIState Get | Set
UnitUIText Get | Set
UnitWantsErn Get | Set
UseLegalUnitCells
WallCharged Set

Unit Attributes

AddAsWareHolder
RemoveAsWareHolder
UnitAmmo Get | Set
UnitAnticreeperDamages Get | Set
UnitArmed Get | Set
UnitCanDestroy Get | Set
UnitCanMove Get | Set
UnitCanStun Get | Set
UnitConnectable Get | Set
UnitCreeperDamages Get | Set
UnitDamagedByAC Get | Set
UnitDamagedByCreeper Get | Set
UnitDestroyed Get
UnitDestroyUnevenLand Get | Set
UnitEnabled Get | Set
UnitERNState Get
UnitFireOffset Get | Set
UnitFootprintResistsCreeperHeight Get | Set
UnitGrowsMesh Get | Set
UnitHealRate Get | Set
UnitHealth Get | Set
UnitLOSEnabled Get | Set
UnitMaxAmmo Get | Set
UnitMaxHealth Get | Set
UnitOccupiesLand Get | Set
UnitOfficialName Get
UnitPacketRequestRate Get | Set
UnitModRanges Set
UnitRange Get | Set
UnitRangeWithMods Get
UnitRequestPackets Get | Set
UnitSpecialTarget Get | Set
UnitStunCount Get | Set
UnitSupplied Get | Set
UnitSuppressCount Get | Set
UnitTargetOffset Get | Set
UnitUpdateCount Get


Unit Objects

CreateTrail
DestroyTrail
ObjActive Get | Set
ObjColor Get | Set
ObjFacingAngle Get
ObjFacingAngleCell Get
ObjForward Get | Set
ObjLightConeVisible Set
ObjPosition Get | Set
ObjRotation Get | Set
ObjScale Get | Set
ObjText Set
ObjTextBillboard Set
ObjTextColor Set
ObjTextFontSize Set
RotateObj
RotateObjTowards
RotateObjTowardsCell

Beams

AttachBeam
BeamBrightness Set
BeamColor Set
BeamEnd Set
BeamForceLocalEnd Set
BeamStart Set
BeamVisible Set
BeamWidth Set
CreateBeam
DestroyAllAttachedBeams
DestroyAllBeams
DestroyBeam
IsBeam
UnattachBeam

IO

CameraMode Get
CameraPosition Get | Set
CameraRotation Get | Set
CameraTopDown Get | Set
Key Get
KeyDown Get
MapPanEnabled Set
MappedKey Get
MappedKeyDown Get
MappedKeyStrings Get
MapRotateEnabled Set
MapZoomEnabled Set
MouseButton Get
MouseButtonDown Get
MouseButtonUp Get
MouseDelta Get
MouseScrollDelta Get
PointerTerrainCoords Get
ResetCamera
RPLCam Set
RPLCamCursorLock Set
RPLCamForward Get | Set
RPLCamRight Get | Set
RPLCamUp Get | Set
RPLCamCopyPosAndRot
RPLCamPosition Get | Set
RPLCamRotation Get | Set
RPLCamTween
RPLCamTweenLookAt

Theme

ApplyTheme
ThemeCliffLight Get | Set
ThemeCliffLightBoost Get | Set
ThemeCliffNormal Get | Set
ThemeCliffNormalAmt Get | Set
ThemeCliffNormalScale Get | Set
ThemeCliffScale Get | Set
ThemeCliffTexture Get | Set
ThemeNormal Get | Set
ThemeNormalAmt Get | Set
ThemeNormalScale Get | Set
ThemeOverlayApplyToCliffs Set
ThemeOverlay Clear | Create | Destroy
ThemeOverlayColor Set
ThemeOverlayEnabled Set
ThemeOverlayOffset Set
ThemeOverlayRectPixels Set
ThemeOverlayPixels Set
ThemeOverlayPointFilter Set
ThemeOverlayScale Set
ThemeTexture Get | Set
ThemeTextureDeTile Get | Set
ThemeTextureLight Get | Set
ThemeTextureLightBoost Get | Set
ThemeTextureScale Get | Set


Terrain

BounceEdgeCollision
BounceTerrainCollision
ExactTerrain Get
ExactTerrainAndNormal Get
ExactTerrainWithShield Get
FloodFillTerrain
Terrain Get | Set
TerrainInRange Set
TerrainLine Set
TerrainLOS Get
TerrainOverride Get | Set
TerrainSpecial Get | Set
TerrainVector Get
VoidHeight Get | Set


Creeper

AddCreeperWithCap
AddCreeperWithCapInRange
ClipCreeperLine
ConvertACToCreeper
ConvertCreeperToAC
Creeper Add | Get | Set
CreeperCoverage Get
CreeperCutoff Get | Set
CreeperInRange Add | Get | Set
CreeperWithDamageMap Get
Crimson Get | Set
DamageCreeper
ExactCreeperHeight Get
Flow Get | Set
IsCreeperCutoff
MaxACCell Get
MaxCreeperCell Get
MaxCreeperCellWithDamage Get
MinACCell Get
MinCreeperCell Get
MinCreeperCellWithDamage Get
TotalAC Get
TotalCreeper Get

Mission

AcquireMissionObjective
CustomObjectiveText Set
EndMission
IsMissionComplete
MissionObjectiveEnabled Get | Set
MissionObjectiveRequired Get | Set
MissionObjectiveState Get
MissionScanComplete Get

Decals

DecalVisible Get | Set
DecalColor Get | Set
DecalSize Get | Set
DecalPosition Get | Set


MVerse

MVerseCreatesUnitGhost Set
MVersePlayers Get
MVersePlayerNum Get
MVerseSendCreeperChanges Set
SendMVerseMsg

Core Units

ERNPortal Get
ERNPortalEfficiency Get
Factory Get
FactoryWares Get | Set
RiftLab Get

Messaging

DeregisterForMSG
DeregisterScript
MSGButton Set
RegisterForMSG
RegisterScript
RegisteredScriptVar Get | Set
SendMsg


Meta

DeleteMCSEntry
MCSEntries Get


1), 2), 3) alternate notation in symbol_aliasing
4) Output to the RPL.txt file is only produced if the game is in Edit mode. In normal circumstances, no output will be produced.
5) Rift Lab, ERN Portal, and Factory are in Core Units