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

Running another nut from in test.nut fails #23

Open
KelvinShadewing opened this issue Jul 31, 2020 · 2 comments
Open

Running another nut from in test.nut fails #23

KelvinShadewing opened this issue Jul 31, 2020 · 2 comments

Comments

@KelvinShadewing
Copy link
Owner

When running the program by itself so that it loads /rte/bin/test.nut, the menu seems to work perfectly fine, and even lets me navigate directories like it should. However, if I select another nut to run, I get this weird error. The following is what I got trying to run /test/my.nut:

AN ERROR HAS OCCURED [indexing string with string]


CALLSTACK

*FUNCTION [unknown()] /home/kelvin/Code/brux/test/src/main.nut line [5]

*FUNCTION [main()] /home/kelvin/Code/brux/test/my.nut line [7]

*FUNCTION [unknown()] NATIVE line [-1]

*FUNCTION [unknown()] test.nut line [92]

*FUNCTION [main()] test.nut line [246]


LOCALS

[this] "my.nut"

[vargv] ARRAY

[this] "my.nut"

[this] TABLE

[brxQuit] false

[vargv] ARRAY

[this] TABLE

I tried navigating out of Brux's project folder and into Fly Little Dragon's, and upon running that, got a similar error:

AN ERROR HAS OCCURED [trying to set 'string']


CALLSTACK

*FUNCTION [unknown()] /home/kelvin/Code/fld/src/main.nut line [6]

*FUNCTION [main()] /home/kelvin/Code/fld/fld.nut line [28]

*FUNCTION [unknown()] NATIVE line [-1]

*FUNCTION [unknown()] test.nut line [91]

*FUNCTION [main()] test.nut line [245]


LOCALS

[this] "fld.nut"

[vargv] ARRAY

[this] "fld.nut"

[this] TABLE

[brxQuit] false

[vargv] ARRAY

[this] TABLE

What's weird is it got as far as changing the window size and title when I ran it, so it's executing something.

However, if I launch Brux directly from these games' respective directories, they run perfectly fine, so the issue is with the test app somehow. I need to figure out how to make this work, not just so the runtime can have a built-in menu for handheld devices, but so that other games don't have to face the same issue when trying to run mods.

@KelvinShadewing
Copy link
Owner Author

KelvinShadewing commented Jul 31, 2020

OK, so in <project folder>/test/my.nut, it seems to be pointing to a line that contains quit = 0 which gives [trying to set 'string']. If I change = to <-, it becomes [indexing string with string]. It isn't being set to a string anywhere I can see, nor is it being used to index anything.

@RizzoRat
Copy link

in all cases when this happened to me with squirrel, there was an object shadowing the object I meant, like a local.
However, from the fact that a slot operator throws "indexing string with string" I'd recommend analysing the this-object. It could be a string instead of a table for some reason (stack issues maybe). To do a quick test, "foobar<-0" would throw the same error in that case. Same applies for bindenv, maybe a string is bound to the function...

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