My brain is being a little slow today.
When I get a reference to a class, we'll call it pUnit, it has methods (as defined in lua wiki or in the source) that I can call such as pUnit:CanUpgradeRightNow() (and dozens of others).
I also get the data in the Units table as defined in the wiki. So I can check things like if (pUnit
rereqResources == true). Incorrect... working on it...
However, the actual resources required are in a child table called Unit_ResourceQuantityRequirements. Accessing that child table in sql is easy enough, but I'm unclear on how I get to it via lua?
Also, and not directly related to the OP, why is this a child table? Are there units that require multiple resources to upgrade? Can such units be created via xml?
When I get a reference to a class, we'll call it pUnit, it has methods (as defined in lua wiki or in the source) that I can call such as pUnit:CanUpgradeRightNow() (and dozens of others).

However, the actual resources required are in a child table called Unit_ResourceQuantityRequirements. Accessing that child table in sql is easy enough, but I'm unclear on how I get to it via lua?
Also, and not directly related to the OP, why is this a child table? Are there units that require multiple resources to upgrade? Can such units be created via xml?