Jump to content
  • 0

Config based trader set up 1.0.4.1


BetterDeadThanZed

Question

I haven't looked at the 1.0.4.1 files yet, so I'm wondering if someone could explain this "Config Based Trader set up" I saw in the change log.

 

[NEW] Config based trader setup option that is more performant, however does not track inventory. DZE_ConfigTrader = true; and #include "\dayz_epoch_b\CfgServerTrader\cfgServerTrader.hpp" in description.ext @Fank @Skaronator @vbawol
Link to comment
Share on other sites

Recommended Posts

  • 0

You add DZE_ConfigTrader = true; to your init.sqf

 

Add

#include "\dayz_epoch_b\CfgServerTrader\cfgServerTrader.hpp"

to your Description.ext.

 

What it is essentially is the entire traders_data table from the database in a Cfg file instead. This is faster than the server needing to connect to the database to ask what the trader is selling, and if there is any left.

 

If you did want to switch to this though, and you have custom items in your Traders_data you need to pull a copy of cfgServerTrader.hpp from dayz_epoch_b.pbo in your @DayZ_Epoch folder, add it to your mission.pbo, and then modify it to point to the custom config based on what you are adding.

QDxvtwh.png

 

There's a config file for each trader_tids entry in your database from the looks of it.

1ewY7Oc.png

 

And the contents of these files look something like this:

class Category_577 {
	class 30Rnd_556x45_StanagSD {
		type = "trade_items";
		buy[] = {4,"ItemSilverBar10oz"};
		sell[] = {2,"ItemSilverBar10oz"};
	};
	class 5Rnd_86x70_L115A1 {
		type = "trade_items";
		buy[] = {4,"ItemGoldBar"};
		sell[] = {2,"ItemGoldBar"};
	};
	class 100Rnd_762x51_M240 {
		type = "trade_items";
		buy[] = {2,"ItemGoldBar"};
		sell[] = {1,"ItemGoldBar"};
	};
	class 20Rnd_762x51_FNFAL {
		type = "trade_items";
		buy[] = {4,"ItemSilverBar10oz"};
		sell[] = {2,"ItemSilverBar10oz"};
	};
	class 20Rnd_762x51_SB_SCAR {
		type = "trade_items";
		buy[] = {1,"ItemGoldBar"};
		sell[] = {5,"ItemSilverBar10oz"};
	};
};

Which looks like its the same as the database. The class Catagory_### probably points to a trader TID.

Link to comment
Share on other sites

  • 0

Thanks a bunch this is really going to help me once I figure out one last thing. Any recommendation on where I put this inside the description?

 

Also a tip to some who may be trying to utilize this. Make sure your server traders id's match up to any of the id's in those configs. If they do not you will not have any items displayed when you select your traders.

Link to comment
Share on other sites

  • 0

Thanks a bunch this is really going to help me once I figure out one last thing. Any recommendation on where I put this inside the description?

 

Also a tip to some who may be trying to utilize this. Make sure your server traders id's match up to any of the id's in those configs. If they do not you will not have any items displayed when you select your traders.

 

I don't think it matters, probably either the very bottom, or somewhere near the top.

Link to comment
Share on other sites

  • 0

Thanks a bunch this is really going to help me once I figure out one last thing. Any recommendation on where I put this inside the description?

 

Also a tip to some who may be trying to utilize this. Make sure your server traders id's match up to any of the id's in those configs. If they do not you will not have any items displayed when you select your traders.

 

@vbawol ?

Link to comment
Share on other sites

  • 0

Hmm, pulled a copy of the CfgServerTrader folder from the dayz_epoch_b.pbo to my missionfolder

 

 

Set

 

DZE_ConfigTrader = true

 

in my init.sqf

 

This is my description.ext

respawn = "BASE";
respawndelay = 5;
onLoadMission= "DayZ_Epoch Sauerland";
OnLoadIntro = "Welcome to Sauerland";
OnLoadIntroTime = False;
OnLoadMissionTime = False;
disabledAI = true;
disableChannels[]={0,2,6};
enableItemsDropping = 0;
#include "R3F_ARTY_AND_LOG\desc_include.h"
#include "defines.hpp"
#include "defines2.hpp"
#include "build_recipe_dialog.hpp"
#include "build_recipe_list_dialog.hpp"
#include "CfgServerTrader\cfgServerTrader.hpp"
briefing = 0;
debriefing = 0;

onPauseScript = "";
loadScreen = "custom\ladeBildschirm.jpg";

class Header
{
 gameType = COOP;            //DM, Team, Coop, ...
 minPlayers = 1;             //min # of players the mission supports
 maxPlayers = 100;            //Max # of players the mission supports
};

aiKills = 1;
diagRadio = 1;
diagHit = 1;
//
// the loading screen itself
//
class DayZ_loadingScreen
{ 
	idd = -1;
	duration = 10e10;
	fadein = 0;
	fadeout = 0;
	name = "loading screen";
	class controlsBackground
	{
		class blackBG : RscText
		{
			x = safezoneX;
			y = safezoneY;
			w = safezoneW;
			h = safezoneH;
			text = "";
			colorText[] = {0,0,0,0};
			colorBackground[] = {0,0,0,1};
		};
		/*
		class nicePic : RscPicture
		{
			style = 48 + 0x800; // ST_PICTURE + ST_KEEP_ASPECT_RATIO
			x = safezoneX + safezoneW/2 - 0.25;
			y = safezoneY + safezoneH/2 - 0.2;
			w = 0.5;
			h = 0.4;
			text = "img\nicePic.paa";
		};
		*/
	};
	class controls
	{
		class Title1 : RscLoadingText
		{
			text = "$STR_LOADING"; // "Loading" text in the middle of the screen
		};
		class CA_Progress : RscProgress // progress bar, has to have idc 104
		{
			idc = 104;
			type = 8; // CT_PROGRESS
			style = 0; // ST_SINGLE
			texture = "\ca\ui\data\loadscreen_progressbar_ca.paa";
		};
		class CA_Progress2 : RscProgressNotFreeze // progress bar that will go reverse
		{
			idc = 103;
		};
		class Name2: RscText // the text on the top-left
		{
			idc = 101;
			x = 0.05;
			y = 0.029412;
			w = 0.9;
			h = 0.04902;
			text = "";
			sizeEx = 0.05;
			colorText[] = {0.543,0.5742,0.4102,1.0};
		};
	};
};

#define CT_STATIC 0
#define ST_LEFT           0x00
#define ST_PICTURE        48

class RscTitles 
{
	#include "R3F_ARTY_AND_LOG\desc_rsct_include.h"
	class BTC_Hud
	{
		idd = 1000;
		movingEnable=0;
		duration=1e+011;
		name = "BTC_Hud_Name";
		onLoad = "uiNamespace setVariable ['HUD', _this select 0];";
		controlsBackground[] = {};
		objects[] = {};
		class controls 
		{
			class Radar
			{
				type = 0;
				idc = 1001;
				style = 48;
				x = (SafeZoneW+2*SafeZoneX) - 0.1;//safezonex + 0.1;//0.9
				y = (SafeZoneH+2*SafeZoneY) - 0.15;//safezoney + 0.1;//0.85
				w = 0.3;
				h = 0.4;
				font = "Zeppelin32";
				sizeEx = 0.03;
				colorBackground[] = {0, 0, 0, 0};
				colorText[] = {1, 1, 1, 1};
				text = "\ca\ui\data\igui_radar_air_ca.paa";
			};
			class Img_Obj
			{
				type = 0;
				idc = 1002;
				style = 48;
				x = (SafeZoneW+2*SafeZoneX) + 0.045;
				y = (SafeZoneH+2*SafeZoneY) + 0.045;
				w = 0.01;
				h = 0.01;
				font = "Zeppelin32";
				sizeEx = 0.04;
				colorBackground[] = {0, 0, 0, 0};
				colorText[] = {1, 1, 1, 1};
				text = "=BTC=_Logistic\data\=BTC=_Obj.paa";
			};
			class Pic_Obj
			{
				type = 0;
				idc = 1003;
				style = 48;
				x = (SafeZoneW+2*SafeZoneX) - 0.125;
				y = (SafeZoneH+2*SafeZoneY) - 0.23;
				w = 0.1;
				h = 0.1;
				font = "Zeppelin32";
				sizeEx = 0.03;
				colorBackground[] = {0, 0, 0, 0};
				colorText[] = {1, 1, 1, 1};
				text = "";
			};
			class Arrow
			{
				type = 0;
				idc = 1004;
				style = 48;
				x = (SafeZoneW+2*SafeZoneX) + 0.15;
				y = (SafeZoneH+2*SafeZoneY) - 0.15;
				w = 0.05;
				h = 0.05;
				font = "Zeppelin32";
				sizeEx = 0.03;
				colorBackground[] = {0, 0, 0, 0};
				colorText[] = {1, 1, 1, 1};
				text = "";
			};
			class Type_Obj
			{
				type = 0;
				idc = 1005;
				style = 0x00;
				x = (SafeZoneW+2*SafeZoneX) - 0.03;
				y = (SafeZoneH+2*SafeZoneY) - 0.335;
				w = 0.3;
				h = 0.3;
				font = "Zeppelin32";
				sizeEx = 0.03;
				colorBackground[] = {0, 0, 0, 0};
				colorText[] = {1, 1, 1, 1};
				text = "";
			};
		};   
	};
	class ExampleTitle {     
		idd = -1; 
		duration = 10; //show for 10 seconds 
		class controls 
		{ 
			class ExampleControl 
			{
				idc = -1; 
				type = 0; 
				style = 2; //centre text 
				x = safeZoneX + safeZoneW - 0.6 * 3 / 4;  
				y = safeZoneY + safeZoneH - 0.6; 
				h = 0.6; 
				w = 0.6 * 3 / 4; //w == h 
				font = "EtelkaNarrowMediumPro"; 
				sizeEx = 0.03; 
				colorBackground[] = {1,1,0,1}; //yellow background 
				colorText[] = {0,0,1,1}; //blue text 
				text = "Bottom Right Corner Square Box"; 
			};
		};
	};
	titles[] ={BTC_intro};
	class BTC_intro
	{
		idd=-1;
		movingEnable = true;
		duration=6; // Fade Duration
		fadein=2; // Fade Time
		name = "BTC_intro"; // Name in Editor
		controls[]={Picture};
		class Picture : RscPicture
		{
			x = 0.05; // X-Axis
			y = 0.10; // Y-Axis
			w = 0.25; //WindowWidth
			h = 0.40; //Window Height
			text = "=BTC=_logo.paa"; // Graphic Direction
			sizeEx = 0.04;
			style = ST_PICTURE;
		};
	};
};
class CfgSounds
{
	sounds[] = 
	{
		introSong,
		letsGo,
		hillbilly,
		bark,
		growl,
		whistleFollow,
		whistleStay,
		whistleFind,
		whistleNon
	};

    class introSong
    {
		name="introSong";
		sound[]={introSong.ogg,0.9,1};
		titles[] = {};
    };

    class letsGo
    {
		name="letsGo";
		sound[]={letsgo.ogg,0.9,1};
		titles[] = {};
    };

	class hillbilly
	{
		name="hillbilly";
		sound[]={hillbilly.ogg,0.9,1};
		titles[] = {};
	};
	class bark
	{
		name="bark";
		sound[]={custom\dog\fx\bark.ogg,0.4,1};
		titles[] = {};
	};
	class growl
	{
		name="growl";
		sound[]={custom\dog\fx\growl.ogg,0.5,1};
		titles[] = {};
	};
	class whistleFollow
	{
		name="whistleFollow";
		sound[]={custom\dog\fx\whistleFollow.ogg,0.8,1};
		titles[] = {};
	};
	class whistleStay
	{
		name="whistleStay";
		sound[]={custom\dog\fx\whistleStay.ogg,0.8,1};
		titles[] = {};
	};
	class WhistleFind
	{
		name="WhistleFind";
		sound[]={custom\dog\fx\whistleFind.ogg,0.8,1};
		titles[] = {};
	};
	class whistleNon
	{
		name="whistleNon";
		sound[]={custom\dog\fx\whistleNon.ogg,0.9,1};
		titles[] = {};
	};
};
#include "custom\points.hpp"
#include "RscDisplayCharacterSelect.hpp"

And still have the same items and prices as they are set in the Database traders_data table

All new items or prices i changed in all of the CfgServerTrader\Category\ files seems not to get loaded.

 

Anything im missing?

 

Moo,

Otter

Link to comment
Share on other sites

  • 0

Hmm, pulled a copy of the CfgServerTrader folder from the dayz_epoch_b.pbo to my missionfolder

 

 

Set

 

DZE_ConfigTrader = true

 

in my init.sqf

 

This is my description.ext

 

And still have the same items and prices as they are set in the Database traders_data table

All new items or prices i changed in all of the CfgServerTrader\Category\ files seems not to get loaded.

 

Anything im missing?

 

Moo,

Otter

 

You need to point them to new versions in your mission.pbo.

 

I believe cfgServerTrader.hpp still points to the pbo instead of your files unless you change the lines in it.

Link to comment
Share on other sites

  • 0
class CfgTraderCategory {
	#include "Category\BanditAmmunition.hpp"
	#include "Category\BanditClothing.hpp"
	#include "Category\BanditHelicopterArmed.hpp"
	#include "Category\BanditMilitaryArmed.hpp"
	#include "Category\BanditTrucksArmed.hpp"
	#include "Category\BanditWeapons.hpp"
	#include "Category\FriendlyAssaultRifle.hpp"
	#include "Category\FriendlyAssaultRifleAmmo.hpp"
	#include "Category\FriendlyBackpacks.hpp"
	#include "Category\FriendlyBikesandATV.hpp"
	#include "Category\FriendlyBuildingSupplies.hpp"
	#include "Category\FriendlyBusesandVans.hpp"
	#include "Category\FriendlyCargoTrucks.hpp"
	#include "Category\FriendlyChemlitesFlares.hpp"
	#include "Category\FriendlyClothes.hpp"
	#include "Category\FriendlyCookedMeats.hpp"
	#include "Category\FriendlyDrinks.hpp"
	#include "Category\FriendlyFuelTrucks.hpp"
	#include "Category\FriendlyLightMachineGun.hpp"
	#include "Category\FriendlyLightMachineGunAmmo.hpp"
	#include "Category\FriendlyMedicalSupplies.hpp"
	#include "Category\FriendlyMilitaryUnarmed.hpp"
	#include "Category\FriendlyPackagedFood.hpp"
	#include "Category\FriendlyPistolAmmo.hpp"
	#include "Category\FriendlyPistols.hpp"
	#include "Category\FriendlyShotgunsandSingleshot.hpp"
	#include "Category\FriendlyShotgunsandSingleshotAmmo.hpp"
	#include "Category\FriendlySmokeGrenades.hpp"
	#include "Category\FriendlySniperRifle.hpp"
	#include "Category\FriendlySniperRifleAmmo.hpp"
	#include "Category\FriendlySubmachineGunAmmo.hpp"
	#include "Category\FriendlySubmachineGuns.hpp"
	#include "Category\FriendlyToolbeltItems.hpp"
	#include "Category\FriendlyTrucks.hpp"
	#include "Category\FriendlyTrucksUnarmed.hpp"
	#include "Category\FriendlyUsedCars.hpp"
	#include "Category\FriendlyUtilityVehicles.hpp"
	#include "Category\FriendlyVehicleParts.hpp"
	#include "Category\HeroAmmunition.hpp"
	#include "Category\HeroClothes.hpp"
	#include "Category\HeroHelicopterArmed.hpp"
	#include "Category\HeroMilitaryArmed.hpp"
	#include "Category\HeroTrucksArmed.hpp"
	#include "Category\HeroWeapons.hpp"
	#include "Category\NeutralAirplanes.hpp"
	#include "Category\NeutralAssaultRifle.hpp"
	#include "Category\NeutralAssaultRifleAmmo.hpp"
	#include "Category\NeutralBackpacks.hpp"
	#include "Category\NeutralBikesandATV.hpp"
	#include "Category\NeutralBlackMarketAmmo.hpp"
	#include "Category\NeutralBlackMarketWeapons.hpp"
	#include "Category\NeutralBoatsArmed.hpp"
	#include "Category\NeutralBoatsUnarmed.hpp"
	#include "Category\NeutralBuildingSupplies.hpp"
	#include "Category\NeutralBusesandVans.hpp"
	#include "Category\NeutralCargoTrucks.hpp"
	#include "Category\NeutralChemlitesFlares.hpp"
	#include "Category\NeutralClothes.hpp"
	#include "Category\NeutralCookedMeats.hpp"
	#include "Category\NeutralDrinks.hpp"
	#include "Category\NeutralExplosives.hpp"
	#include "Category\NeutralFuelTrucks.hpp"
	#include "Category\NeutralHelicopterUnarmed.hpp"
	#include "Category\NeutralLightMachineGun.hpp"
	#include "Category\NeutralLightMachineGunAmmo.hpp"
	#include "Category\NeutralMedicalSupplies.hpp"
	#include "Category\NeutralMilitaryUnarmed.hpp"
	#include "Category\NeutralPackagedFood.hpp"
	#include "Category\NeutralPistolAmmo.hpp"
	#include "Category\NeutralPistols.hpp"
	#include "Category\NeutralShotgunsandSingleshot.hpp"
	#include "Category\NeutralShotgunsandSingleshotAmmo.hpp"
	#include "Category\NeutralSmokeGrenades.hpp"
	#include "Category\NeutralSniperRifle.hpp"
	#include "Category\NeutralSniperRifleAmmo.hpp"
	#include "Category\NeutralSubmachineGunAmmo.hpp"
	#include "Category\NeutralSubmachineGuns.hpp"
	#include "Category\NeutralToolbeltItems.hpp"
	#include "Category\NeutralTrucks.hpp"
	#include "Category\NeutralUsedCars.hpp"
	#include "Category\NeutralUtilityVehicles.hpp"
	#include "Category\NeutralVehicleParts.hpp"
	#include "Category\NeutralWholesale.hpp"
};

if i change the path to something like:

"CfgServerTrader\Category\Neutralxxxxx.hpp"

 

it says cant find the file, so the files get called it seems but nothing changes when i get into trader menu.

I changed for example the prices for the AN2 on the airplane dealer which is TID 517 on Cherno and also on Sauerland.

But it has always the price i set in the database.

If i change the price in the database and restart server it changes fine.

But it dont take the changes from these files :wacko:

Link to comment
Share on other sites

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now
  • Advertisement
  • Discord

×
×
  • Create New...