[Tools]PyEA, a pythonified replacement of Event Assembler (WIP)

Event Assembler has been pretty stagnant for many years so I think it’s time to replace it. PyEA uses pure python scripting to do things similar to EA, with the goal of simulating the syntax of event assembler script but streamlining the poorly designed parts of it.

THIS IS NOT A COMPLETE PROJECT SO IF YOU JUST WANT TO HACK A ROM, STAY HYPED, NOTHING MORE TO SEE HERE

If you are interested, please contribute to this project.

FAQ:

Why Python?

Python is an awesome language that works surprisingly similar to EA. When you include a file in python, it runs the script immediately, similarly to EA script’s #include. Python also has some great libraries like numpy and PIL which is instrumental to the project. Python also has the benefit of being completely cross-platform which is a added bonus.

The downside is although python has great language features like reflection, with block and decorators to spice things up, there will be significantly more parentheses in python code compared to EA, there’s nothing I can do about it.

What's New?

Since python is a scripting language, you will gain full access to the power of scripting, and features like for loops and functions that are missing from EA for the longest time. Since we have the feature to read from the rom, it’s easy to create a buildfile that doubles all characters’ growth rates or reorder all item icon’s id to (item id - 1), which was impossible to do with EA.

PyEA can import files without turning them into dmps manually or build them at compile time, we use caching to save build time. Most of EA’s toolkit has been assimilated into PyEA directly as native python, with a performance or user friendliness upgrade.

Requirements

Python Modules:
numpy, PIL, varname, javaobj-py3 (optional: PyFastGBALZ77)

Other:
devkitpro

What can it do at this moment

PyEA can replace most csv features, edit text, and install most standable hacks that doesn’t require Lyn.

Completion Status:

Basic hex editing features (✓)
Table editing (✓)
Read and write to rom (✓)
Make ups patches (✓)
Load items, characters, classes (✓)
Load portraits, icons, map animations etc (✓)
Auto detect eye mouth position from portraits (✓)
Load animations (✓)
Export labels and globals to EA (✓)
Text management (✓)
Text auto format (✓)
Dialogue building (✓)
Build ASM (✓)
Build C code with FE-Clib (✓)

Content management (X)
Porting EA raws (X)
Porting EA definitions (X)
Lyn support (X)
Porting Skill System (X)
Parse or convert EA files (X)

Credits

Mostly things I referenced
7743 for FEBuilderGBA
Circles for AA
StanH for FE-Clib
Colorz for EA formatting suite
Zahlman for lz77 (although you should install PyFastGbaLz77 for a “1000x” faster compression backend)

Sample Guide on basic EA features: (I’m not writing Ultimate Tutorial 13 here : )

First

from pyEA import *

Push and Pop:

PUSH 0x1234
    WORD 0x10
    BYTE 0x11
POP
POIN Label1

Is replaced with

with offset(0x1234):
    write_word(0x10)
    write_byte(0x11)
write_ptr("Label1")

Also mods can we remove the keybind for posting, whatever it is.

14 Likes

Interesting for sure and already a fair bit of progress! Especially being able to use it for C hacking is a nice bonus

1 Like

It is interesting, I wanted to give it a spin but I couldn’t get it to work.

At first I had an issue with the requirements, it seems like javaobj-py3 is needed, javaobj would not work.

After that was fixed the test buildfile was complaining about missing files, which I guess were expected to be in the root folder?, I commented those out but the game just crashed when trying to look at the rapier’s description.

Either way, like I said, it is interesting, I’d like to play with it sometime.

My bad on the javaobj thing.

Importing units requires a NAME.png portrait file of the same name in the same directory,
Importing classes requires a NAME.standing.png and a NAME.moving.png
Importing items requires a NAME.png icon file

Text requires anti-huffman, since it’s a giant lyn file it’s kinda awkward to incorporate into the project at this moment

Anyway, thanks for trying it out.

1 Like

This is cool and I’m keen to see where you take it. Will be watching.