• 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.

Poryscript | Scripting Language for the Decompilation Projects

330
Posts
10
Years
  • Age 32
  • Seen Mar 29, 2024
What is Poryscript?

Poryscript is an improved scripting language that can be used with pokeemerald, pokeruby, and pokefirered. It provides higher-level control with "if" statements, inline text, and much more. It's used by prominent projects such as CrystalDust and Sovereign of the Skies.

Here is an example that demonstrates a simple script that is improved when written with Poryscript:
Code:
script LittlerootTown_RivalHouseSign {
    lockall
    checkplayergender
    if (var(VAR_RESULT) == MALE) {
        msgbox("It's MAY's house.")
    } else {
        msgbox("It's BRENDAN's house.")
    }
    releaseall
}
Compared to what it might look like with vanilla scripting:
Code:
LittlerootTown_RivalHouseSign::
    lockall
    checkplayergender
    compare VAR_RESULT, MALE
    goto_if_eq LittlerootTown_RivalHouseSign_Male
    msgbox LittlerootTown_RivalHouseSign_Text_BrendanHouse
LittlerootTown_RivalHouseSign_Exit:
    releaseall
    end

LittlerootTown_RivalHouseSign_Male:
    msgbox LittlerootTown_RivalHouseSign_Text_MayHouse
    goto LittlerootTown_RivalHouseSign_Exit

LittlerootTown_RivalHouseSign_Text_MayHouse:
    .string "It's MAY's house.$"

LittlerootTown_RivalHouseSign_Text_BrendanHouse:
    .string "It's BRENDAN's house.$"
As you can see, Poryscript automatically handles the tedious "goto" branching for you. It has many other benefits, such as automatic text formatting.

How to use?

Poryscript is intended to be setup along with your build in the Makefile. This way, the Poryscript compiler is automatically run on your scripts each time you build your ROM. For instructions on setting it up, read the README on the GitHub page. It explains exactly how to modify your project's Makefile.

Links

Full documentation and setup instructions are available in its GitHub repository. There are precompiled builds available in the Releases section:
https://github.com/huderlem/poryscript#readme

An interactive online playground can be found here:
https://www.huderlem.com/poryscript-playground/
 
Back
Top