Sensor
Sensor # 122 ![]() | |
Robotic name | Sensor
|
Default color | none |
Default param | storage object ID |
ID char | 0 (#122) |
ID anim. chars | Uses Sensor character |
Attributes | Pushable: all |
Special when stood on |
Player can move onto Sensor |
Special when pushed |
Player can be pushed onto Sensor |
Movement | Can push Can move on Lava Can move on Fire Can move on water Interacts with Player |
Sensor (ID 122, Sensor
) is a built-in object. Sensor is a special floor: the Player (and only the Player) can stand on it, move onto it, and be pushed onto it. Sensors can be moved by a Robot and send labels to Robots in certain circumstances.
Sensors are storage objects—like Robots—which means they can not be created or modified through Robotic and must be pre-made in the editor. Unlike Robots, they do nothing on their own, and must be managed externally by a Robot.
If the board option Can save is set to "Can save on sensors", saving will be disabled on that board unless the Player is standing on any Sensor.
Usage
Sensors can detect when the Player moves onto them, which is useful for implementing some types of pressure plates. Saving can also be configured per-board to only work when the Player is standing on a Sensor, which can be used to implement save points.
Sensors are direly limited as a floor: since they are not really a floor, most things refuse to move on top of them or will push them out of place. This prevents them from being used to implement Sokoban-like pressure plates. Bullet and other projectiles can not pass over them; custom Robot-based projectiles will instead push save point Sensors around. Finally, there can be at most 255 Sensors on a board, which limits their use for making Player-only zones.
For these reasons—and also due to their historical bugginess—they are rarely used in practice outside of very simple games.
Parameters
Sensor name: name used by Robots to send this Sensor commands.
Robot to message: name to which this Sensor will send labels. All Robots with this name will receive labels from the Sensor.
Sensor character: display character.
Sensor labels
SENSORON
SENSORON is sent to Robot to message if the Player moves onto or is moved onto the Sensor.
SENSORPUSHED
SENSORPUSHED is sent to Robot to message if the Sensor is pushed by another thing.
SENSORTHUD
SENSORTHUD is sent to Robot to message if the Sensor is sent a command to move, but is blocked. If the Robot that sent the movement command receives this label, it will interrupt whatever the Robot would have done after sending the command.
Sensor commands
Sensor commands are sent using the SEND "name" TO "label" command. Sensors will ignore any value provided to the label command parameter that isn't a real command.
If "ALL" (case-insensitive) is provided for the name, all Sensors will receive the sensor command. Otherwise, only Sensors whose Sensor name matches the provided name will receive the command.
If the name provided to the command matches a Robot's name and the sensor command matches a label in that Robot, it will receive that label in addition to any matching Sensor receiving that command.
N
The command N makes the Sensor attempt to move north. If the Player is standing on top of the Sensor, the Player will move with it on success.
S
The command S makes the Sensor attempt to move south. If the Player is standing on top of the Sensor, the Player will move with it on success.
E
The command E makes the Sensor attempt to move east. If the Player is standing on top of the Sensor, the Player will move with it on success.
W
The command W makes the Sensor attempt to move west. If the Player is standing on top of the Sensor, the Player will move with it on success.
DIE
The command DIE destroys the Sensor, preserving whatever thing was beneath it (even if the Player is standing on it).
CHAR#
The command CHAR# changes the Sensor character of the Sensor. It accepts the following formats:
- If the full string of the command is CHAR[number] (for example "CHAR192"), the character will be set to the provided ASCII number (MODULO 256). Any non-numeric characters after the number are ignored.
- If the full string of the command is CHAR'[single char]' (for example "CHAR'x'"), the character will be set to the exact char provided.
- If the string of the command is just CHAR, the character will be set to 0.
COLOR#
The command COLOR# changes the display color of the Sensor.
- When provided the string COLOR[hexadecimal number] (for example "COLORe9"), the color will be set to the provided color pair (MODULO 256). Any non-hexadecimal characters after the number are ignored.
- If the string of the command is just COLOR, the color will be set to 0.