I have a bunch of sprites that form ad hoc groups during gameplay, and I need each sprite to have a reference to the group. I implemented the group as a table in the level, but when I went to send this table to the sprites, I get the “Message buffer too small for table” error.
I should think a recursive table is too big, if it’s trying to send the whole table!
I suppose it could just be that it’s trying to send everything up to the recursive points, but regardless, I would much prefer if I could send the table by reference, instead of trying to send the whole thing. Is there a way I could send just a reference to the group instead of the entire group? This group is going to be changing during play, and I only want to update the group once, not the group copy in every sprite.
Well, I suppose I might be able to rethink some of the structure of what needs to know what if I can’t; but this does raise another concern as well: objects in tables are references, right? When I have an object linking to a sprite that also has the group object in a table, which in turn holds a table of sprite objects, which have the group object… We are only talking about one group object and one sprite object here, right? I read somewhere that lua variables are always references, but this table size issue (being more than a single reference to 1 variable) has me a bit concerned.
So I guess that’s two questions: passing a reference to the table, and making sure I’m not making a giant (non)recursive blob even without worrying about messaging.