Secondlife functions like
ll.GetObjectDetails
,
ll.SetLinkPrimitiveParams
,
ll.ParticleSystem
that take lists as arguments require integer and booleans inside them to be converted to a userdata integer object.
This is extremely cumbersome for basic use.
An example
ll.ParticleSystem({
integer(0),
integer(bit32.bor(0x100,0x400,0x008)),
integer(9),
integer(0x01),
integer(17),
1.0,
integer(1),
vector(0.8,0.0,0.0)
})
It would be great if luau could be setup to allow for the use of normal number types and booleans.
Like this
ll.ParticleSystem({
0,
bit32.bor(0x100,0x400,0x008),
9,
0x01,
17,
1.0,
1,
vector(0.8,0.0,0.0)
})
Correctly "cast" constants would improve this somewhat, but still leaves allot to be desired.
For now I have made myself a function to "auto cast" these for me, but that is sub optimal at best...
function table2FuncList(tab)
for k,v in pairs(tab) do
if type(v) == "number" and math.round(v) == v then
tab[k] = integer(v)
elseif type(v) == "boolean" then
tab[k] = integer(v and 1 or 0)
end
end
return tab
end