huderlem / poryscript

High-level scripting language for gen 3 pokemon decompilation projects
https://www.huderlem.com/poryscript-playground/
MIT License
198 stars 22 forks source link

Support pokecrystal #27

Closed huderlem closed 4 years ago

huderlem commented 4 years ago

Pokecrystal's scripting engine handles conditional logic a bit differently than gen 3. In gen 3, only three commands set the conditional flags (checkflag, compare, and checktrainerflag). As a result, boolean expressions consist purely of the operators flag(), var(), and defeated(). In pokecrystal, tons of scripting commands write conditional flags to wScriptVar. wScriptVar is multipurpose, but all conditional branching uses this variable to determine the action to take.

Rather than defining a key operator, like flag(), for every single command that write conditional flags, Poryscript should accept arbitrary operators in boolean expressions. Then, every command will be rendered using iftrue, iffalse, ifequal, iffalse, ifgreater, and ifless.

Above is probably the most important part, however, many other pieces need to be modified, including:

...and probably more.

huderlem commented 4 years ago

Development is taking place in the gen2 branch.

huderlem commented 4 years ago

I don't think there is any demand for Gen 2 support. I also don't like how different some of the internals are for gen 2's system. IF there is demand in the future, I think I'd rather have a forked repo, rather than support both in one project. I'll keep the gen 2 branch around, in case.