View Single Post
10/14/18, 10:21 PM   #1
Cardinal05
AddOn Author - Click to view addons
Join Date: Feb 2018
Posts: 33
GetPlacedFurnitureChildren return type

Hi and sorry to bother you guys, but [and please tell me if I am crazy] the return type for the function...

GetPlacedFurnitureChildren( id )

...may be a data type that isn't native to LUA (perhaps a C array that isn't cast for LUA? I am not sure how the game's host C++ executable passes data to/from the LUA interpreter)

The steps to reproduce this issue are:

1. Link multiple children to a parent item.
2. Use a statement similar to the following:

/script d( type( GetPlacedFurnitureChildren( parentItemId ) ) )

What I am seeing is "number", even though a statement such as...

/script d( GetPlacedFurnitureChildren( parentItemId ) )

...will output a 'list' of furniture Ids (the children). Interacting with this return value as if it were a table produces the standard "Operator # (or whatever) is not support for # number" error.

The strange part - and the reason why I think the return value may be cast incorrectly for LUA - is that the output is clearly a table, or at least an array-like structure.

The end result though is that I cannot index any id in the list beyond the first one as LUA refuses to allow it to be referenced as a table. I hope this information helps!

Thank you so much!
@Cardinal05
  Reply With Quote