Omnimaga

Calculator Community => TI Calculators => Lua => Topic started by: TheNlightenedOne on March 29, 2013, 05:24:00 pm

Title: Script runs fine in oclua but doesn't work when packaged with Luna
Post by: TheNlightenedOne on March 29, 2013, 05:24:00 pm
My contest entry is working fine in oclua but when I package it with Luna it complains about an attempt to index upvalue [a table I'm using] (a nil value). And yes, said table is properly defined.
Title: Re: Script runs fine in oclua but doesn't work when packaged with Luna
Post by: Levak on March 29, 2013, 05:33:11 pm
In another topic you're dealing with external variables from TI-Basic.
Is that related ?

Without any source code are any further information we cannot help you (I know it is for your contest and you may not paste the code).
Luna has been tester again and again and used again and again my numerous of users.
Title: Re: Script runs fine in oclua but doesn't work when packaged with Luna
Post by: TheNlightenedOne on March 29, 2013, 05:36:50 pm
I had to use a catalog function to randomize a set and store it in a Lua table (works fine), and this is the same table.
Title: Re: Script runs fine in oclua but doesn't work when packaged with Luna
Post by: ElementCoder on March 30, 2013, 06:49:38 am
Are you trying to call the first element as 0 perhaps (even though that should just return nil I think)? (probably not, but I caught myself doing this several times :P)
Title: Re: Script runs fine in oclua but doesn't work when packaged with Luna
Post by: Jim Bauwens on March 30, 2013, 01:10:03 pm
I had to use a catalog function to randomize a set and store it in a Lua table (works fine), and this is the same table.
Why not use math.random? You can easily randomise a set that way.
Also, where somewhere do you randomise the set (in what event?). It might be the enviroment isn't properly loaded yet when it gets executed (with OCLua it's already loaded, because it executes the code a bit different).