I spent a lot of time trying to understand why my Stocks were not registering as valid Inventories for serfs/resources when running FlagSearches. The building->is_inventory() call returns true, but the Flag->is_inventory() and Flag->accepts_resources() calls returned false, and the Flag-> calls are what are used to check the validity of an Inventory.
The answer is that the new Stock had no 'holder', that is it had no occupying "professional" serf. In retrospect this seems kind of obvious, but until now I had always (wrongly) assumed that Stocks do not require a serf to operate them. Clearly, they have to because somebody has to move resources OUT, even though the nearest road Transporter handles moving resources IN. I never noticed that once a Stock is completed a serf is sent to occupy it, and until that serf arrives and becomes the holder, the stock will not be a valid resource destination, even though it appears to be initialized in terms of clicking on it and seeing Inventory screens
I assume the original game operates this way also. And the reason that, in my case, a serf had not occupied the stock is almost certainly faulty pathfinding logic (which is what I was working on when I noticed this problem) preventing a serf from being sent there
I think it would be an minor improvement in the game to not show the "Inventory screens" when clicking on a Stock until the holder serf has occupied it. It would be better to show a picture of the building and a minus-sign icon until the requested serf arrives, then change to the Inventory screens once the Stock is operational.
I spent a lot of time trying to understand why my Stocks were not registering as valid Inventories for serfs/resources when running FlagSearches. The building->is_inventory() call returns true, but the Flag->is_inventory() and Flag->accepts_resources() calls returned false, and the Flag-> calls are what are used to check the validity of an Inventory.
The answer is that the new Stock had no 'holder', that is it had no occupying "professional" serf. In retrospect this seems kind of obvious, but until now I had always (wrongly) assumed that Stocks do not require a serf to operate them. Clearly, they have to because somebody has to move resources OUT, even though the nearest road Transporter handles moving resources IN. I never noticed that once a Stock is completed a serf is sent to occupy it, and until that serf arrives and becomes the holder, the stock will not be a valid resource destination, even though it appears to be initialized in terms of clicking on it and seeing Inventory screens
I assume the original game operates this way also. And the reason that, in my case, a serf had not occupied the stock is almost certainly faulty pathfinding logic (which is what I was working on when I noticed this problem) preventing a serf from being sent there
I think it would be an minor improvement in the game to not show the "Inventory screens" when clicking on a Stock until the holder serf has occupied it. It would be better to show a picture of the building and a minus-sign icon until the requested serf arrives, then change to the Inventory screens once the Stock is operational.