Skip to content
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

Compatibility issue when using Json.lua causes errors in other Lua scripts #29

Open
sppeect opened this issue Jun 18, 2024 · 1 comment

Comments

@sppeect
Copy link

sppeect commented Jun 18, 2024

Title: Compatibility issue when using Json.lua causes errors in other Lua scripts

Description:
When using Json.lua located in lib/core, other Lua scripts are breaking, resulting in errors. Below are two examples of errors that occur:

Exemple 1:

2024-06-18 02:29:27 - Lua Script Error: [Scripts Interface]
2024-06-18 02:29:27 - /home/healmot/server/data/scripts/weapons/wands.lua
2024-06-18 02:29:27 - /home/healmot/server/data/scripts/weapons/wands.lua:1: attempt to index a nil value (global 'classBalancerConfig')
2024-06-18 02:29:27 - stack traceback:
2024-06-18 02:29:27 - [C]: in metamethod 'index'

On script global.lua:

classBalancerConfig = {
    knight = {
        damageMultiplierMin = 2.5,
        damageMultiplierMax = 5,
        defense = 10
    },
    paladin = {
        damageMultiplierMin = 4,
        damageMultiplierMax = 8,
        defense = 8.5
    },
    druid = {
        damageMultiplierMin = 3.25,
        damageMultiplierMax = 6.5,
        defense = 3
    },
    sorcerer = {
        damageMultiplierMin = 4.75,
        damageMultiplierMax = 9.5,
        defense = 2
    }
}

Exemple 2 :

2024-06-18 02:52:31 - Lua Script Error: [Scripts Interface]
2024-06-18 02:52:31 - /home/healmot/server/data/scripts/UpgradeSystem/core.lua
2024-06-18 02:52:31 - /home/healmot/server/data/scripts/UpgradeSystem/core.lua:19: attempt to index a CreatureEvent value (local 'LoginEvent')
2024-06-18 02:52:31 - stack traceback:
2024-06-18 02:52:31 - [C]: in metamethod 'newindex'
2024-06-18 02:52:31 - /home/healmot/server/data/scripts/UpgradeSystem/core.lua:19: in main chunk
@Najtu
Copy link

Najtu commented Jun 18, 2024

Not sure what json.lua implementation you are using, but most json.lua i found on github do not support LUA 5.4

You would need to find one that supports it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants