-
-
Notifications
You must be signed in to change notification settings - Fork 374
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Proposal: Condition 'script [%text%] is loaded' #797
Comments
I know it's not how it's done in an actual programming language, but for Skript couldn't you just have the script dependencies in the same file? So if you need to depend on a function for the main script to function, you have it in the same file so that it's always available. |
Of course you can have all your scripts in one big file, but shall I wait 16 minutes for that script to load? It's known that splitting scripts into different files makes the script loading faster. |
Okay, well I figured it was a better solution if you just needed to depend on a couple functions, but if you need to depend on an entire script file then yes this would be very nice to have. I never suggested you put everything into 1 file. |
I just fixed the bug that caused function calls before function definitions not to work. Anyways, good idea. |
Wouldn't it be easier to have the syntax
as that still allows you to do
|
PR is done, it uses these syntaxes: |
The syntax would be something like
script [%text%] is loaded
. The text can be provided optionally to give the name of a specific script to check its load state, but it will otherwise default to the script the condition is in. This allows for scripts to easily do stuff conditionally based on if another script is currently active, or to do loaded-based loops, e.g.Currently, a while loop like this would continue uncontrollably even after unloading unless you use a variable of some variety to track the script's load status (which, granted, is not at all hard, but this looks nicer).
The text was updated successfully, but these errors were encountered: