Shell as a Service
![[PokeCommunity.com] Shell as a Service [PokeCommunity.com] Shell as a Service](https://i.imgur.com/8EvsIoM.gif)
Originally built for my fangame, Pokémon as a Service, Shell as a Service is a developer tool that offers an environment for debugging and extending the game's capabilities during runtime (plus it's nice for just messing around in general). This resource is still a work-in-progress and will contain some minor bugs, but it should be more than ready for prime time.
Marin's Utilities are required. Get it here:
Marin's Utilities
Download Shell as a Service here:
Download
Marin's Utilities
Download Shell as a Service here:
Download
The Sessions
A bare-bones console session can be started with ConsoleSession.new at any time. Those looking to start a console session upon bootup should place the code somewhere in Main, preferably at the top of the section. There is an additional ConsoleSession_Interactive class that displays some minor information during startup, but otherwise behaves the same.
An additional ConsoleSession_Ingame class is supplied, accessible at any time while pressing CTRL + S in-game. There are commands exclusive to this class, and a couple that can not be accessed from it. More on those later.
The Commands
Shell as a Service functions similarly to Unix shells like Bash or Zsh. To give a command, enter its name and any potential arguments:
![[PokeCommunity.com] Shell as a Service [PokeCommunity.com] Shell as a Service](https://i.imgur.com/5R2MdZv.png)
Passing invalid commands or arguments results in an error:
![[PokeCommunity.com] Shell as a Service [PokeCommunity.com] Shell as a Service](https://i.imgur.com/kJeVL2O.png)
The shell ignores all excess whitespace. Surround your argument in double quotes to include the whitespace, like this:
![[PokeCommunity.com] Shell as a Service [PokeCommunity.com] Shell as a Service](https://i.imgur.com/e1zYhio.png)
When using the eval command, either use single quotes or escaped double quotes when dealing with strings:
![[PokeCommunity.com] Shell as a Service [PokeCommunity.com] Shell as a Service](https://i.imgur.com/mVO5mFy.png)
String together multiple commands with ; or &&:
![[PokeCommunity.com] Shell as a Service [PokeCommunity.com] Shell as a Service](https://i.imgur.com/Qu4NiH5.png)
Some commands take optional options. For example, the echo command accepts three possible options:
- --align / -a (integer): text alignment (0 = left, 1 = center, 2 = right)
- --raw / -r: special codes like \n, \t and \h are not parsed
- -n: the trailing newline is omitted
![[PokeCommunity.com] Shell as a Service [PokeCommunity.com] Shell as a Service](https://i.imgur.com/rn2koWo.png)
All options can be passed at once, too.
![[PokeCommunity.com] Shell as a Service [PokeCommunity.com] Shell as a Service](https://i.imgur.com/jq6ssn8.png)
Oh, and there's aliasing as well!
![[PokeCommunity.com] Shell as a Service [PokeCommunity.com] Shell as a Service](https://i.imgur.com/scCWj5F.png)
There are certain commands that take subcommands. For example, the config command has five different subcommands. If you are feeling a little overwhelmed, don't worry! The help command is here to, well, help!
![[PokeCommunity.com] Shell as a Service [PokeCommunity.com] Shell as a Service](https://i.imgur.com/WchqpDq.png)
Here's what the subcommands look like in action:
![[PokeCommunity.com] Shell as a Service [PokeCommunity.com] Shell as a Service](https://i.imgur.com/vQ11qDd.png)
Some commands, like item and pkmn are only accessible inside an in-game session. There are two commands that are only accessible outside the game:
Restoretool & Wipetool
![[PokeCommunity.com] Shell as a Service [PokeCommunity.com] Shell as a Service](https://i.imgur.com/T7IpGfa.png)
Restoretool and Wipetool are console applications designed for backing up, restoring and removing save data. All backups go into their own folder called SaveBackup. Restoretool creates this folder for you. Both of these applications are very basic, and I will be improving them in the future.
Multieval
Multieval is a special command that allows for multi-line code input. This allows you to modify your game's code during runtime. However, please note that changes made with Multieval are not saved and thus will not persist after the game closes.
![[PokeCommunity.com] Shell as a Service [PokeCommunity.com] Shell as a Service](https://i.imgur.com/O99bSXz.png)
Creating new commands is simple. As a demonstration, here's me creating a new console command inside the console:
![[PokeCommunity.com] Shell as a Service [PokeCommunity.com] Shell as a Service](https://i.imgur.com/bJ2qgTd.gif)
The SAAS_Core script section contains lengthy documentation regarding the ConsoleBase and ConsoleCommand classes as well as the CommandValidation module. If you're interested in extending SAAS, consider reading it.
Have fun!
![[PokeCommunity.com] Shell as a Service [PokeCommunity.com] Shell as a Service](https://i.imgur.com/OculhMu.gif)
Last edited: