NTSL compile errors and save changes #6690
Open
+13
−8
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
About The Pull Request
This PR does three things:
Why It's Good For The Game
For code saving, this is helpful for larger scripts, since the UI is slow to save them. If a script is compiled before it is saved, it either throws an error because it thinks you tried to compile nothing or it compiles whatever it had saved previously. With the console log now telling you when it is saved, you no longer have to wait for the button press sound to know that it saved your code.
For the error checks, before this PR, one method checked for both invalid characters and if the script was over the max character limit. This is bad because if you had a script that was too big, rather than tell you that, it would say that you had an invalid character. With the checks now separated, along with it showing your script's character count and the max character count, it is now easier to troubleshoot NTSL compile errors.
For lowering the max character count, TGUI does not seem capable of compiling scripts anywhere near 20,000 characters, with it starting to break down around ~16,000-15,000 characters. With the max character count lowered to 15,000, this will still allow for large scripts while also lessening the affects of TGUI having difficulty with them. Even around 15,000 characters, TGUI is slow to save NTSL code as it takes around 5-10 seconds for it to trigger the code that saves your NTSL script.
##Testing
https://www.youtube.com/watch?v=qFo-1nuYZwE
Changelog
🆑
qol: Broke NTSL invalid and max character checks into separate checks for easier troubleshooting
fix: Lowered NTSL max characters to 15,000 due to TGUI limitations
/:cl: