poryscript

High-level scripting language for gen 3 pokemon decompilation projects

MIT License

Stars
176

Bot releases are visible (Hide)

poryscript - 3.4.0.2-autovars Latest Release

Published by github-actions[bot] 2 months ago

Preview build for upcoming autovars feature.

poryscript - 3.3.0

Published by github-actions[bot] 9 months ago

  • Add ability to configure number of lines used by format(). For example, this is useful if the text is intended to render in, a 3-line textbox (instead of the usual 2).
    • Additionally, format() now accepts named parameters, and numLines has been included in font_config.json.
poryscript - 3.2.0

Published by github-actions[bot] 11 months ago

[3.2.0] - 2023-12-02

Added

  • Add -lm option for C Preprocessor line markers to improve error messages.
    • -lm is enabled by default. You can specify -lm=false to disable line markers in the compiled output.
poryscript - 3.1.0

Published by github-actions[bot] 11 months ago

Added

  • Add support for configuration of the textbox's cursor width to improve format()'s ability to fit text on a line.
    • This is achieved with a new cursorOverlapWidth field in font_config.json
    • Note, this change also changed the maxLineLength of the 1_latin_frlg font, so existing uses of format() could be affected--especially when used in combination with explicit line breaks inside the format() text content.
  • Add automatic line break (\N) support to format()
poryscript - 3.0.3

Published by github-actions[bot] about 1 year ago

Fixed

  • Fix bug where specifying a non-default font id with format() would apply the wrong maximum line width configuration.
poryscript - 3.0.2

Published by github-actions[bot] over 1 year ago

Fixed

  • Fix bug where a switch statement with all empty case bodies would produce invalid output.
poryscript - 3.0.1

Published by github-actions[bot] almost 2 years ago

Fixed

  • Fix bug where end and return commands could cause labels to not render.
poryscript - 3.0.0

Published by github-actions[bot] almost 2 years ago

Changed

  • Font configuration file is now called font_config.json, and each font in that file contains a maxLineLength used by format(). The command-line option -fw has been renamed to -fc to reflect the new name of the font configuration file.
poryscript - 2.14.0

Published by github-actions[bot] over 2 years ago

Added

  • Add the ability to define sub-labels inside script statements. This is useful in some cases where it's more ergonomic to directly jump to a desired location inside a script, similar to C's goto labels.
poryscript - 2.13.0

Published by github-actions[bot] over 2 years ago

Added

  • Add mart statement, which is a convenient way to define a list of items used with the decomp's pokemart script command. Prior to this addition, the mart data had to be encoded using Poryscript's raw statement.
poryscript - 2.12.0

Published by github-actions[bot] almost 3 years ago

Added

  • Add value() operator, which can be used on the right-hand side of a var() comparison. It will force a compare_var_to_value command to be output. This makes it possible to compare values that occupy the same range as vars (0x4000 <= x <= 0x40FF and 0x8000 <= x <= 0x8015).
  • Add ability to author inifinite loops using the while statement without any boolean expression.
poryscript - 2.11.0

Published by github-actions[bot] almost 3 years ago

Added

  • Added -l command-line option to define default line length for formatted text.
  • Added -f command-line option to define default font id from font_widths.json for formatted text.
poryscript - 2.10.0

Published by github-actions[bot] over 3 years ago

Added

  • Added ability to specify custom directives for text. (e.g. ascii"My ASCII text" will result in .ascii "My ASCII text\0")
poryscript - 2.9.0

Published by github-actions[bot] about 4 years ago

Added

  • Added optional maximum line length parameter to format() operator.
poryscript - 2.8.1

Published by github-actions[bot] over 4 years ago

Fixed

  • Fix bug where switch statement default case didn't work properly when combined with other cases.
poryscript - 2.9.0-gen2-preview

Published by github-actions[bot] over 4 years ago

First preview release for pokecrystal support. The README has not been updated to reflect the few differences between Gen 3 and Gen 2 syntax. Most of the README is still valid for Gen 2, though.

When running Poryscript, specify the -gen 2 command line option. It runs in -gen 3 mode by default, which is for the Gen 3 decomp projects (e.g. pokeemerald).

Example command:

poryscript.exe -gen 2 -i test.pory -o test.asm

Some examples of valid Gen 2 syntax:

script MyScript {
    if (myarbitrarycommand(param1) == 4) {
        ...
    } else if (othercommand || !randomcommand) {
        ...
    }
}

mapscripts MyMapscripts {
    scenes [
        { } // dummy script
        Scene2Script // label, instead of inlining script
        { // inlined script
            prioritysjump("other")
        }
    ]
    MAPCALLBACK_NEWMAP {
        if (checkflag(ENGINE_BUG_CONTEST_TIMER)) {
            setscene("other")
        } else {
            setscene("third")
        }
    }
    MAPCALLBACK_OBJECTS {
        switch (readvar(VAR_WEEKDAY)) {
            case TUESDAY:
            case THURSDAY:
            case SATURDAY:
                appear("whatever")
                disappear("whatever")
                disappear("other")
                return
            default:
                if (checkflag(ENGINE_BUG_CONTEST_TIMER)) {
                    setscene(SCENE_ROUTE35NATIONALPARKGATE_LEAVE_CONTEST_EARLY)
                } else {
                    disappear(ROUTE35NATIONALPARKGATE_OFFICER1)
                    appear(ROUTE35NATIONALPARKGATE_YOUNGSTER)
                    appear(ROUTE35NATIONALPARKGATE_OFFICER2)
                }
        }
    }
}
poryscript - 2.8.0

Published by github-actions[bot] over 4 years ago

Added

  • Add ability to use the NOT (!) operator in front of nested boolean expressions. Example:
if (flag(A) && !(flag(B) || flag(C)))
poryscript - 2.7.2

Published by github-actions[bot] almost 5 years ago

Fixed

  • Fix bug where implicit text labels weren't properly inserted into command arguments.
poryscript - 2.7.1

Published by github-actions[bot] almost 5 years ago

Fixed

  • Fix bug where control codes with spaces in them (e.g. {COLOR BLUE}) were not handled properly in format().
poryscript - 2.7.0

Published by github-actions[bot] almost 5 years ago

Added

  • Add support for compile-time switches using the poryswitch statement. This helps with language differences or game-version differences, for example.
  • Add support for user-defined constants with const keyword. This helps with things like defining event object ids to refer to throughout the script.