** SOLVED - See last post by me below @ 1245 **
Hi. If you’re familiar with the Lua C Api and have a minute, please peek at my code below.
Problem
I am trying to return two tables from a plugin I’m writing using the C API and I’m sure I’m goofing up the syntax and not setting it:
// Table 1 lua\_createtable(L, 0, 2); lua\_pushnumber(L, -args-\>y0); lua\_setfield(L, -2, "x"); lua\_pushnumber(L, args-\>x0); lua\_setfield(L, -2, "y"); // Table 2 lua\_createtable(L, 0, 2); lua\_pushnumber(L, args-\>y0); lua\_setfield(L, -2, "x"); lua\_pushnumber(L, -args-\>x0); lua\_setfield(L, -2, "y");
What I’m seeing:
I get two tables as my output, but the values are corrupted.
What I get:
{ x = -0, y = 5.33e+184 } { x = 0, y = -5.33e+184 }
What I should get:
{ x = -20, y = 10 } { x = 20, y = -10 }
Note: I verified these values by returning four discrete values instead of tables.
What I’ve tried
I’m pretty stuck, so I’ll I’ve tried is reading looking on the web. However, most folks don’t make tables quite the same way I am so the lessons I’m finding don’t apply so far.