First, I wanted to change my name on the forum but I can't see how to do that. This name no longer suits me.
Second, I've created a mod to give vendors unlimited caps with which to buy stuff, in the manner of the Commissary units in a Fallout: New Vegas DLC. They work by restocking themselves with 6000 caps when their caps reach 0. To that end, I wrote this script:
scn RestockCapScript
short DoOnce
begin gamemode
if DoOnce == 0
if GetItemCount f == 0
additem f 6000
endif
set DoOnce to 1
endif
end
begin MenuMode
set DoOnce to 0
end
And attached it to a container item, which starts with 6000 caps. I then placed that container in various locations where I want to give a nearby vendor unlimited caps. I hid the chest under the floor or ground, made it a persistent reference, gave it a unique name, locked it so that it requires a key, and assigned ownership of the chest to the vendor.
This worked for Moira Brown, Seagrave Holmes, Knick Knack in Little Lamplight, Tulip in Underworld, and I'm pretty sure it worked for Panada in Point Lookout. When I sell items to them, they have 6000 extra caps initially. If I sell and get all their caps, they will have 0 still unless I exit out of conversation then re-enter, at which point they'll have exactly 6000.
It did not work for Knight Captain Durga in the Citadel or Pronto in Paradise Falls. Neither one had any additional caps, and selling items to get their caps resulted in a persistent 0 caps even when exiting the conversation.
I checked both chests (Durga and Pronto) to make sure the ownership was set right, and that the restocking was occurring properly, and it is. I deleted the chest for Knight Captain Durga using FO3Edit, then recreated it from scratch with the GECK. I also tried attaching the script directly to Durga, but if she's killed and looted, that's a neverending source of caps at 6000 per loot. I don't want that. It did, however, work as intended when she remains alive.
Does anyone have any clue what's going on? Even if I had a script that could be attached to a NPC to make this work without unlimited free caps from loot, I can't attach it to Pronto because he already has the Slaver script attached.