huderlem / poryscript

High-level scripting language for gen 3 pokemon decompilation projects

Home Page:https://www.huderlem.com/poryscript-playground/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Have an option to make Poryscript replace the entire .inc file or add/insert when compiling

vexio opened this issue · comments

commented

Currently, when you compile Poryscript it will completely overwrite the scripts.inc file, making old scripts that aren't in the scripts.pory file obsolete. I believe adding a flag/argument for the compilation command to insert instead of override will be a great addition.

Another good addition to add when inserting is enabled, Poryscript should attempt to look for Script names with the same name and replace all of the code in that script.
For example, if I have a script named "CanvasCreek_Sign_Lab" in my .pory script file, and there's a name that matches that in scripts.inc, it will replace and re-compile the poryscript code.

Are you familiar with Poryscript's raw statement? From your description above, it sounds like you're trying to combine poryscript scripts with regular scripts. The suggestions above will end up causing lots of confusing, as Poryscript wouldn't be able to reliably detect all related scripts to, say, CanvasCreek_Sign_Lab. Furthermore, it would break the simplicity of "one input file -> one output file".

If you absolutely need to combine old scripts with poryscript scripts, I would suggest including the old scripts in your Poryscript file using raw.

raw `
@ Scripts from original scripting system
   ...
`

// Include your Poryscript stuff below
script CanvasCreek_Sign_Lab {
    ...
}
commented

I did not even remotely think of that. Thank you for your help.