SkriptLang / Skript

Skript is a Spigot plugin which allows server admins to customize their server easily, but without the hassle of programming a plugin or asking/paying someone to program a plugin for them.
https://docs.skriptlang.org
GNU General Public License v3.0
1.06k stars 369 forks source link

2.7: Some functions not loaded on startup #5779

Closed L3v3lup closed 6 months ago

L3v3lup commented 1 year ago

Skript/Server Version

[11:39:31 INFO]: [Skript] Server Version: git-Purpur-2004 (MC: 1.20.1)
[11:39:31 INFO]: [Skript] Skript Version: 2.7.0-beta3-nightly-97a6d14 (skriptlang-nightly)
[11:39:31 INFO]: [Skript] Installed Skript Addons:
[11:39:31 INFO]: [Skript]  - SkUniversal v2.13
[11:39:31 INFO]: [Skript]  - skript-yaml v1.4.1-for-MC-1.20
[11:39:31 INFO]: [Skript]  - skript-reflect v2.3 (https://github.com/TPGamesNL/skript-reflect)
[11:39:31 INFO]: [Skript]  - skript-db v1.3.6
[11:39:31 INFO]: [Skript]  - skRayFall v1.9.28 (https://sk.rayfall.net/)
[11:39:31 INFO]: [Skript]  - SkBee v2.13.0 (https://github.com/ShaneBeee/SkBee)
[11:39:31 INFO]: [Skript]  - ItemsAdder v3.5.0-r2 (devs.beer)
[11:39:31 INFO]: [Skript] Installed dependencies:
[11:39:31 INFO]: [Skript]  - WorldGuard v7.0.9-SNAPSHOT+2250-fffb0c1
[11:39:31 INFO]: [Skript]  - GriefPrevention v16.18.1

Bug Description

Some of my functions are not getting loaded when i startup the server. The same error occurs with /sk reload all.

More infos to this problem: The same functions that are not recognized later down the script are being used above, but dont throw an error. Can a (too) big skript file cause this? Anyways, this is new and didn't happen in 2.6.

Expected Behavior

-

Steps to Reproduce

-

Errors or Screenshots

[11:38:42 INFO]: loaded 6 structures from 'Dungeons\Skills.sk'
[11:38:42 INFO]: loaded 8 structures from '!API.sk'
[11:38:42 INFO]: Line 882: (Achievements.sk)
[11:38:42 INFO]:     The function 'Reward' does not exist.
[11:38:42 INFO]:     Line: Reward(expr-2, 1, 100, true, "&6Händler I&7", false)
[11:38:42 INFO]:
[11:38:42 INFO]: Line 883: (Achievements.sk)
[11:38:42 INFO]:     The function 'ItemPayout' does not exist.
[11:38:42 INFO]:     Line: ItemPayout(expr-2, 2 emerald)
[11:38:42 INFO]:
[11:38:42 INFO]: Line 888: (Achievements.sk)
[11:38:42 INFO]:     The function 'Reward' does not exist.
[11:38:42 INFO]:     Line: Reward(expr-2, 2, 500, true, "&6Händler II&7", false)
[11:38:42 INFO]:
[11:38:42 INFO]: Line 889: (Achievements.sk)
[11:38:42 INFO]:     The function 'ItemPayout' does not exist.
[11:38:42 INFO]:     Line: ItemPayout(expr-2, 8 emerald)
[11:38:42 INFO]:
[11:38:42 INFO]: Line 894: (Achievements.sk)
[11:38:42 INFO]:     The function 'Reward' does not exist.
[11:38:42 INFO]:     Line: Reward(expr-2, 5, 2000, true, "&6Händler III&7", true)
[11:38:42 INFO]:
[11:38:42 INFO]: Line 895: (Achievements.sk)
[11:38:42 INFO]:     The function 'ItemPayout' does not exist.
[11:38:42 INFO]:     Line: ItemPayout(expr-2, 1 netherite ingot)
[11:38:42 INFO]:
[11:38:42 INFO]: loaded 21 structures from 'Achievements.sk'
[11:38:42 INFO]: loaded 9 structures from 'Auktionshaus.sk'
[11:38:42 INFO]: loaded 18 structures from 'ChatTab.sk'
[11:38:42 INFO]: loaded 13 structures from 'Dashboard.sk'
[11:38:42 INFO]: loaded 15 structures from 'dyn.sk'
[11:38:42 INFO]: loaded 84 structures from 'Essentials.sk'
[11:38:42 INFO]: loaded 8 structures from 'Farmwelt.sk'
[11:38:42 INFO]: loaded 3 structures from 'Geldsystem.sk'
[11:38:42 INFO]: loaded 26 structures from 'Items.sk'
[11:38:42 INFO]: loaded 23 structures from 'Jobs.sk'
[11:38:42 INFO]: loaded 5 structures from 'Lift.sk'
[11:38:42 INFO]: loaded 4 structures from 'PlayerCitys.sk'
[11:38:42 INFO]: loaded 3 structures from 'Quarrys.sk'
[11:38:42 INFO]: loaded 21 structures from 'Sandbox.sk'
[11:38:42 INFO]: loaded 2 structures from 'Scoreboard.sk'
[11:38:42 INFO]: loaded 3 structures from 'Tacho.sk'
[11:38:42 INFO]: loaded 1 structure from 'Team.sk'
[11:38:42 INFO]: loaded 13 structures from 'Vote.sk'
[11:38:42 INFO]: loaded 2 structures from 'Yaml.sk'
[11:38:42 INFO]: loaded 5 structures from 'Zaubermarkt.sk'
[11:38:42 INFO]: loaded 14 structures from 'Zirkus.sk'
[11:38:43 INFO]: Line 190: (ChatTab.sk)
[11:38:43 INFO]:     the display name of loop-player is already a text, so you should not put it in one (e.g. the display name of loop-player instead of "%the display name of loop-player%")
[11:38:43 INFO]:     Line: if {_m} contains "%displayname of loop-player%":
[11:38:43 INFO]:
[11:38:45 INFO]: [Skript] Encountered 6 errors while reloading the config, aliases and all scripts! (4434ms)

Other

No response

Agreement

APickledWalrus commented 1 year ago

im assuming Achievements.sk is using the missing functions. what script are they a part of? !API.sk? could you send the script containing the functions?

also, what other scripts make use of the functions but load correctly?

L3v3lup commented 1 year ago

!API.sk just has some WorldGuard things inside.

The function "Reward" is in the file Geldsystem.sk. "ItemPayout" is in Essentials.sk.

Function "Reward" is used in: Essentials.sk, Zirkus.sk and Achievement.sk. Function "ItemPayout" is used in 6 different files and Achievement.sk - which all work besides Achievement.sk. I tried renaming "Achievement.sk" to "ZAchievment.sk" for the sake of a broken loading order, but that didnt solve the problem either.

Oh and "Achievement.sk" successfully uses "Reward()" and "ItemPayout()" in Achievement.sk. The trouble starts just at line 882.

Geldsystem.sk: https://pastebin.com/t2N7GkDu Essentials.sk: https://pastebin.com/XhYBTW40

APickledWalrus commented 1 year ago

thanks for all the information! could you send the achievement.sk script as well?

L3v3lup commented 1 year ago

Can i send you that privately? I found your E-Mail adress on your profile. I will send you a pastebin link to the file.

APickledWalrus commented 1 year ago

Based on the information in that script (it was emailed to me), it looks like the problematic calls are located in a custom effect created using skript-reflect. Looking at the source code, it seems like it may end up loading the code too early (the addon has not yet been adapted for 2.7). Are there other cases where it is working in a custom syntax?

L3v3lup commented 1 year ago

Oh i didn't realize that. Thanks for pointing that out. I will text TPGamesNL about that problem.

Moderocky commented 6 months ago

The related issue for skript reflect is marked as completed, so I'll assume this is fixed. Either way, it's not a Skript issue so this wouldn't be the place for the ticket.