Jump to content

Custom made vendors have far too many caps


Ru55ell

Recommended Posts

I'm making a merchant mod, I've extended the gulp & grub and created a new small settlement up north but the vendors I've created now have thousands of caps more than they should.

 

When I first loaded the mod my vendors all had the right amount of caps (about 250 to 2000 each.) I've been enjoying “New Vegas bounties 2” and when I've gone back to my vendors to make sure they have restocked they all have far too many caps, one has 12,000 another has 20,000.

 

I’ve searched the forums for my problem but I can’t find any “my custom vendors have too many caps” threads.

 

When making a custom vendor how do I make the stock respawn without the amount of caps the vendor has increasing each time?

Link to comment
Share on other sites

Several ways to control it. By far the easiest (and also the most precise) is with a results script.

 

 

Here is a simple script.

Short nNumCaps
Set nNumCaps to BLCodgerSafe01REF.GetItemCount caps001;
If (nNumCaps > 32000)
     BLCodgerSafe01REF.RemoveItem caps001 nNumCaps;
     BLCodgerSafe01REF.AddItem caps001 32000;
Endif
If (nNumCaps < 200)
     BLCodgerSafe01REF.AddItem caps001 200;
Endif
ShowBarterMenu

There is a merchant bug. When the merchant total goes over a SHORT var in total it will display but the merchant will never pay out. I originally wrote the script to fix this. I posted the fix in the YUP thread and so it is now part of that. But it still has some use even if you decide to require YUP.

 

The merchant caps on hand is only one of them. For example, you can change what the item being inventoried is. So a baker will always be able to bake more bread (for example).

It is run in the results script when the PC asks merchant to buy/sell. The above shows how to both ensure that the MAX caps is never exceeded but also how to ensure that MIN caps is always there. I suggest this be modified a bit further.

Short nNumCaps
Set nNumCaps to BLCodgerSafe01REF.GetItemCount caps001;
If (nNumCaps > 32000)
     BLCodgerSafe01REF.RemoveItem caps001 nNumCaps;
     BLCodgerSafe01REF.AddItem caps001 32000;
Endif
If (nNumCaps < 200 && BLCodgerREF.TradeToday == 0)
     BLCodgerSafe01REF.AddItem caps001 200;
     Set BLCodgerREF.TradeToday to 1;
Endif
ShowBarterMenu

Make sure you have a provision in another script (perhaps in the hello script, or better via a timer) to set the merchant variable TradeToday to 0

Between these two you can very strictly regulate the amount of anything from caps to ammo to whatever in the merchant inventory without relying on the game engine refresh. If you add it ONLY to topics and do not use it in a run all the time script then it also will not bog the system down.

 

You will of course not use the same variables as I used in my example or you will be in-conflict with me when I release the above in a mod. Pretty cool little trick from such a simple script, eh?

Link to comment
Share on other sites

I've set all my vendors up by copying the traveling merchants so I wouldn't have to alter any dialogue. So I need a script that doesn't require a conversation to work.

I need to create a script and attach it to each unique container that I've created, I've tried the below, I get no error messages but it doesn't work. At this point I just want to remove all caps, then I can worry about adding some back. Any idea why the below won't work?

ScriptName 0aVendorCapFix

ref myVendorChest
Short nNumCaps01

Begin GameMode

	set myVendorChest to getLinkedRef
	set nNumCaps01 to myVendorChest.getItemCount caps001

;	;If nNumCaps01 => 5000
;	;	myVendorChest.removeItem caps001 5000
;	;	myVendorChest.AddItem caps001 2500
;	;endif

	myVendorChest.removeItem caps001 nNumCaps01
	;myVendorChest.AddItem caps001 2500

End
Link to comment
Share on other sites

GameMode is bad try to avoid it. It creates unnecessary bloat as it runs constantly.


If the merchants are not wandering, just have a trigger when the PC enters the store which runs cleanup and such (OnTriggerEnter). If they are wandering look at the other begin modes..... perhaps OnClose in an Object script on the merchant container would work.


Given how very easy it is to create a dialogue and how much more control you can have over various things if you do, I suggest you at least consider it.


Consider, the horn-dog merchant which is prone to flirt with the ladies... (just reuse some of the male prostitute dialogue, along with some of the existing merchant dialogue)

Consider, the 'ole-bat merchant who gives discounts based on mistaken identity or higher prices based on location... (just reuse some of the Old lady in Novac, or Lily, etc, along with some of the existing merchant dialogue)


None of that is needed to have a very basic merchant. It is pretty hard to learn everything to make even a single basic merchant. It is not much harder to learn how to make truly interesting ones (in my opinion). And colorful characters breath a more little life in to the Mojave then any generic.

Link to comment
Share on other sites

  • 1 month later...

I'm making a merchant mod, I've extended the gulp & grub and created a new small settlement up north but the vendors I've created now have thousands of caps more than they should.

 

When I first loaded the mod my vendors all had the right amount of caps (about 250 to 2000 each.) I've been enjoying “New Vegas bounties 2” and when I've gone back to my vendors to make sure they have restocked they all have far too many caps, one has 12,000 another has 20,000.

 

I’ve searched the forums for my problem but I can’t find any “my custom vendors have too many caps” threads.

 

When making a custom vendor how do I make the stock respawn without the amount of caps the vendor has increasing each time?

can you release this as a universal fix, or is it hard coded in the engine? e.g. does this only work for your merchants or what?

Link to comment
Share on other sites

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...