From 185d84f14f341e0e321760eb6258f0ba15312ca9 Mon Sep 17 00:00:00 2001 From: ebaydayz Date: Sun, 27 Nov 2016 20:30:34 -0500 Subject: [PATCH] Remove unneeded global var Z_AT_FolderLocation This variable is not useful. If you change it you need to copy all the AT files to your mission. It is fewer files in the mission to just overwrite the path in compiles and fn_selfActions. Also fixed mistake with not replacing macros in scripts.txt with their actual values. --- .../actions/AdvancedTrading/defaultInit.sqf | 18 ++-- .../actions/AdvancedTrading/init.sqf | 84 ++++++++++--------- SQF/dayz_code/configVariables.sqf | 1 - Server Files/Battleye/scripts.txt | 2 +- 4 files changed, 56 insertions(+), 49 deletions(-) diff --git a/SQF/dayz_code/actions/AdvancedTrading/defaultInit.sqf b/SQF/dayz_code/actions/AdvancedTrading/defaultInit.sqf index 042e2b286..482a74be3 100644 --- a/SQF/dayz_code/actions/AdvancedTrading/defaultInit.sqf +++ b/SQF/dayz_code/actions/AdvancedTrading/defaultInit.sqf @@ -1,3 +1,7 @@ +#define STRINGIFY(x) #x +#define PATH(sub_path) STRINGIFY(\z\addons\dayz_code\actions\AdvancedTrading\functions\sub_path) +#define CPP compile preprocessFileLineNumbers + private ["_tempGemList","_tempWorthList","_largest","_LargestGem"]; Z_SellingFrom = 2; @@ -26,10 +30,10 @@ for "_i" from 0 to ((count _tempGemList) - 1) do { DZE_GemWorthList set [(count DZE_GemWorthList), _largest]; }; -Z_checkCloseVehicle = compile preprocessFileLineNumbers (Z_AT_FolderLocation + "\functions\z_at_checkCloseVehicle.sqf"); -Z_canAfford = compile preprocessFileLineNumbers (Z_AT_FolderLocation + "\functions\z_at_canAfford.sqf"); -Z_calcFreeSpace = compile preprocessFileLineNumbers (Z_AT_FolderLocation + "\functions\z_at_calcFreeSpace.sqf"); -Z_returnChange = compile preprocessFileLineNumbers (Z_AT_FolderLocation + "\functions\z_at_returnChange.sqf"); -Z_payDefault = compile preprocessFileLineNumbers (Z_AT_FolderLocation + "\functions\z_at_payDefault.sqf"); -z_calcDefaultCurrencyNoImg = compile preprocessFileLineNumbers (Z_AT_FolderLocation + "\functions\z_at_calcDefaultCurrencyNoImg.sqf"); -ZUPA_fnc_removeWeaponsAndMagazinesCargo = compile preprocessFileLineNumbers (Z_AT_FolderLocation + "\functions\zupa_fnc_removeWeaponsAndMagazinesCargo.sqf"); +Z_checkCloseVehicle = CPP PATH(z_at_checkCloseVehicle.sqf); +Z_canAfford = CPP PATH(z_at_canAfford.sqf); +Z_calcFreeSpace = CPP PATH(z_at_calcFreeSpace.sqf); +Z_returnChange = CPP PATH(z_at_returnChange.sqf); +Z_payDefault = CPP PATH(z_at_payDefault.sqf); +z_calcDefaultCurrencyNoImg = CPP PATH(z_at_calcDefaultCurrencyNoImg.sqf); +ZUPA_fnc_removeWeaponsAndMagazinesCargo = CPP PATH(zupa_fnc_removeWeaponsAndMagazinesCargo.sqf); diff --git a/SQF/dayz_code/actions/AdvancedTrading/init.sqf b/SQF/dayz_code/actions/AdvancedTrading/init.sqf index ed90fd6d3..ea04bb5d0 100644 --- a/SQF/dayz_code/actions/AdvancedTrading/init.sqf +++ b/SQF/dayz_code/actions/AdvancedTrading/init.sqf @@ -1,3 +1,7 @@ +#define STRINGIFY(x) #x +#define PATH(sub_path) STRINGIFY(\z\addons\dayz_code\actions\AdvancedTrading\functions\sub_path) +#define CPP compile preprocessFileLineNumbers + disableSerialization; Z_traderData = (_this select 3); // gets the trader data ( e.g menu_Functionary1 ) @@ -24,46 +28,46 @@ if (isNil "Z_AdvancedTradingInit") then { /* end script config */ - Z_fillTradeTitle = compile preprocessFileLineNumbers (Z_AT_FolderLocation + "\functions\z_at_fillTradeTitle.sqf"); - Z_clearLists = compile preprocessFileLineNumbers (Z_AT_FolderLocation + "\functions\z_at_clearLists.sqf"); - Z_clearSellableList = compile preprocessFileLineNumbers (Z_AT_FolderLocation + "\functions\z_at_clearSellableList.sqf"); - Z_clearBuyList = compile preprocessFileLineNumbers (Z_AT_FolderLocation + "\functions\z_at_clearBuyList.sqf"); - Z_clearBuyingList = compile preprocessFileLineNumbers (Z_AT_FolderLocation + "\functions\z_at_clearBuyingList.sqf"); - Z_fillCategories = compile preprocessFileLineNumbers (Z_AT_FolderLocation + "\functions\z_at_fillCategories.sqf"); - Z_getItemInfo = compile preprocessFileLineNumbers (Z_AT_FolderLocation + "\functions\z_at_getItemInfo.sqf"); - Z_getItemConfig = compile preprocessFileLineNumbers (Z_AT_FolderLocation + "\functions\z_at_getItemConfig.sqf"); - Z_displayItemInfo = compile preprocessFileLineNumbers (Z_AT_FolderLocation + "\functions\z_at_displayItemInfo.sqf"); - Z_displayWeaponInfo = compile preprocessFileLineNumbers (Z_AT_FolderLocation + "\functions\z_at_displayWeaponInfo.sqf"); - Z_displayBackpackInfo = compile preprocessFileLineNumbers (Z_AT_FolderLocation + "\functions\z_at_displayBackpackInfo.sqf"); - Z_displayVehicleInfo = compile preprocessFileLineNumbers (Z_AT_FolderLocation + "\functions\z_at_displayVehicleInfo.sqf"); - Z_getContainer = compile preprocessFileLineNumbers (Z_AT_FolderLocation + "\functions\z_at_getContainer.sqf"); - Z_getBackpackItems = compile preprocessFileLineNumbers (Z_AT_FolderLocation + "\functions\z_at_getBackpackItems.sqf"); - Z_getVehicleItems = compile preprocessFileLineNumbers (Z_AT_FolderLocation + "\functions\z_at_getVehicleItems.sqf"); - Z_getGearItems = compile preprocessFileLineNumbers (Z_AT_FolderLocation + "\functions\z_at_getGearItems.sqf"); - Z_logTrade = compile preprocessFileLineNumbers (Z_AT_FolderLocation + "\functions\z_at_logTrade.sqf"); - Z_filterList = compile preprocessFileLineNumbers (Z_AT_FolderLocation + "\functions\z_at_filterList.sqf"); - Z_checkArrayInConfig = compile preprocessFileLineNumbers (Z_AT_FolderLocation + "\functions\z_at_checkArrayInConfig.sqf"); - Z_calcPrice = compile preprocessFileLineNumbers (Z_AT_FolderLocation + "\functions\z_at_calcPrice.sqf"); - Z_fillCategoryList = compile preprocessFileLineNumbers (Z_AT_FolderLocation + "\functions\z_at_fillCategoryList.sqf"); - Z_fillSellList = compile preprocessFileLineNumbers (Z_AT_FolderLocation + "\functions\z_at_fillSellList.sqf"); - Z_fillSellingList = compile preprocessFileLineNumbers (Z_AT_FolderLocation + "\functions\z_at_fillSellingList.sqf"); - Z_pushItemToList = compile preprocessFileLineNumbers (Z_AT_FolderLocation + "\functions\z_at_pushItemToList.sqf"); - Z_removeItemFromList = compile preprocessFileLineNumbers (Z_AT_FolderLocation + "\functions\z_at_removeItemFromList.sqf"); - Z_pushAllToList = compile preprocessFileLineNumbers (Z_AT_FolderLocation + "\functions\z_at_pushAllToList.sqf"); - Z_removeAllToList = compile preprocessFileLineNumbers (Z_AT_FolderLocation + "\functions\z_at_removeAllToList.sqf"); - Z_SellItems = compile preprocessFileLineNumbers (Z_AT_FolderLocation + "\functions\z_at_sellItems.sqf"); - Z_BuyItems = compile preprocessFileLineNumbers (Z_AT_FolderLocation + "\functions\z_at_buyItems.sqf"); - Z_ChangeBuySell = compile preprocessFileLineNumbers (Z_AT_FolderLocation + "\functions\z_at_changeBuySell.sqf"); - Z_removeAllFromBuyingList = compile preprocessFileLineNumbers (Z_AT_FolderLocation + "\functions\z_at_removeAllFromBuyingList.sqf"); - Z_removeItemFromBuyingList = compile preprocessFileLineNumbers (Z_AT_FolderLocation + "\functions\z_at_removeItemFromBuyingList.sqf"); - Z_toBuyingList = compile preprocessFileLineNumbers (Z_AT_FolderLocation + "\functions\z_at_toBuyingList.sqf"); - Z_calcBuyableList = compile preprocessFileLineNumbers (Z_AT_FolderLocation + "\functions\z_at_calcBuyableList.sqf"); - Z_fillBuyableList = compile preprocessFileLineNumbers (Z_AT_FolderLocation + "\functions\z_at_fillBuyableList.sqf"); - Z_fillBuyingList = compile preprocessFileLineNumbers (Z_AT_FolderLocation + "\functions\z_at_fillBuyingList.sqf"); - Z_displayFreeSpace = compile preprocessFileLineNumbers (Z_AT_FolderLocation + "\functions\z_at_displayFreeSpace.sqf"); - Z_allowBuying = compile preprocessFileLineNumbers (Z_AT_FolderLocation + "\functions\z_at_allowBuying.sqf"); - Z_calcDefaultCurrency = compile preprocessFileLineNumbers (Z_AT_FolderLocation + "\functions\z_at_calcDefaultCurrency.sqf"); - DZE_deleteTradedVehicle = compile preprocessFileLineNumbers (Z_AT_FolderLocation + "\functions\DZE_deleteTradedVehicle.sqf"); + Z_fillTradeTitle = CPP PATH(z_at_fillTradeTitle.sqf); + Z_clearLists = CPP PATH(z_at_clearLists.sqf); + Z_clearSellableList = CPP PATH(z_at_clearSellableList.sqf); + Z_clearBuyList = CPP PATH(z_at_clearBuyList.sqf); + Z_clearBuyingList = CPP PATH(z_at_clearBuyingList.sqf); + Z_fillCategories = CPP PATH(z_at_fillCategories.sqf); + Z_getItemInfo = CPP PATH(z_at_getItemInfo.sqf); + Z_getItemConfig = CPP PATH(z_at_getItemConfig.sqf); + Z_displayItemInfo = CPP PATH(z_at_displayItemInfo.sqf); + Z_displayWeaponInfo = CPP PATH(z_at_displayWeaponInfo.sqf); + Z_displayBackpackInfo = CPP PATH(z_at_displayBackpackInfo.sqf); + Z_displayVehicleInfo = CPP PATH(z_at_displayVehicleInfo.sqf); + Z_getContainer = CPP PATH(z_at_getContainer.sqf); + Z_getBackpackItems = CPP PATH(z_at_getBackpackItems.sqf); + Z_getVehicleItems = CPP PATH(z_at_getVehicleItems.sqf); + Z_getGearItems = CPP PATH(z_at_getGearItems.sqf); + Z_logTrade = CPP PATH(z_at_logTrade.sqf); + Z_filterList = CPP PATH(z_at_filterList.sqf); + Z_checkArrayInConfig = CPP PATH(z_at_checkArrayInConfig.sqf); + Z_calcPrice = CPP PATH(z_at_calcPrice.sqf); + Z_fillCategoryList = CPP PATH(z_at_fillCategoryList.sqf); + Z_fillSellList = CPP PATH(z_at_fillSellList.sqf); + Z_fillSellingList = CPP PATH(z_at_fillSellingList.sqf); + Z_pushItemToList = CPP PATH(z_at_pushItemToList.sqf); + Z_removeItemFromList = CPP PATH(z_at_removeItemFromList.sqf); + Z_pushAllToList = CPP PATH(z_at_pushAllToList.sqf); + Z_removeAllToList = CPP PATH(z_at_removeAllToList.sqf); + Z_SellItems = CPP PATH(z_at_sellItems.sqf); + Z_BuyItems = CPP PATH(z_at_buyItems.sqf); + Z_ChangeBuySell = CPP PATH(z_at_changeBuySell.sqf); + Z_removeAllFromBuyingList = CPP PATH(z_at_removeAllFromBuyingList.sqf); + Z_removeItemFromBuyingList = CPP PATH(z_at_removeItemFromBuyingList.sqf); + Z_toBuyingList = CPP PATH(z_at_toBuyingList.sqf); + Z_calcBuyableList = CPP PATH(z_at_calcBuyableList.sqf); + Z_fillBuyableList = CPP PATH(z_at_fillBuyableList.sqf); + Z_fillBuyingList = CPP PATH(z_at_fillBuyingList.sqf); + Z_displayFreeSpace = CPP PATH(z_at_displayFreeSpace.sqf); + Z_allowBuying = CPP PATH(z_at_allowBuying.sqf); + Z_calcDefaultCurrency = CPP PATH(z_at_calcDefaultCurrency.sqf); + DZE_deleteTradedVehicle = CPP PATH(DZE_deleteTradedVehicle.sqf); Z_AdvancedTradingInit = true; }; diff --git a/SQF/dayz_code/configVariables.sqf b/SQF/dayz_code/configVariables.sqf index 76e5dea4f..651225d8c 100644 --- a/SQF/dayz_code/configVariables.sqf +++ b/SQF/dayz_code/configVariables.sqf @@ -60,7 +60,6 @@ DZE_serverLogTrades = true; // Log trades to server RPT (sent with publicVariabl DZE_GemWorthArray = [["ItemTopaz",15000], ["ItemObsidian",20000], ["ItemSapphire",25000], ["ItemAmethyst",30000], ["ItemEmerald",35000], ["ItemCitrine",40000], ["ItemRuby",45000]]; // Array of gem prices, only works with config traders. DZE_SaleRequiresKey = false; // Require the player has the key for a vehicle in order to sell it. The key can be in the player's toolbelt, backpack, or the vehicle's inventory. DZE_TRADER_SPAWNMODE = false; // Vehicles purchased at traders will be parachuted in -Z_AT_FolderLocation = '\z\addons\dayz_code\actions\AdvancedTrading'; Z_VehicleDistance = 40; // Max distance a vehicle can be sold or accessed from at a trader. Z_AllowTakingMoneyFromBackpack = true; // Allow traders to take money from backpacks when buying with default currency. Z_AllowTakingMoneyFromVehicle = true; // Allow traders to take money from vehicles when buying with default currency. diff --git a/Server Files/Battleye/scripts.txt b/Server Files/Battleye/scripts.txt index 7294f8894..d21b1f59e 100644 --- a/Server Files/Battleye/scripts.txt +++ b/Server Files/Battleye/scripts.txt @@ -25,7 +25,7 @@ 5 "groupIcon" !="uiNamespace setVariable ['DZ_GroupIcons',_this select 0];" !="80000 cutRsc [\"DZ_GroupIcons\",\"PLAIN\"];" !="_display = uiNamespace getVariable \"DZ_GroupIcons\";" !"if (!isNull (uiNamespace getVariable \"DZ_GroupIcons\")) then {" !"dayz_groupIcons = compile preprocessFileLineNumbers " !="if (!isNil \"dayz_groupIcons\") then {call dayz_groupIcons;};" 5 "hideObject" !"\"setMarkerPosLocal\",\n\"hideObject\"\n];" !="rhideObject = 'hideObject'" !"rhideObjectcode" !"\"hideObject\", \"hint\"," 5 "lbCurSel" !="_selectedMissionIndex = lbCurSel _lbMissionsControl;" !="_selectedUserIndex = lbCurSel _lbUsersControl;" !="profileNamespace setVariable ['streamerMode',(lbCurSel (_this select 0))];" !="_index = lbCurSel _lbcontrol;" !="_selected = lbCurSel _list;" !="_friendName = _userList lbText (lbCurSel _userList);" !")] call Z_" !"(lbCurSel 7421) call Z_fillCategoryList" !"] call Door" !"] call Plot" !")] spawn TraderDialog" !="[(lbCurSel 21000), ((ctrlParent (_this select 0)) displayCtrl 21001)] spawn EpochDeathBoardClick;" !"((ctrlParent (_this select 0)) closeDisplay 2);" !="_uid = _playerList lbData (lbCurSel _playerList);" !"_myGroup lbData (lbCurSel _myGroup);" -1 "lbSet" !="_lbUsersControl lbSetColor [_x, [1,0,0,1]];" !="_lbUsersControl lbSetValue [_x, _rating];" !="_control lbSetColor [_x, _color];" !"_weaponsLBSetFocus" !="(_this select 0) displayCtrl 140 lbSetCurSel (profileNamespace getVariable ['streamerMode',0]);" !="(_display displayCtrl 105) lbSetColor [_i, [0.06, 0.05, 0.03, 1]];" !"[Z_AT_BUYABLELIST," !"lbSetPicture [Z_AT_BUYINGLIST, _index" !"lbSetPicture [Z_AT_SELLINGLIST, _index" !"lbSetPicture [Z_AT_SELLABLELIST, _index" !="_userList lbSetData [(lbSize _userList) -1,_friendUID];" !" [TraderDialogItemList, _index, " !"_myGroup lbSetData [_index,getPlayerUID _x];" +1 "lbSet" !="_lbUsersControl lbSetColor [_x, [1,0,0,1]];" !="_lbUsersControl lbSetValue [_x, _rating];" !="_control lbSetColor [_x, _color];" !"_weaponsLBSetFocus" !="(_this select 0) displayCtrl 140 lbSetCurSel (profileNamespace getVariable ['streamerMode',0]);" !="(_display displayCtrl 105) lbSetColor [_i, [0.06, 0.05, 0.03, 1]];" !"[7421," !"lbSetPicture [7422, _index" !"lbSetPicture [7402, _index" !"lbSetPicture [7401, _index" !="_userList lbSetData [(lbSize _userList) -1,_friendUID];" !" [TraderDialogItemList, _index, " !"_myGroup lbSetData [_index,getPlayerUID _x];" 5 "onMapSingleClick" 5 "playableUnits" !"for [{_y=0},{_y < count(playableUnits)},{_y=_y+1}] do {" !"typeName player == \"OBJECT\")}) AND {((player in playableUnits) AND {(alive player)" !"(1 max count playableUnits)) min (dayz_maxAnimals - _count))) to 1 step -1 do {" !"AND {((alive _x) AND {((vehicle _x) distance _obj < 150)})}} count playableUnits)}) then {" !="_local = { _unit distance _x < _dis; } count playableUnits <= 1;" !"if (!_isOk) exitWith {false};\nuiSleep 0.001;\n} forEach playableUnits;" !"ManagementMustBeClose) then { player nearEntities [\"CAManBase\", 10] } else { playableUnits };" 5 "selectPlayer" !"dayz_originalPlayer enableSimulation true;\naddSwitchableUnit dayz_originalPlayer;\nsetPlayable dayz_originalPlayer;\nselectPlayer dayz_originalPlayer;" !"addSwitchableUnit _newUnit;\nsetPlayable _newUnit;\nselectPlayer _newUnit;"