IndexOutOfRangeException: Index was outside the bounds of the array.

I know i allready made a thread about this but it was locked.

So i still have this issue after every wipe. it spams it every second and on a server restart it's gone.

I do however have the full error this time and hope it will help. All files are valid according to jsonlint.com

IndexOutOfRangeException: Index was outside the bounds of the array.
  at NPCVendingMachine.Refill () [0x0005f] in <97fbffe92d804b8ca64976ff5d40dec3>:0 
  at InvokeHandlerBase`1[T].DoTick () [0x000be] in <d853835758ba4d2c839e94f2d563a1c6>:0 
  at InvokeHandlerBase`1[T].LateUpdate () [0x0000c] in <d853835758ba4d2c839e94f2d563a1c6>:0

I had what I think is the same issue the first time I tried to configure this plugin, I found it was because I was adding a trade to an already full vending machine. I think the maximum amount of trades a vending machine can handle is currently 7, adding more than that breaks the UI and causes that error. at least that's what I found, try swapping any custom trades you made to vending machines with fewer items and see if that helps

Based on the game code, as well as my testing, this happens when you increass the number of orders a vending machine has after server boot. For instance, if initially 6, increasing to 7, or if initially 7, increasing to 8. It works fine when rebooting though.

Not sure why it happens more on wipe, but I know this wipe folks were having issues where the plugin would not initialize correctly because the data files referred to the rising torpedo which was removed from the game. Having the plugin throw an error during load would cause some vending machines to not be set up, so reloading even after removing that item could cause the order number to change for some vending machines that are then updated. Since that effect would come late, it would cause the above issue with IndexOutOfRange.

The plugin can avoid this at least two ways, 1) by destroying and respawning the vending machine, or 2) by using custom refill logic and canceling the default refill logic.

vqpDCVQGBcbkm3b.jpg WhiteThunder

Based on the game code, as well as my testing, this happens when you increass the number of orders a vending machine has after server boot. For instance, if initially 6, increasing to 7, or if initially 7, increasing to 8. It works fine when rebooting though.

Not sure why it happens more on wipe, but I know this wipe folks were having issues where the plugin would not initialize correctly because the data files referred to the rising torpedo which was removed from the game. Having the plugin throw an error during load would cause some vending machines to not be set up, so reloading even after removing that item could cause the order number to change for some vending machines that are then updated. Since that effect would come late, it would cause the above issue with IndexOutOfRange.

The plugin can avoid this at least two ways, 1) by destroying and respawning the vending machine, or 2) by using custom refill logic and canceling the default refill logic.

Im a little confused about what i have to change to fix it though, The only thing i have done was replacing and item with a L96 at bandit camp, and change a few prices on items a bit.

For the destroy and respawn vending machine, would that be a quick and easy thing to implement into the plugin?

I get this error still even if I delete everything and start fresh.

Scottjeep

I get this error still even if I delete everything and start fresh.

Deleting everything and reloading the plugin may not fix the issue if the plugin was already loaded, since the plugin could have left the vending machines with a bad state, which the plugin would then think was the vanilla state. Should be able to solve by restarting the server.
Z8m9aX8joOEa8AZ.jpg WhiteThunder
Deleting everything and reloading the plugin may not fix the issue if the plugin was already loaded, since the plugin could have left the vending machines with a bad state, which the plugin would then think was the vanilla state. Should be able to solve by restarting the server.

i try that still the same