Last BaseCam tweaks

This commit is contained in:
He-Man 2018-05-06 21:06:09 +02:00
parent 666aef6640
commit b418f64665
7 changed files with 76 additions and 11 deletions

View File

@ -23,7 +23,7 @@
BOOL
*/
//[[[cog import generate_private_arrays ]]]
private ["_alljammer","_buildingAllowed","_buildingCountLeader","_buildingCountLimit","_buildingCountPerMember","_buildingJammerRange","_bypassJammer","_c","_cfgBaseBuilding","_config","_ghostClass","_isAllowed","_jammer","_jammerGLOnly","_jammerPerGroup","_limitNearby","_maxBuildingHeight","_membercount","_minJammerDistance","_myPosATL","_nearestJammer","_obj","_objType","_objectscount","_ownedJammerExists","_range","_restricted","_restrictedArray","_restrictedLocations","_restrictedLocationsArray","_restrictedLocationsRange","_simulClass","_staticClass","_storageCountLeader","_storageCountLimit","_storageCountPerMember","_useGroupCountLimits","_useSplitCountLimits"];
private ["_CamCountLimit","_alljammer","_buildingAllowed","_buildingCountLeader","_buildingCountLimit","_buildingCountPerMember","_buildingJammerRange","_bypassJammer","_c","_cfgBaseBuilding","_config","_ghostClass","_isAllowed","_jammer","_jammerGLOnly","_jammerPerGroup","_limitNearby","_maxBuildingHeight","_membercount","_minJammerDistance","_myPosATL","_nearestJammer","_obj","_objType","_objectscount","_ownedJammerExists","_range","_restricted","_restrictedArray","_restrictedLocations","_restrictedLocationsArray","_restrictedLocationsRange","_simulClass","_staticClass","_storageCountLeader","_storageCountLimit","_storageCountPerMember","_useGroupCountLimits","_useSplitCountLimits"];
//[[[end]]]
_buildingAllowed = true;
@ -49,6 +49,7 @@ _storageCountPerMember = getNumber(_config >> "storageCountPerMember");
_minJammerDistance = getNumber(_config >> "minJammerDistance");
_maxBuildingHeight = getNumber(_config >> "maxBuildingHeight");
_jammerPerGroup = getNumber(_config >> "jammerPerGroup");
_CamCountLimit = getNumber(_config >> "maxCams");
if(getNumber(_config >> "useGroupCountLimits") == 0)then{_useGroupCountLimits=false};
if(getNumber(_config >> "splitCountLimits") == 1)then{_useSplitCountLimits=true};
if(getNumber(_config >> "jammerGLOnly") == 0)then{_jammerGLOnly=false};
@ -59,6 +60,7 @@ if(_storageCountLeader == 0)then{_storageCountLeader = 100};
if(_minJammerDistance == 0)then{_minJammerDistance = _buildingJammerRange*3};
if(_maxBuildingHeight == 0)then{_maxBuildingHeight = 100};
if(_jammerPerGroup == 0)then{_jammerPerGroup = 2};
if(_CamCountLimit == 0)then{_CamCountLimit = 2};
// input
params ["_objType"];
@ -133,6 +135,12 @@ if !(_jammer isEqualTo []) then {
_buildingAllowed = false;
["Building Disallowed: Max building height reached",5] call Epoch_message;
};
if (_objType isequalto "BaseCam_EPOCH" && _buildingAllowed) then {
if ((count (nearestObjects[_nearestJammer,["BaseCam_EPOCH","BaseCam_SIM_EPOCH","BaseCam_Ghost_EPOCH"],_buildingJammerRange]-[_obj])) >= _CamCountLimit) then {
_buildingAllowed = false;
[format["Building Disallowed: Max %1 Cams per Base!", _CamCountLimit], 5] call Epoch_message;
};
};
};
};
}

View File

@ -663,7 +663,7 @@ class CfgBaseBuilding
N[] = {0,0,3.06034};
E[] = {5.237,0,0};
W[] = {-5.237,0,0};
CAM[] = {0,-0.47,2.8};
CAM[] = {0,-0.4,2.8};
};
class WoodWall1_SIM_EPOCH : WoodWall1_EPOCH
{
@ -684,7 +684,7 @@ class CfgBaseBuilding
N[] = {0,0,3.06034};
E[] = {5.237,0,0};
W[] = {-5.237,0,0};
CAM[] = {0,-0.47,2.8};
CAM[] = {0,-0.4,2.8};
};
class WoodLargeWallCor_EPOCH : Default
{
@ -724,7 +724,7 @@ class CfgBaseBuilding
N[] = {0,0,3.06034};
E[] = {5.237,0,0};
W[] = {-5.237,0,0};
CAM[] = {0,-0.47,2.8};
CAM[] = {0,-0.4,2.8};
};
class WoodWall2_SIM_EPOCH : WoodWall2_EPOCH
{
@ -769,7 +769,7 @@ class CfgBaseBuilding
N[] = {0,0,3.06034};
E[] = {5.237,0,0};
W[] = {-5.237,0,0};
CAM[] = {0,-0.47,2.8};
CAM[] = {0,-0.4,2.8};
};
class WoodWall3_SIM_EPOCH : WoodWall3_EPOCH
{
@ -813,7 +813,7 @@ class CfgBaseBuilding
N[] = {0,0,3.06034};
E[] = {5.237,0,0};
W[] = {-5.237,0,0};
CAM[] = {0,-0.47,2.8};
CAM[] = {0,-0.4,2.8};
};
class WoodWall4_SIM_EPOCH : WoodWall4_EPOCH
{
@ -1460,6 +1460,18 @@ class CfgBaseBuilding
allowedSnapObjects[] = {"Const_WoodWalls_static_F","Const_Cinder_static_F"};
};
class BaseCam_Ghost_EPOCH : BaseCam_SIM_EPOCH {};
class BaseCamTerminal_EPOCH : Default
{
removeParts[] = {{"BaseCamTerminal",1}};
GhostPreview = "BaseCamTerminal_Ghost_EPOCH";
staticClass = "BaseCamTerminal_EPOCH";
simulClass = "BaseCamTerminal_SIM_EPOCH";
};
class BaseCamTerminal_SIM_EPOCH : BaseCamTerminal_EPOCH
{
removeParts[] = {};
};
class BaseCamTerminal_Ghost_EPOCH : BaseCamTerminal_SIM_EPOCH {};
};
/*[[[end]]]*/

View File

@ -148,7 +148,7 @@ class CfgCrafting
};
class CircuitParts : Part
{
usedIn[] = {"EnergyPack","EnergyPackLg","KitPlotPole","ItemBattery","KitSolarGen","KitSolarCharger","KitSolarChargerXL","KitVehicleUpgradeI_200_EPOCH","KitVehicleUpgradeIV_200_EPOCH","BarrelBomb_EPOCH_Remote_Mag","BarrelBomb2_EPOCH_Remote_Mag","KitPortableLight_Single","KitPortableLight_Double"};
usedIn[] = {"EnergyPack","EnergyPackLg","KitPlotPole","ItemBattery","KitSolarGen","KitSolarCharger","KitSolarChargerXL","KitVehicleUpgradeI_200_EPOCH","KitVehicleUpgradeIV_200_EPOCH","BarrelBomb_EPOCH_Remote_Mag","BarrelBomb2_EPOCH_Remote_Mag","KitPortableLight_Single","KitPortableLight_Double","BaseCam","BaseCamTerminal"};
previewPosition[] = {0.791044,1,0.256956};
previewScale = 2;
previewVector = 2.3;
@ -415,7 +415,7 @@ class CfgCrafting
};
class ItemScraps : Item
{
usedIn[] = {"ItemCorrugated","KitMetalTrap","MeleeRod","KitVehicleUpgradeIV_200_EPOCH","KitBarbedWire"};
usedIn[] = {"ItemCorrugated","KitMetalTrap","MeleeRod","KitVehicleUpgradeIV_200_EPOCH","KitBarbedWire","BaseCam","BaseCamTerminal"};
nearby[] = {{"Fire","","fire",{1,{"ALL"}},3,1,1,0}};
recipe[] = {{"PartOre",2}};
previewPosition[] = {0.797144,1,0.309158};
@ -466,10 +466,17 @@ class CfgCrafting
};
class ItemDuctTape : Part
{
usedIn[] = {"SpareTire","EngineParts","ItemRotor"};
usedIn[] = {"SpareTire","EngineParts","ItemRotor","BaseCam","BaseCamTerminal"};
previewPosition[] = {0.807346,1,0.27};
previewScale = 1.8;
previewVector = -3.9;
};
class ItemGlass : Part
{
usedIn[] = {"BaseCam", "BaseCamTerminal"};
previewPosition[] = {0.807346,1,0.27};
previewScale = 0.55;
previewVector = -3.9;
};
class EngineParts : Item
{
@ -1133,7 +1140,7 @@ class CfgCrafting
};
class ItemCables : Item
{
usedIn[] = {"KitSolarGen","KitSolarCharger","KitSolarChargerXL","KitPlotPole","ItemCopperBar","KitVehicleUpgradeI_200_EPOCH"};
usedIn[] = {"KitSolarGen","KitSolarCharger","KitSolarChargerXL","KitPlotPole","ItemCopperBar","KitVehicleUpgradeI_200_EPOCH","BaseCam","BaseCamTerminal"};
nearby[] = {{"Workbench","","workbench",{1,{"WorkBench_EPOCH"}},3,1,0,1}};
recipe[] = {{"ItemCopperBar",1}};
previewPosition[] = {0.802374,1,0.26};
@ -1250,6 +1257,8 @@ class CfgCrafting
previewPosition[] = {0.804979,1,0.39189};
previewScale = 0.11;
previewVector = 0;
descriptionShort = "Solar Charger Kit";
descriptionFull = "Used to charge small Energy Packs";
};
class KitSolarChargerXL : Kit
{
@ -1259,6 +1268,30 @@ class CfgCrafting
previewPosition[] = {0.804979,1,0.39189};
previewScale = 0.11;
previewVector = 0;
descriptionShort = "Solar Charger Kit XL";
descriptionFull = "Used to charge large Energy Packs";
};
class BaseCam : Kit
{
recipe[] = {{"ItemCables",1},{"ItemGlass",1},{"ItemDuctTape",1},{"ItemScraps",2},{"CircuitParts",2}};
nearby[] = {{"Workbench","","workbench",{1,{"WorkBench_EPOCH"}},3,1,0,1}};
model = "\x\addons\a3_epoch_community\models\base_cam.p3d";
previewPosition[] = {0.804979,1,0.3};
previewScale = 0.5;
previewVector = 0;
descriptionShort = "Base Camera";
descriptionFull = "Protect your Base with a Camera.<br/>A BaseCam Terminal is needed,<br/>to check your Base Cameras";
};
class BaseCamTerminal : Kit
{
recipe[] = {{"ItemCables",1},{"ItemGlass",1},{"ItemDuctTape",1},{"ItemScraps",2},{"CircuitParts",2}};
nearby[] = {{"Workbench","","workbench",{1,{"WorkBench_EPOCH"}},3,1,0,1}};
model = "\x\addons\a3_epoch_community\models\base_cam_terminal.p3d";
previewPosition[] = {0.804979,1,0.3};
previewScale = 0.5;
previewVector = 0;
descriptionShort = "Base Camera Terminal";
descriptionFull = "Check your Base Cameras with this Terminal";
};
class MeleeRod : Kit
{

View File

@ -55,6 +55,7 @@ class CfgEpochClient
storageCountPerMember = 5; //ignore if "splitCountLimits=0" & "useGroupCountLimits=0"
maxdoors = 10; // Max allowed doors per Group
maxgates = 5; // Max allowed Gates per Group
maxCams = 2; // Max allowed BaseCams per Group
MaxBuildingTilt = 180; // Max degrees players can tilt building elements

View File

@ -1064,8 +1064,9 @@ class CfgItemInteractions
interactAction = 17;
interactText = "ReCharge";
};
class BaseCamTerminal : Default
class BaseCamTerminal : Item_Build_base
{
buildClass = "BaseCamTerminal_EPOCH";
interactActions[] = {{"Watch","call Epoch_CamUse;"}};
};
};

View File

@ -1070,6 +1070,8 @@ class CfgItemSort
"KitSolarGen",
"KitSolarCharger",
"KitSolarChargerXL",
"BaseCam",
"BaseCamTerminal",
"KitWorkbench",
"KitWoodLadder",
"KitWoodTower",

View File

@ -3262,6 +3262,14 @@ class CfgPricing
{
price = 325;
};
class BaseCam
{
price = 250;
};
class BaseCamTerminal
{
price = 250;
};
class KitCinderWall
{
price = 80;