ZenScript icon indicating copy to clipboard operation
ZenScript copied to clipboard

cross-script reference causing fake error (works perfect in-game)

Open Landiie opened this issue 5 years ago • 7 comments

I was having a strange error when using a function across a script, where, i did everything properly, script works ingame, yet i still get a error that keeps changing everywhere depending on what i delete, nothing made sense, so i decided to make a script with just import scripts.Util;, and i got this weird error.

if i just do import scripts; it doesnt show an error but that theoretically would never work in-game

update: i just now fiddled with it, undo'ing and redo'ing and it dissapeared, however, the same result happens in other scripts, its a very inconsistent error to get rid of

any ideas?

Landiie avatar Nov 11 '20 11:11 Landiie

Are there any other statements before the import statement in this file?

Landie [email protected] 于2020年11月11日周三 下午7:49写道:

I was having a strange error when using a function across a script, where, i did everything properly, script works ingame, yet i still get a error that keeps changing everywhere depending on what i delete, nothing made sense, so i decided to make a script with just import scripts.Utils;, and i got this weird error.

https://camo.githubusercontent.com/208a516b9937efbfeaa9545b1e4bdeb0f39ceb35ea031fdf13f33f2050d1f4a5/68747470733a2f2f692e6779617a6f2e636f6d2f32396435663937646331326435343064326337323665383835393263643632622e706e67

if i just do import scripts; it doesnt show an error but that theoretically would never work in-game

update: i just now fiddled with it, undo'ing and redo'ing and it dissapeared, however, the same result happens in other scripts, its a very inconsistent error to get rid of

https://camo.githubusercontent.com/d3299d4947063ab992cc642a2da05d2f9f6a97d5041e8f983b7cc792aa6a031c/68747470733a2f2f692e6779617a6f2e636f6d2f31393764313338333830393866386436643536646339366366366166666533302e706e67

any ideas?

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/Yesterday17/ZenScript/issues/39, or unsubscribe https://github.com/notifications/unsubscribe-auth/ACCEFLUWJJZ7LFTU57WJA7LSPJ25TANCNFSM4TR4THKA .

Yesterday17 avatar Nov 11 '20 12:11 Yesterday17

In the first picture there was two, just two crafttweaker imports iitemstack and ingredient, but removing those import statements still yielded the same error. as mentioned I even did a blank script just having the import statement scripts.Util and it still gave me an error :(

Landiie avatar Nov 11 '20 18:11 Landiie

image hmmm

Just try to restart VSCode?

Yesterday17 avatar Nov 12 '20 01:11 Yesterday17

i have on many different occasions, i just restarted right now and i got this. here is a gif to better show how its produced

edit: tried on various different scripts, its really inconsistent, if it doest give errors on some scripts, those scripts will never have the error, if it doesnt, it never works for those scripts

Landiie avatar Nov 12 '20 03:11 Landiie

I had this once but it's gone meanwhile. I don't know how to reproduce this either. But I know this bug exists.

Try making a crafttweaker import first like IIngredient and then import your script.

rlnt avatar Nov 12 '20 13:11 rlnt

That’s what I did in my first script when I discovered the issue @DAmNRelentless, I honestly just feel like reinstalling vsc lol

Landiie avatar Nov 12 '20 17:11 Landiie

I didn't reinstall it. It just fixed itself after some time. It's really a weird bug.

rlnt avatar Nov 12 '20 17:11 rlnt