» Sat May 28, 2011 4:12 pm
I'd still need the script if I wanted to make the inventory dependent upon quest status, so I don't think it would save me much work. I came across the Engineering Guild tutorial on merchants while trying to work out the bug, and it had some great information on how the containers work. As of Fallout 3, each merchant gets one container that can be in any cell and still be accessed. Additional containers can be accessed if their ownership is set to the merchant in question, but only if they're in the same cell. So what you're suggesting works for stationary vendors, but not for any roving merchants, like the four major ones from Canterbury Commons. You have to either add your stuff to their existing VendorChestBuried, or create new containers in all the cells where the player is likely to encounter them (which is quite a few).
What I did was just add a name to Flak and Shrapnel's container, using the same naming convention that Bethesda was using. It doesn't change the form id, so it won't cause conflicts with mods, and it won't conflict with any mod's scripts because without a name, no other script would have been able to reference it. There might be a problem if another modder ran into the same problem and named that container something different, but I'll cross that bridge when I come to it. I've got a hunch that the compiled code references the Form ID rather than the nametag, so there wouldn't be a problem.
I was thinking it would be cool to use this technique to make it so that trading heavily with a single merchant "unlocked" better goods, and maybe higher amounts of caps. Take your business elsewhere for too long, and you lose the bonus goods. Basically, trade in the wastes, especially in out of the way locations, would be very stagnant, no cash flow. But the lone wanderer starts venturing out and killing and looting everything in the area, and suddenly there's a major economy wherever he unloads his goods. That area becomes a trading hub with better inventories and loads of caps (and possibly lower prices, though there's already a mod WIP that will cover that). Major trading hubs, like Rivet City Market and Moira's, probably wouldn't change much.