Jump to content

1.1.0 Trader ammo inventories config vs. reality


phm

Recommended Posts

After a bit of testing with new databases, it's seems that numeric values in epochconfig.hpp/ starterTraderItems[] are being interpreted as number of rounds in a clip rather than number of clips.

Is there some way to specify both, or is the starterTraderItems[] value being put in the wrong place (#rounds vs. # of clips)?

Thanks!

 

 

 

 

Link to comment
Share on other sites

12 hours ago, He-Man said:

Yep, all mags in traders are only calculated by rounds now. 

So if you want 2 Mags of 20rnd_... you have to set the value to 40.

 

Thanks for this!  With this in mind, I tested more.  It seems the max that I can get to go into a belt (e.g, mk200) is 100 rounds.  What am I doing wrong?

Link to comment
Share on other sites

Hmm, just tested it and for me it is working fine:
 

	starterTraderItems[] = { 			// Starter Items for fresh spawned trader first array is classnames second is quantity.
		{"ItemSodaBurst","meatballs_epoch","VehicleRepair","KitPlotPole","Hatchet","MeleeSledge","200Rnd_556x45_Box_F"},
		{5,5,5,2,2,2,400}
	};

https://www.dropbox.com/s/rdqdk9p2fcmmn9s/20180329023201_1.jpg?dl=0

Link to comment
Share on other sites

15 hours ago, He-Man said:

Hmm, just tested it and for me it is working fine:
 


	starterTraderItems[] = { 			// Starter Items for fresh spawned trader first array is classnames second is quantity.
		{"ItemSodaBurst","meatballs_epoch","VehicleRepair","KitPlotPole","Hatchet","MeleeSledge","200Rnd_556x45_Box_F"},
		{5,5,5,2,2,2,400}
	};

https://www.dropbox.com/s/rdqdk9p2fcmmn9s/20180329023201_1.jpg?dl=0

 

Still not working for me (see attached jpeg).  The trader should have 10 clips.

	        starterTraderItems[] = {                        // Starter Items for fresh spawned trader first array is classnames second is quantity.
{"150Rnd_556x45_Drum_Mag_F"},{1500}
        };
        NPCSlotsLimit = 30;                             // Max number of traders static or dynamic. Warning! Higher the number lower performance.
        forceStaticTraders = "true";            // disables traders moving from work to home
        TraderGodMode = "false";                        // If true, Trader can not be killed by Players
        storedVehicleLimit = 15;                        // Vehicles more than x stored in ALL Traders will automatically be deleted on Restart.
        StaticTraderItemPurge[] = {99999,1};    // {ItemCount,ReducePercent} - If a static trader have more than x different items, on restart the items will be reduced by y percent
        DynamicTraderRespawnCount = 99999;      // If a dynamic Trader have more than x different Items, he will respawn on another Spot (with start Items)
        TraderItemCountPerItem[] = {99999,99998};       // If the Trader has more than x pieces of an Item, it will be reduced to y pieces (on Restart)
        TraderItemsDeleteInstant[] = {          // List of Items, that will be deleted from Trader instant after sell
                // "ItemVehDoc1",
                // "ItemVehDoc2",
                // "ItemVehDoc3",
                // "ItemVehDoc4"
        };
        TraderItemsDeleteRestart[] = {          // List of Items, that will be deleted from Trader on Restart
                // "ItemLockbox",
                // "ItemSafe",
                // "ItemGoldBar10oz"
        };
	

 

epoch_inv_20180329.jpg

Link to comment
Share on other sites

1 minute ago, He-Man said:

THanks @Grahame, that's it, I think. Will double check it tomorrow.

 

Ok, thanks.  Shouldn't this also be in epochconfig.hpp?

And in the meantime, where should I edit this?

<mission_file>/compile/traders/EPOCH_npc_TraderAdd.sqf ?

Link to comment
Share on other sites

@phmThe lines should be simply removed now there are new methods to set trader limits - was a holdover from previous versions I think. Grep-ed all of EpochMod source. Used in epoch_code/compile/traders/EPOCH_npc_TraderAdd.sqf and epoch_server/compile/epoch_traders/EPOCH_server_loadTraders.sqf

The fix will require code changes to alter _limit properly but to test and give you a quick fix, change line 60 of epoch_code/compile/traders/EPOCH_npc_TraderAdd.sqf to

				_limit = 5000;

and line 56 of epoch_server/compile/epoch_traders/EPOCH_server_loadTraders.sqf to read the same.

Let us know whether that fixes it for you. I will try on my dev server when I finish work later if I do not hear back first.

Link to comment
Share on other sites

Actual fix (will test) would be to remove lines 60-64 in epoch_code/compile/traders/EPOCH_npc_TraderAdd.sqf:

				_limit = ["CfgTraderLimits", _uiItem, 100] call EPOCH_fnc_returnConfigEntryV2;
				if (_itemQty >= _limit) then{
					_stockLimit = true;
					_allowAdd = false;
				};

and in epoch_server/compile/epoch_traders/EPOCH_server_loadTraders.sqf, remove line 56:

		_limit = ["CfgTraderLimits", _item, 100] call EPOCH_fnc_returnConfigEntryV2;

Remove lines 63 to 68:

		if (_limit == 0 || _currentStock == 0) then {
//			diag_log format ["EPOCH_DEBUG: TraderSlot: %1 | Removed %2 from Trader | _limit: %3 | _currentStock: %4",_i,str _item, _limit,_currentStock];
			_arrchanged = true;
			_delete = true;
		} 
		else {

Remove lines 75-79:

				if (_currentStock > _limit) then {
					_arrchanged = true;
					(_arr select 1) set [_idx,_limit];
					_currentStock = _limit;
				};

and remove line 112:

		};

 

Link to comment
Share on other sites

3 hours ago, Grahame said:

@phmThe lines should be simply removed now there are new methods to set trader limits - was a holdover from previous versions I think. Grep-ed all of EpochMod source. Used in epoch_code/compile/traders/EPOCH_npc_TraderAdd.sqf and epoch_server/compile/epoch_traders/EPOCH_server_loadTraders.sqf

The fix will require code changes to alter _limit properly but to test and give you a quick fix, change line 60 of epoch_code/compile/traders/EPOCH_npc_TraderAdd.sqf to


				_limit = 5000;

and line 56 of epoch_server/compile/epoch_traders/EPOCH_server_loadTraders.sqf to read the same.

Let us know whether that fixes it for you. I will try on my dev server when I finish work later if I do not hear back first.

After changing values in both of those files (just changing the one in the mission file had no affect), it's working as expected.

Thanks @He-Man and @Grahame for your help!  Looking forward to fix(es) in the next release.

Link to comment
Share on other sites

I have doublechecked it and the problem was a missing recalculation of the current stock in the cleanup checks.

Anyway the "old" cfgtraderlimit is no longer needed and has been removed (last post).

Edit:
I am currently sorting some last things out..

 

Edit2:
I think I got everything now. Please take these 2 changed files and let me know, if it works as expected:

https://github.com/EpochModTeam/Epoch/blob/experimental/Sources/epoch_server/compile/epoch_traders/EPOCH_server_loadTraders.sqf

https://github.com/EpochModTeam/Epoch/blob/experimental/Sources/epoch_code/compile/traders/EPOCH_npcTraderAdd.sqf

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Advertisement
  • Discord

×
×
  • Create New...