Skript icon indicating copy to clipboard operation
Skript copied to clipboard

Nested variables erroring in 2.6-beta1

Open Th-Underscore opened this issue 5 years ago • 4 comments

Description

Nested variables are erroring when they shouldn't.

Steps to Reproduce

A variable nested in another variable, nested in another variable always errors. Any variable like {foo::%{bar::%{_beep}%}%} or {mcc.teams::%{mcc.team.%{_p}%}%} always errors. My current code is:

on script load:
    broadcast "%{mcc.teams::%{mcc.team.%{_p}%}%}% <white>have all been eliminated!"
    broadcast "%{test::%{_test}%}%"
    broadcast "%{foo::%{bar::%{_beep}%}%}%"
    set {foo::%{bar::%{_beep}%}%} to "test"

Expected Behavior

It shouldn't error and work like other variables such as {foo::bar}, but they don't.

Errors / Screenshots

image

Server Information

  • Server version/platform: Paper version git-Paper-68 (MC: 1.17) (Implementing API version 1.17-R0.1-SNAPSHOT) (Git: f18dc1e)
  • Skript version: 2.6-beta1

Additional Context

Th-Underscore avatar Jul 01 '21 02:07 Th-Underscore

I can confirm this issue

ShaneBeee avatar Jul 01 '21 02:07 ShaneBeee

I still seem to have this issue or something very similar

[ERROR] [Skript] Can't understand this condition: 'player's balance is higher than {-rankmoneyreq::%{_level+1}%}' (ranks.sk, line 103: if player's balance is higher than {-rankmoneyreq::%{level+1}%}:') [ERROR] [Skript] Can't understand this expression: {-inregion::dungeon%loop-number%::} ? ""-"" (dungeondefenders.sk, line 1363: set {_inventory::full::} to "&f&lPLAYERS:", "&7%{-inregion::dungeon%loop-number%::*} ? ""-""%", "" and "&f&lGOAL: &e%{goal%loop-number%}% Kills"')

Seems like %{var} ? ""-""% throws error too

Darkweasam avatar Jul 15 '21 21:07 Darkweasam

I still seem to have this issue or something very similar

[ERROR] [Skript] Can't understand this condition: 'player's balance is higher than {-rankmoneyreq::%{_level+1}%}' (ranks.sk, line 103: if player's balance is higher than {-rankmoneyreq::%{_level+1}%}:')

[ERROR] [Skript] Can't understand this expression: {-inregion::dungeon%loop-number%::} ? ""-"" (dungeondefenders.sk, line 1363: set {_inventory::full::} to "&f&lPLAYERS:", "&7%{-inregion::dungeon%loop-number%::*} ? ""-""%", "" and "&f&lGOAL: &e%{goal_%loop-number%}% Kills"')

Seems like %{var} ? ""-""% throws error too

You're doing {_level+1} rather than {_level} + 1. Plus, I'm not sure if variables mixed with arithmetic in percent signs were fixed, but they've always thrown an error. Set a variable beforehand.

You're also using quotes incorrectly in an expression (check my comment in your issue).

Th-Underscore avatar Jul 15 '21 23:07 Th-Underscore

I still seem to have this issue or something very similar [ERROR] [Skript] Can't understand this condition: 'player's balance is higher than {-rankmoneyreq::%{level+1}%}' (ranks.sk, line 103: if player's balance is higher than {-rankmoneyreq::%{level+1}%}:') [ERROR] [Skript] Can't understand this expression: {-inregion::dungeon%loop-number%::} ? ""-"" (dungeondefenders.sk, line 1363: set {inventory::full::} to "&f&lPLAYERS:", "&7%{-inregion::dungeon%loop-number%::*} ? ""-""%", "" and "&f&lGOAL: &e%{goal%loop-number%}% Kills"') Seems like %{var} ? ""-""% throws error too

You're doing {_level+1} rather than {_level} + 1. Plus, I'm not sure if variables mixed with arithmetic in percent signs were fixed, but they've always thrown an error. Set a variable beforehand.

You're also using quotes incorrectly in an expression (check my comment in your issue).

No the {_level+1} had a reason its named like that because set {_level+1} to {_level} + 1 but the other comment helped to fix it, so thanks alot!

Darkweasam avatar Jul 16 '21 17:07 Darkweasam