GitHub Repo: https://github.com/ps4star/FSE
Language Reference (some code examples that explain things more in layman's terms can be found below. Check them out if you're having trouble understanding this): https://github.com/ps4star/FSE/blob/master/ref.md
How to Install: https://github.com/ps4star/FSE/blob/master/README.md
Try it out Online at: https://ps4star.github.io/FSE/
Hey guys. I've always been one of those people who likes automating things, making processes as efficient and simple as possible. Something I noticed after spending a few hours writing scripts in XSE was that there is often a lot of technical stuff you need to do even for the simplest of actions. Want to move a character? You're gonna need to call applymovement, look up a hex table, then write an #org statement containing that data. Lots of really tedious work. These kinds of situations are where FastScriptEditor (which I'll just call FSE from now on) comes into play.
Just to be a show-off, here's FSE's 1-line variation of applymovement:
The XSE code that this compiles to:
So yes, in case you weren't aware, FSE is essentially just a program that compiles proprietary FSE code into valid XSE code. It's written in HTML/JS (hence why it has a GitHub Pages site). To use it, simply type your FSE code into the editor box on the left, hit Convert, go into XSE, hit Ctrl+V, hit XSE's compile button, and voila. This may sound a bit tedious, but, and especially with larger scripts, it's almost always worth the extra time it takes to do this due to FSE's efficiency. You'll also notice the "Starting Offset" box. This is just what it sounds like, it'll put whatever you type into it into the call to "#dynamic" at the start of the script.
Now, naturally, when you're converting 1 line of code into potentially dozens, some information is bound to be lost in translation. However, there are several internal FSE commands you can call to gain back some of this control (see below). Of course, you're never going to have quite the same level of control as you would with XSE (though of course, editing the XSE output manually before inserting it into the ROM is always an option), but if you're okay with that, then FSE is a great alternative.
Now for some examples, so you can get a feel for how the language works (see the language reference, linked above, for the full documentation).
Initially I had a list of examples pasted here, but decided to just put it in a markdown document so it would be easier to mantain: https://github.com/ps4star/FSE/blob/master/examples.md
It also kind of acts as an introductory tutorial, explains what certain things do and such. Again, see language ref linked above for the full documentation.
As for how to go about learning FSE, I would highly recommend reading the above code examples if you haven't already, then reading sections 4, 5a, and 5b of the language reference before doing anything with the language. Then once you have a good grasp on those sections, go on to read the other sections to improve your skill.
As for resources on learning or improving your skill in XSE (which, if it wasn't obvious already, having at least some experience with XSE is pretty much a requirement before using FSE), I would recommend Sierra's MEGA-HUGE XSE Scripting Tutorial. This tutorial was also a great resource for me while developing FSE - it gave me plenty of test cases to try out, allowed me to find ways to optimize the language, etc.
Also, I miiiiight make some YouTube video tutorials on the language, it just depends on if I have the time or not. If I do, I'll post links here.
There are almost certainly going to be bugs in this program. If you encounter one, please make a reply to this thread, and include your FSE code, the XSE output, and any alert/error messages that appear. Also please read the language reference first (at least the relevant parts) if you encounter a bug just to make sure that it's in fact a compiler error and not a user/syntax error. Providing screenshots of your entire screen is preferred as well (you don't have to show your programs/browser tabs of course, just the window of FSE itself). The current error-detection system admittedly isn't that great, but I'll be expanding upon it in future updates. I will also be updating FSE regularly with bug fixes and a more expansive function libary, especially if it becomes popular or people start relying on it for pokemon scripting.
Speaking of new features, if you have any suggestions or ideas for optimizations or features I should add, I'd be happy to hear that as well.
With all of that being said, have a great time with FSE, I really put a lot of work into it (40+ hours in total just to get to the first release version). And please don't be afraid to request stdlib functions, post bug reports, feature requests, literally anything, I imagine I'll probably be checking this thread a lot over the next little bit. Cya, and have fun,
--ps4star
Language Reference (some code examples that explain things more in layman's terms can be found below. Check them out if you're having trouble understanding this): https://github.com/ps4star/FSE/blob/master/ref.md
How to Install: https://github.com/ps4star/FSE/blob/master/README.md
Try it out Online at: https://ps4star.github.io/FSE/
Hey guys. I've always been one of those people who likes automating things, making processes as efficient and simple as possible. Something I noticed after spending a few hours writing scripts in XSE was that there is often a lot of technical stuff you need to do even for the simplest of actions. Want to move a character? You're gonna need to call applymovement, look up a hex table, then write an #org statement containing that data. Lots of really tedious work. These kinds of situations are where FastScriptEditor (which I'll just call FSE from now on) comes into play.
Just to be a show-off, here's FSE's 1-line variation of applymovement:
Code:
move 0x00 u u r r r ; moves character with ID 0x00 up 2 and right 3
Code:
#dynamic 0x197D000
#org @main
applymovement 0x00 @offset0
waitmovement 0x0
end
#org @offset0
#raw 0x09
#raw 0x09
#raw 0x0B
#raw 0x0B
#raw 0x0B
#raw 0xFE
So yes, in case you weren't aware, FSE is essentially just a program that compiles proprietary FSE code into valid XSE code. It's written in HTML/JS (hence why it has a GitHub Pages site). To use it, simply type your FSE code into the editor box on the left, hit Convert, go into XSE, hit Ctrl+V, hit XSE's compile button, and voila. This may sound a bit tedious, but, and especially with larger scripts, it's almost always worth the extra time it takes to do this due to FSE's efficiency. You'll also notice the "Starting Offset" box. This is just what it sounds like, it'll put whatever you type into it into the call to "#dynamic" at the start of the script.
Now, naturally, when you're converting 1 line of code into potentially dozens, some information is bound to be lost in translation. However, there are several internal FSE commands you can call to gain back some of this control (see below). Of course, you're never going to have quite the same level of control as you would with XSE (though of course, editing the XSE output manually before inserting it into the ROM is always an option), but if you're okay with that, then FSE is a great alternative.
Now let's talk features:
- Automatic table lookups!
- Automatic line break system for msgbox!
- Vastly more efficient applymovement system!
- Shortened/alternative names to XSE commands!
- Define constants and functions to easily name and re-use numbers, strings, hex IDs, and blocks of code!
- Automatic #org generation for msgbox and applymovement!
- ALL XSE commands are available!
- Loops! (though they're quite limited)
- Write scripts faster with Expansion Statements! (see language ref, section 3)
Now for some examples, so you can get a feel for how the language works (see the language reference, linked above, for the full documentation).
Looooots of Example Scripts, in no Particular Order
Initially I had a list of examples pasted here, but decided to just put it in a markdown document so it would be easier to mantain: https://github.com/ps4star/FSE/blob/master/examples.md
It also kind of acts as an introductory tutorial, explains what certain things do and such. Again, see language ref linked above for the full documentation.
Closing Thoughts
As for how to go about learning FSE, I would highly recommend reading the above code examples if you haven't already, then reading sections 4, 5a, and 5b of the language reference before doing anything with the language. Then once you have a good grasp on those sections, go on to read the other sections to improve your skill.
As for resources on learning or improving your skill in XSE (which, if it wasn't obvious already, having at least some experience with XSE is pretty much a requirement before using FSE), I would recommend Sierra's MEGA-HUGE XSE Scripting Tutorial. This tutorial was also a great resource for me while developing FSE - it gave me plenty of test cases to try out, allowed me to find ways to optimize the language, etc.
Also, I miiiiight make some YouTube video tutorials on the language, it just depends on if I have the time or not. If I do, I'll post links here.
There are almost certainly going to be bugs in this program. If you encounter one, please make a reply to this thread, and include your FSE code, the XSE output, and any alert/error messages that appear. Also please read the language reference first (at least the relevant parts) if you encounter a bug just to make sure that it's in fact a compiler error and not a user/syntax error. Providing screenshots of your entire screen is preferred as well (you don't have to show your programs/browser tabs of course, just the window of FSE itself). The current error-detection system admittedly isn't that great, but I'll be expanding upon it in future updates. I will also be updating FSE regularly with bug fixes and a more expansive function libary, especially if it becomes popular or people start relying on it for pokemon scripting.
Speaking of new features, if you have any suggestions or ideas for optimizations or features I should add, I'd be happy to hear that as well.
Plans for the near future:
- Expand upon stdlib. Right now it literally has 4 functions, and 1 FRLG-exclusive function (the FRLG-exclusive function in question is "nickname_frlg". For some reason I couldn't get it to work in RSE, it would just softlock. I tried every script I could find on the internet relating to nicknaming - nothing worked. Works fine in FRLG though. If someone could give me advice on this (how to bring up the nickname screen in rse) it would be appreciated).
- Extensively debug and test FSE, mostly in-game. I'm not saying the compiler is bug-free by any means (which btw if you DO encounter a compiler bug, let me know ASAP), but at this point my focus isn't so much on the compiler being buggy, moreso the scripts that it generates actually working in-game. This is something I've honestly barely tested at this point, and really should've done more before release, but, I have tested a lot of the major things, and from what I've seen I don't think there'll be too many problems in that regard (though, again, if the compiler generates an invalid script or something, let me know).
With all of that being said, have a great time with FSE, I really put a lot of work into it (40+ hours in total just to get to the first release version). And please don't be afraid to request stdlib functions, post bug reports, feature requests, literally anything, I imagine I'll probably be checking this thread a lot over the next little bit. Cya, and have fun,
--ps4star
Last edited: