Skript: Functions throw error when reloaded in subfolders

Created on 18 Sep 2019  Â·  13Comments  Â·  Source: SkriptLang/Skript

Description


if I put a script with function in a subfolder, for example "gs" and do /skript reload gs/script
it will throw error that a function with that name is already loaded in gs/script even if I am reloading the gs/script

Steps to Reproduce


reload a script in subfolder which has a function

Expected Behavior


expected to not throw error and reload properly

Errors / Screenshots

Server Information

  • Server version/platform: 1.12.2 paper
  • Skript version: 2.4-beta7

Additional Context


same happens if I use /skript disable on it and then enable

bug completed medium

Most helpful comment

Since the priority was reassessed, I don't think 2.4 should be released without a fix for this.

All 13 comments

Can reproduce with Paper 1.14.4 and Skript 2.4-beta7. Low priority bug seems appropriate.

kinda big for me as I use folders a lot and now I can't reload these functions without restarting the server

Out of curiosity, can you replicate this on Skript 2.4-beta5?

Can reproduce with Paper 1.14.4 and Skript 2.4-beta7. Low priority bug seems appropriate.

This is actually a pretty big bug, as it causes functions not to update properly and it sometimes requires a server restart for it to work.

Also, when reloading all scripts, if an error occures, like "function doesn't exist", just because it wasn't loaded yet, even though you put it in a folder called __lib which is the top one, therefore should be loaded first, it prevents all of the other scripts to reload and just stops the reloading right there. This will result in you needing to restart the server.

Seems to be a regression of the recent function changes, this doesn't occur for commands

Since the priority was reassessed, I don't think 2.4 should be released without a fix for this.

This could be related, but when calling a function in a different script then one the function was created in, it causes an error when reloading the function’s code script stating something like, “the function was moved or has been deleted. it will no longer work on next restart,” even if the function has had no changes to it

@APickledWalrus That's caused by the other script using an old version of the function, but yes it'd be nice to 'give' the other script(s) an updated version of the function when the script reloads

ah okay. Good to know

It should be a warning an not an error though

@Matocolotoe It's an error, that could be something to change..

:D ty for completionnn :)

Was this page helpful?
0 / 5 - 0 ratings