User Tools

Site Tools


<- PRPL reference <- Upgrade Notes

Accessor Notation (AcNot)


Accessor Notation is a new feature in PRPL. It provides a simpler way to access the properties of units than in CRPL. Whereas in CRPL one would get/set unit attributes with:

# Set Unit Attribute
<-UID CONST_UNITATTRIBUTE <-Value SetUnitAttribute
# Get Unit Attribute

PRPL allows a much faster notation styled after object property accessors in object-oriented programming languages:

# Set Unit Attribute
<-Value ->UID.Attribute
# Get Unit Attribute

This has the advantage of being easier to read and identify, as well as the fact that all valid property tokens are not case-sensitive:

# These are treated the same

Note that Ships, Particles and Units are considered distinct; their IDs are generally referred to as SID, PID and UID respectively, and are each obtained with different commands. See GetAllShipsInRange, GetParticlesInRange and GetAllUnitsInRange.


Attribute Description Get Set
ShipHasAmp Whether the ship has an amp gem mounted.
Cannot Be Set
ShipIsEnemy Whether the ship is an enemy. Warning: using this on player ships can cause strange behaviour.
<-Value ->UID.ShipIsEnemy
Attribute Description Get Set
- desc
Tables for Particle, Unit and Ship here. Keep Separate!


prpl/accessornotation.txt · Last modified: 2017/10/27 18:24 by GameGibu