Paisley (Plasma Build)

Note: this only applies to the Plasma build of Paisley. Most features are supported, but some are disallowed, and are specified below the FAQ.


PAISLey (Plasma Automation / Instruction Scripting Language) is a scripting language designed to allow for easy command-based behavior scripting. The purpose of this language is NOT to be fast. Instead, Paisley is designed to be a simple, light-weight way to chain together more complex behavior (think NPC logic, device automation, etc.). This language is meant to make complex device logic very easy to implement, while also being as easy to learn as possible.


FAQ

Q: Why not use Lua instead?
A: The biggest advantage Paisley has over Lua nodes is that the script does not require any “pausing” logic that one would have to implement in order to get the same functionality in Lua; the Paisley runtime will automatically pause execution periodically to avoid Lua timeouts or performance drops, and will always wait on results from a command before continuing execution.

Q: Why not use sketch nodes instead?
A: Paisley was designed as a language for scripting NPC behavior, and the thing about NPCs is that their behavior needs to be able to change in response to various events. First off, when using just sketch nodes, dynamically changing an NPC’s programming is downright impossible. Second, connecting all the nodes necessary for every possible event is difficult and time consuming (for example NPC chatter, a sequence of movements, events that only happen ONCE, etc). TL;DR: NPC logic is difficult to implement using just sketch nodes. Trust me, I’ve done it.

Q: How do I connect the Paisley engine to my device?
A: Get the Paisley Engine device from the Steam workshop (ID 3087775427), and attach it to your device. Then in a different controller, set the inputs (Paisley code, a list of valid commands for this device, and optional file name), and make sure the “Run Command” output will eventually flow back into the “Command Return” input. Keep in mind this MUST have a slight delay (0.02s at least) or Plasma will detect it as an infinite loop!

Q: Why???
A: haha

Q: Isn’t writing an entire compiler in Plasma a bit overkill?
A: Your face is overkill. Compilers are fun, fight me.


Differences from the main build.

Compiler Differences: - The require statement is not supported when compiling code inside Plasma, as there is no arbitrary file system. However, it may be used when compiling code outside Plasma and copying the bytecode output into Plasma. - Command piping (cmd1 | cmd2 > file1 < file2) is not supported. Any pipe operators are treated as plain text.

The following commands will not work in the Plasma build, unless the commands are defined in the target device: - Any shell commands, !, ?, ?! or =. - clear - stdin - stdout - stderr

The following functions will not work in the Plasma build: - toepoch - fromepoch - epochnow - file_glob - file_exists - file_size - file_read - file_write - file_append - file_delete - dir_create - dir_list - dir_delete - file_type - file_stat - file_copy - file_move

Note that all commands take a little bit of time to run (at least 0.02s), whether they’re built-in or not. This is to prevent “infinite loop” errors or performance drops. The only exception to this is the . no-op command. It does not actually interact with the outside world, so it will complete immediately.

Escape sequences

All escape sequences work the same, however internally the emoji sequences are represented differently. Instead of unicode symbols, they’re stored as <sprite=XX> tags. The following escape sequences are changed in the Plasma version: