Spoiler: show
You will note I have tried directly inserting at undefined positions (the now commented out lines) and then I have tried inserting at defined positions in the table. Nothing works and I get no errors. I wonder if the table size has to be expanded elsewhere first? Or is there something that needs to be changed in the Commander (ACU) files to make this work?
This is puzzling because a test of table.remove did work. That test is now commented out too. If table.insert can be solved then I can add as well as remove units to/from build lists for various builders and factories. I may or may not want to do such things in a mod but it will be good to have the basic knowledge on how to do this. At the moment I am stuck. Nothing I try works. I've looked for examples of this in other mods but I can find no examples of table.insert in bp.Categories or elsewhere.