#Stonescript Wrong Error Reported
14 messages · Page 1 of 1 (latest)
Yeah the errors can be a bit misleading.
Sometimes it is much worse than that.
It’s giving you exactly what’s happening, that bit doesn’t exist so that’s what it’s telling you.
If you misspell a variable, it’s the same thing that variable doesn’t exist. It’s not gonna say whoops you spelled something wrong.
Working as intended, not a bug.
it happens because string is not actually referencing an object with methods in stonescript.
string.Equals is actually the whole variable/function name. The native functions can have . as part of the name to emulate object methods.
It checks the native functions/vars and see it doesn't exist there, so it checks user made functions/vars and thinks string is meant to be an object
And doesn't think its text because of the .
So this is the only part of the above which is reasonable to me.
Followup: is there a way to make the error more intuitive within the game itself?
To do so, it would have to know its a typo and not you trying to access a custom var/func thats part of an object
I hate to be pedantic, but a Trie would work great for that (or anything else that could allow a program to find minimum levenstein distances)
Wait... why isn't "string" just a built-in object already?
its a datatype, but its not a stonescriptObject