Trader's stuff update rate

Mulligun

Still Mildly Glowing
Chow do I change the rate of traders/merchants inventory change/reload (e.g. NCR trader). I'd like to see they offer new stuff more frequently.
 
Mulligun said:
Chow do I change the rate of traders/merchants inventory change/reload (e.g. NCR trader). I'd like to see they offer new stuff more frequently.

You must edit scripts for stock boxes of individual merchants in the game. Here's code from Sajag's equipment box in Klamath (kisbox.ssl):


Code:
   if (local_var(LVAR_Restock_Time) < game_time) then begin
      check_restock_item(PID_BOTTLE_CAPS, 125, 250, 100)
      check_restock_item(PID_LEATHER_JACKET, 1, 1, 100)
      check_restock_item(PID_KNIFE, 1, 2, 100)
      check_restock_item(PID_THROWING_KNIFE, 2, 4, 100)
      check_restock_item(PID_10MM_JHP, 0, 3, 100)
      check_restock_item(PID_STIMPAK, 2, 4, 100)
      check_restock_item(PID_MEAT_JERKY, 3, 4, 100)
      check_restock_item(PID_BEER, 3, 6, 100)
      check_restock_item(PID_BOOZE, 2, 4, 100)
      check_restock_item(PID_LEATHER_ARMOR, 0, 1, 50)
      check_restock_item(PID_10MM_PISTOL, 0, 1, 100)
      check_restock_item(PID_SPEAR, 1, 2, 100)
      check_restock_item(PID_SPRINGER_RIFLE, 0, 2, 100)
      check_restock_item(PID_RADAWAY, 0, 2, 100)
      set_local_var(LVAR_Restock_Time, (2 * ONE_GAME_DAY) + game_time);
   end

This code is located in map_enter_p_proc procedure, and the bit that interests you is this:

Code:
set_local_var(LVAR_Restock_Time, (2 * ONE_GAME_DAY) + game_time);

Change the number 2 to e.g. 1, or change the ONE_GAME_DAY to e.g. ONE_GAME_HOUR, and Sajag will restock every day or every two hours respectively, BUT you have to exit the map and re-enter it for him to perform this action.

When you've edited the script, you'll have to compile it. I suggest using either Jargo's FSE or Timeslip's script editor bundled in the sfall modderspack.

Good luck.
 
Back
Top