• Our software update is now concluded. You will need to reset your password to log in. In order to do this, you will have to click "Log in" in the top right corner and then "Forgot your password?".
  • Welcome to PokéCommunity! Register now and join one of the best fan communities on the 'net to talk Pokémon and more! We are not affiliated with The Pokémon Company or Nintendo.

Shell as a Service

Savordez

It's time to end fangames.
115
Posts
10
Years


  • Shell as a Service

    Shell as a Service


    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

    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:

    Shell as a Service


    Passing invalid commands or arguments results in an error:

    Shell as a Service


    The shell ignores all excess whitespace. Surround your argument in double quotes to include the whitespace, like this:

    Shell as a Service


    When using the eval command, either use single quotes or escaped double quotes when dealing with strings:

    Shell as a Service


    String together multiple commands with ; or &&:

    Shell as a Service


    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

    Shell as a Service


    All options can be passed at once, too.

    Shell as a Service


    Oh, and there's aliasing as well!

    Shell as a Service


    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!

    Shell as a Service


    Here's what the subcommands look like in action:

    Shell as a Service


    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

    Shell as a Service

    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.

    Shell as a Service


    Creating new commands is simple. As a demonstration, here's me creating a new console command inside the console:

    Shell as a Service


    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!

    Shell as a Service

     
    Last edited:

    Savordez

    It's time to end fangames.
    115
    Posts
    10
    Years


  • 0.8.0: mkxp-z compatibility

    Shell as a Service


    NEW FEATURES
    • Proper mkxp-z compatibility
    • New console commands can be set as mkxp-z exclusive
    • New mkxp-z exclusive command, sysinfo
    • Added copying and pasting in mkxp-z

    Shell as a Service


    ADJUSTMENTS
    • version now displays Ruby version & platform
    • ConsoleCommand#run and ConsoleCommand#main moved to CommandBase
    • New SAASUtils module for utility functions (currently houses one function: SAASUtils::reboot)

    BUG FIXES
    • Fixed instances where the text entry sprite was redrawn unnecessarily
    • Fixed CONSOLE_DEFAULT_FONT being completely ignored
    • Fixed command aliases "man" and "print" not being set
    • Fixed exportmap being accessible outside Debug mode
    • Other minor fixes

    Download


     
    Back
    Top