Jump to content

Best way to uniformly modify prices in barter?


Glowcat

Recommended Posts

I've recently completed a mini-mod that allows the player to trade in NCR and Legion currency as they would caps, with the appropriate amount being added or subtracted at the end of a barter. The only problem I have now is that the cap values do not appropriately represent exchange rates, and especially for the Legion Denariis this can be a exploitable problem as they are worth 4 times the value of bottlecaps. To fix this I'd need a way to slash (or multiply) all prices equally for the duration of the barter.

 

What is the best way to go about modifying the entire stock of a player and vendor in the same direction and magnitude? I'm unfamiliar with the method and trawling through the GECK wiki is proving fruitless but that may just be due to my incompetent searching. This is the first serious modding project I've undertaken and I'd hate if I ran into a brick wall with it, as I plan to build on it some more with special merchants to deal in Legion/NCR goods. The script (so far) is also easily portable to Oblivion and probably Skyrim when it releases.

 

I'd prefer to avoid the lazy fix of modifying Legion Money values directly.

Link to comment
Share on other sites

Well I managed to pick my poison thanks to Cipsci's Loop Tutorial pointing out the functions I need to move through each party's inventory, but ran into a strange problem. Whenever I put the loop statements in my script the entire thing stops working. If I comment out the loop parts it begins functioning again... Any ideas about what could be causing this? I'm using the NVSE and I'm sure it's running since RTS detects it fine.

 

Here is the bit of code in question:

 

;EXCHANGE RATE WHILE LOOPS

; - PLAYER -
set iIndex to player.GetNumItems - 1

Label 10
set rCurrentItem to player.GetInventoryObject iIndex
if rCurrentItem
set nSetCapsAmount to (rCurrentItem.GetItemValue * fExchangeRate)
rCurrentItem.SetItemValue nSetCapsAmount

set iIndex to iIndex - 1
Goto 10
endif
; - MERCHANT -
set iIndex to player.GetNumItems - 1

Label 20
set rCurrentItem to rMerchantContainer.GetInventoryObject iIndex
if rCurrentItem
set nSetCapsAmount to (rCurrentItem.GetItemValue * fExchangeRate)
rCurrentItem.SetItemValue nSetCapsAmount

set iIndex to iIndex - 1
Goto 20
endif

 

EDIT: Oh, and I may as well add another help request instead of triple-posting in case nobody else responds. I'd like to know if there is a way to change the Barter Menu's "Caps" string to display as "$NCR" or "Denarii" as appropriate. It's a very simple script that uses dummy caps to represent value but if I can take care of the Exchange Rate and what the value is called in the Barter Screen then trading in alternate currencies will be practically indistinguishable from trading in bottle caps.

Link to comment
Share on other sites

  • Recently Browsing   0 members

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