1.0.2.12 developer build

This commit is contained in:
[VB]AWOL
2013-09-08 20:30:32 -05:00
parent c1a2e9efff
commit a0d5574dfe
63 changed files with 1239 additions and 256 deletions

File diff suppressed because it is too large Load Diff

View File

@@ -78,7 +78,7 @@ class Land_DZE_WoodDoor_Base: DZE_Housebase {
mapSize = 8; /* Size of the icon */
icon = "\ca\data\data\Unknown_object.paa"; /* Path to the picture shown in the editor. */
accuracy = 1000;
armor = 150; /* "Lifepoints", if you like to call it that way.*/
armor = 200; /* "Lifepoints", if you like to call it that way.*/
destrType = "DestructBuilding"; /* type of destruction, when armor = 0 */
scope = 2; /* Display it in the editor? 1 = No, 2 = Yes */
offset[] = {0,1.5,0};
@@ -98,6 +98,9 @@ class Land_DZE_WoodDoor_Base: DZE_Housebase {
maintainBuilding[] = {{"PartWoodPlywood",1},{"PartWoodLumber",1}};
};
class Land_DZE_WoodDoorLocked_Base: DZE_Housebase {
model = "\z\addons\dayz_epoch\models\small_wall_door_anim.p3d"; /* path to the object */
displayName = "Wood Door Base"; /* entry in Stringtable.csv */
@@ -105,7 +108,7 @@ class Land_DZE_WoodDoorLocked_Base: DZE_Housebase {
mapSize = 8; /* Size of the icon */
icon = "\ca\data\data\Unknown_object.paa"; /* Path to the picture shown in the editor. */
accuracy = 1000;
armor = 150; /* "Lifepoints", if you like to call it that way.*/
armor = 200; /* "Lifepoints", if you like to call it that way.*/
destrType = "DestructBuilding"; /* type of destruction, when armor = 0 */
scope = 2; /* Display it in the editor? 1 = No, 2 = Yes */
offset[] = {0,1.5,0};
@@ -561,3 +564,104 @@ class CinderWallDoor_DZ: CinderWallDoor_DZ_Base {
};
};
class CinderWallDoorSmallLocked_DZ: CinderWallDoorLocked_DZ_Base {
model = "\z\addons\dayz_epoch\models\Steel_door_locked.p3d";
displayName = "Block Door Locked";
GhostPreview = "CinderWallSmallDoorway_Preview_DZ";
/* Arma needs to know, how the animation trigger is triggered*/
class AnimationSources {
/* name must be identical to the one given by the model.cfg ("Open_Door")" */
class Open_door {
source = "user";
animPeriod = 4; /* duration in seconds */
initPhase = 0;
};
class Open_latch {
source = "user";
animPeriod = 1; /* duration in seconds */
initPhase = 0;
};
};
/* The entry to the actionmenu */
class UserActions
{
class Open_Door
{
displayName="Open Door";
onlyforplayer = true;
position="Door_knopf";
radius=3; /* visibility distance of the entry */
//condition="(this animationPhase ""Open_door"" == 0) and (this animationPhase ""Open_hinge"" == 1)";
condition="(this animationPhase ""Open_door"" == 0) and (this animationPhase ""Open_latch"" == 1)";
statement="this animate [""Open_door"", 1]";
};
class Close_Door : Open_Door
{
displayName="Close Door";
//condition="(this animationPhase ""Open_door"" == 1) and (this animationPhase ""Open_hinge"" == 1)";
condition="(this animationPhase ""Open_door"" == 1) and (this animationPhase ""Open_latch"" == 1)";
statement="this animate [""Open_door"", 0]";
};
class Lock_Door : Open_Door
{
displayName="Lock Door";
//condition="(this animationPhase ""Open_door"" == 0) and (this animationPhase ""Open_hinge"" == 1)";
condition="(DZE_Lock_Door == (this getvariable['CharacterID','0'])) and (this animationPhase ""Open_door"" == 0) and (this animationPhase ""Open_latch"" == 1)";
statement="this animate [""Open_latch"", 0]";
};
class Unlock_Door : Open_Door
{
displayName="Unlock Door";
//condition="(this animationPhase ""Open_door"" == 0) and (this animationPhase ""Open_hinge"" == 0)";
condition="(DZE_Lock_Door == (this getvariable['CharacterID','0'])) and (this animationPhase ""Open_door"" == 0) and (this animationPhase ""Open_latch"" == 0)";
statement="this animate [""Open_latch"", 1]";
};
class Unlock_Door_Dialog : Open_Door
{
displayName="Unlock Door";
//condition="(this animationPhase ""Open_door"" == 0) and (this animationPhase ""Open_hinge"" == 0)";
condition="DZE_Lock_Door != (this getvariable['CharacterID','0'])";
statement="dayz_selectedDoor = this;DZE_topCombo = 0;DZE_midCombo = 0;DZE_botCombo = 0;createdialog ""ComboLockUI""";
};
};
};
class CinderWallDoorSmall_DZ: CinderWallDoor_DZ_Base {
model = "\z\addons\dayz_epoch\models\Steel_door.p3d";
displayName = "Block Door";
GhostPreview = "CinderWallSmallDoorway_Preview_DZ";
upgradeBuilding[] = {"CinderWallDoorSmallLocked_DZ",{{"ItemComboLock",1}}};
/* Arma needs to know, how the animation trigger is triggered*/
class AnimationSources {
/* name must be identical to the one given by the model.cfg ("Open_Door")" */
class Open_door {
source = "user";
animPeriod = 4; /* duration in seconds */
initPhase = 0;
};
};
/* The entry to the actionmenu */
class UserActions
{
class Open_Door
{
displayName="Open Door";
onlyforplayer = true;
position="Door_knopf";
radius=3; /* visibility distance of the entry */
condition="this animationPhase ""Open_door"" < 0.5";
statement="this animate [""Open_door"", 1]";
};
class Close_Door : Open_Door
{
displayName="Close Door";
condition="this animationPhase ""Open_door"" >= 0.5";
statement="this animate [""Open_door"", 0]";
};
};
};

View File

@@ -49,6 +49,7 @@ class CfgWeapons {
#include "CfgWeapons\Melee\Crossbow.hpp"
#include "CfgWeapons\Melee\MeleeBaseBallBat.hpp"
#include "CfgWeapons\Melee\MeleeFishingPole.hpp"
#include "CfgWeapons\Melee\MeleeSledgehammer.hpp"
// #include "CfgWeapons\Melee\MeleeBaseBallBatBarbed.hpp"
// #include "CfgWeapons\Melee\MeleeBaseBallBatNails.hpp"
@@ -61,6 +62,7 @@ class CfgWeapons {
#include "CfgWeapons\Item\ItemEtool.hpp"
#include "CfgWeapons\Item\ItemShovel.hpp"
#include "CfgWeapons\Item\ItemFishingPole.hpp"
#include "CfgWeapons\Item\ItemSledge.hpp"
#include "CfgWeapons\Item\ItemKeyKit.hpp"
#include "CfgWeapons\Item\ItemKeys.hpp"

View File

@@ -0,0 +1,24 @@
class ItemSledge: ItemCore
{
scope=2;
displayName="Sledgehammer";
model="\z\addons\dayz_epoch\models\sledge_mag.p3d";
picture="\z\addons\dayz_epoch\pictures\equip_sledge_CA.paa";
descriptionShort="A tool with a large, flat head attached to a handle. The head is typically made of metal. The sledgehammer can apply more force than other hammers.";
class ItemActions
{
class Toolbelt
{
text="Remove from Toolbelt";
script="spawn player_addToolbelt;";
use[]=
{
"ItemSledge"
};
output[]=
{
"MeleeSledge"
};
};
};
};

View File

@@ -0,0 +1,41 @@
class MeleeSledge: MeleeWeapon
{
scope=2;
melee= "true";
autoreload=1;
magazineReloadTime=0;
model="\z\addons\dayz_epoch\models\sledge_weaponized";
picture="\z\addons\dayz_epoch\pictures\equip_sledge_CA.paa"; // todo icon
displayName="Sledgehammer";
droppeditem= "ItemSledge";
magazines[]=
{
"sledge_swing"
};
handAnim[]=
{
"OFP2_ManSkeleton",
"\dayz_weapons\anim\melee_hatchet_holding.rtm"
};
class ItemActions
{
class Toolbelt
{
text="Add to Toolbelt";
script="spawn player_addToolbelt;";
use[]=
{
"MeleeSledge"
};
output[]=
{
"ItemSledge"
};
};
};
class Library
{
libTextDesc="A tool with a large, flat head attached to a handle. The head is typically made of metal. The sledgehammer can apply more force than other hammers.";
};
descriptionShort="A tool with a large, flat head attached to a handle. The head is typically made of metal. The sledgehammer can apply more force than other hammers.";
};

View File

@@ -14,6 +14,10 @@ class CfgAmmo {
hit = 7;
simulation = "shotBullet";
};
class Sledge_Swing_Ammo : Melee {
hit = 11;
simulation = "shotBullet";
};
class Dummy_Swing_Ammo : Melee {
hit = 0;
simulation = "shotBullet";

View File

@@ -174,7 +174,7 @@ class CfgLoot {
0.01,
0.01,
0.01,
0.11,
0.08,
0.03,
0.01,
0.04,
@@ -190,7 +190,7 @@ class CfgLoot {
0.03,
0.03,
0.03,
0.01
0.04
}
};
generic[] = {
@@ -441,11 +441,12 @@ class CfgLoot {
"ItemPainkiller",
"ItemWire",
"ItemTankTrap",
"ItemComboLock"
"ItemComboLock",
"ItemSledgeHead"
},
{
0.1,
0.1,
0.09,
0.09,
0.09,
0.11,
0.09,
@@ -457,7 +458,8 @@ class CfgLoot {
0.06,
0.01,
0.03,
0.07
0.05,
0.04
}
};

View File

@@ -1603,6 +1603,20 @@ class CfgVehicles {
};
// modular
class MetalFloor_DZ: ModularItems
{
scope = 2;
destrType = "DestructBuilding";
cost = 100;
offset[] = {0,4,0};
model="\z\addons\dayz_epoch\models\metal_floor.p3d";
icon = "\ca\data\data\Unknown_object.paa";
mapSize = 2;
armor = 1600;
displayName = "Metal Floor";
vehicleClass = "Fortifications";
GhostPreview = "MetalFloor_Preview_DZ";
};
class CinderWallHalf_DZ: ModularItems
{
scope = 2;
@@ -1645,46 +1659,29 @@ class CfgVehicles {
icon = "\ca\data\data\Unknown_object.paa";
mapSize = 2;
armor = 1600;
displayName = "Block Doorway";
displayName = "Block Garage Doorway";
vehicleClass = "Fortifications";
maintainBuilding[] = {{"MortarBucket",1}};
upgradeBuilding[] = {"CinderWallDoor_DZ",{{"ItemPole",3},{"ItemTankTrap",3}}};
GhostPreview = "CinderWallDoorway_Preview_DZ";
};
/*
class CinderWallDoor_DZ: ModularItems
class CinderWallSmallDoorway_DZ: ModularItems
{
scope = 2;
destrType = "DestructBuilding";
cost = 100;
offset[] = {0,1.5,0};
model="\z\addons\dayz_epoch\models\steel_garage_door.p3d";
offset[] = {0,2,0};
model="\z\addons\dayz_epoch\models\Steel_door_frame.p3d";
icon = "\ca\data\data\Unknown_object.paa";
mapSize = 2;
armor = 1600;
displayName = "Block Door";
displayName = "Block Doorway";
vehicleClass = "Fortifications";
maintainBuilding[] = {{"MortarBucket",1}};
upgradeBuilding[] = {"CinderWallDoorLocked_DZ",{{"ItemComboLock",1}}};
GhostPreview = "CinderWallDoor_Preview_DZ";
upgradeBuilding[] = {"CinderWallDoorSmall_DZ",{{"ItemPole",1},{"ItemTankTrap",1}}};
GhostPreview = "CinderWallSmallDoorway_Preview_DZ"; // todo change this
};
class CinderWallDoorLocked_DZ: ModularItems
{
scope = 2;
destrType = "DestructBuilding";
cost = 100;
offset[] = {0,1.5,0};
model="\z\addons\dayz_epoch\models\steel_garage_locked.p3d";
icon = "\ca\data\data\Unknown_object.paa";
mapSize = 2;
armor = 1600;
displayName = "Block Door Locked";
vehicleClass = "Fortifications";
maintainBuilding[] = {{"MortarBucket",1}};
GhostPreview = "CinderWallDoorLocked_Preview_DZ";
};
*/
class WoodFloor_DZ: ModularItems
{
@@ -1737,7 +1734,7 @@ class CfgVehicles {
class WoodLargeWall_DZ: ModularItems
{
scope = 2;
destrType = "DestructTree";
destrType = "DestructBuilding";
cost = 100;
offset[] = {0,1.5,0};
model="\z\addons\dayz_epoch\models\large_wall.p3d";
@@ -1754,7 +1751,7 @@ class CfgVehicles {
class WoodLargeWallDoor_DZ: ModularItems
{
scope = 2;
destrType = "DestructTree";
destrType = "DestructBuilding";
cost = 100;
offset[] = {0,1.5,0};
model="\z\addons\dayz_epoch\models\large_wall_door.p3d";
@@ -1770,7 +1767,7 @@ class CfgVehicles {
class WoodLargeWallWin_DZ: ModularItems
{
scope = 2;
destrType = "DestructTree";
destrType = "DestructBuilding";
cost = 100;
offset[] = {0,1.5,0};
model="\z\addons\dayz_epoch\models\large_wall_win.p3d";
@@ -1786,7 +1783,7 @@ class CfgVehicles {
class WoodSmallWall_DZ: ModularItems
{
scope = 2;
destrType = "DestructTree";
destrType = "DestructBuilding";
cost = 100;
offset[] = {0,1.5,0};
model="\z\addons\dayz_epoch\models\small_wall.p3d";
@@ -1802,7 +1799,7 @@ class CfgVehicles {
class WoodSmallWallThird_DZ: ModularItems
{
scope = 2;
destrType = "DestructTree";
destrType = "DestructBuilding";
cost = 100;
offset[] = {0,1.5,0};
model="\z\addons\dayz_epoch\models\third_wall.p3d";
@@ -1819,7 +1816,7 @@ class CfgVehicles {
class WoodSmallWallWin_DZ: ModularItems
{
scope = 2;
destrType = "DestructTree";
destrType = "DestructBuilding";
cost = 100;
offset[] = {0,1.5,0};
model="\z\addons\dayz_epoch\models\small_wall_win.p3d";
@@ -1834,7 +1831,7 @@ class CfgVehicles {
class WoodSmallWallDoor_DZ: ModularItems
{
scope = 2;
destrType = "DestructTree";
destrType = "DestructBuilding";
cost = 100;
offset[] = {0,1.5,0};
model="\z\addons\dayz_epoch\models\small_wall_door.p3d";
@@ -1897,6 +1894,19 @@ class CfgVehicles {
};
// ghost models
class CinderWallSmallDoorway_Preview_DZ: NonStrategic
{
scope = 2;
destrType = "DestructNo";
cost = 100;
offset[] = {0,1.5,0};
model="\z\addons\dayz_epoch\models\steel_garage_frame_ghost.p3d"; // todo change this
icon = "\ca\data\data\Unknown_object.paa";
mapSize = 2;
armor = 1000;
displayName = "Block Garage Doorway";
vehicleClass = "Fortifications";
};
class CinderWallDoorway_Preview_DZ: NonStrategic
{
scope = 2;
@@ -1910,6 +1920,19 @@ class CfgVehicles {
displayName = "Block Garage Doorway";
vehicleClass = "Fortifications";
};
class MetalFloor_Preview_DZ: NonStrategic
{
scope = 2;
destrType = "DestructNo";
cost = 100;
offset[] = {0,1.5,0};
model="\z\addons\dayz_epoch\models\metal_floor_ghost.p3d";
icon = "\ca\data\data\Unknown_object.paa";
mapSize = 2;
armor = 1000;
displayName = "Metal Floor Preview";
vehicleClass = "Fortifications";
};
class CinderWallHalf_Preview_DZ: NonStrategic
{
scope = 2;

View File

@@ -81,7 +81,6 @@ if (_finished) then {
_vehicle setVariable ["GeneratorSound", _soundSource,true];
// TODO: Add running sounds to generator
cutText ["Generator has been started.", "PLAIN DOWN"];
};

View File

@@ -50,14 +50,14 @@ _qty = count _obj;
if(_qty >= 1) then {
//Remove melee magazines (BIS_fnc_invAdd fix) (add new melee ammo to array if needed)
{player removeMagazines _x} forEach ["Hatchet_Swing","Crowbar_Swing","Machete_Swing","Fishing_Swing"];
{player removeMagazines _x} forEach ["Hatchet_Swing","Crowbar_Swing","Machete_Swing","Fishing_Swing","sledge_swing"];
_config = (configFile >> _type >> _classname);
_isOk = [player,_config] call BIS_fnc_invAdd;
if (_isOk) then {
deleteVehicle _holder;
if (_classname in ["MeleeHatchet","MeleeCrowbar","MeleeMachete","MeleeFishingPole"]) then {
if (_classname in ["MeleeHatchet","MeleeCrowbar","MeleeMachete","MeleeFishingPole","MeleeSledge"]) then {
if (_type == "cfgWeapons") then {
_muzzles = getArray(configFile >> "cfgWeapons" >> _classname >> "muzzles");
@@ -77,6 +77,7 @@ if(_qty >= 1) then {
case "MeleeCrowbar": {player addMagazine 'Crowbar_Swing';};
case "MeleeMachete": {player addMagazine 'Machete_Swing';};
case "MeleeFishingPole": {player addMagazine 'Fishing_Swing';};
case "MeleeSledge": {player addMagazine 'sledge_swing';};
};
};

View File

@@ -20,7 +20,7 @@ _create = getArray (_config >> "ItemActions" >> "Toolbelt" >> "output") select
_config2 = configFile >> "cfgWeapons" >> _create;
//Remove magazines if needed
if (_item in ["MeleeHatchet","MeleeCrowbar","MeleeMachete","MeleeFishingPole"]) then {
if (_item in ["MeleeHatchet","MeleeCrowbar","MeleeMachete","MeleeFishingPole","MeleeSledge"]) then {
_magType = ([] + getArray (configFile >> "cfgWeapons" >> _item >> "magazines")) select 0;
_meleeNum = ({_x == _magType} count magazines player);
for "_i" from 1 to _meleeNum do {
@@ -28,12 +28,14 @@ if (_item in ["MeleeHatchet","MeleeCrowbar","MeleeMachete","MeleeFishingPole"])
};
};
if (_item in ["ItemHatchet","ItemCrowbar","ItemMachete"]) then {
if (_item in ["ItemHatchet","ItemCrowbar","ItemMachete","ItemFishingPole","ItemSledge"]) then {
switch (primaryWeapon player) do
{
case "MeleeHatchet": { "MeleeHatchet" call player_addToolbelt };
case "MeleeCrowbar": { "MeleeCrowbar" call player_addToolbelt };
case "MeleeMachete": { "MeleeMachete" call player_addToolbelt };
case "MeleeFishingPole": { "MeleeFishingPole" call player_addToolbelt };
case "MeleeSledge": { "MeleeSledge" call player_addToolbelt };
};
};
@@ -44,10 +46,13 @@ if (_isOk) then {
player removeWeapon _item;
//Add magazines if needed
if (_create in ["MeleeHatchet","MeleeCrowbar","MeleeMachete","MeleeFishingPole"]) then {
if (_create in ["MeleeHatchet","MeleeCrowbar","MeleeMachete","MeleeFishingPole","MeleeSledge"]) then {
if (_create == "MeleeCrowbar") then {
player addMagazine 'crowbar_swing';
};
if (_create == "MeleeSledge") then {
player addMagazine 'sledge_swing';
};
if (_create == "MeleeHatchet") then {
player addMagazine 'hatchet_swing';
};
@@ -71,10 +76,13 @@ if (_isOk) then {
cutText [localize "STR_DAYZ_CODE_2", "PLAIN DOWN"];
//Add magazines back
if (_item in ["MeleeHatchet","MeleeCrowbar","MeleeMachete","MeleeFishingPole"]) then {
if (_item in ["MeleeHatchet","MeleeCrowbar","MeleeMachete","MeleeFishingPole","MeleeSledge"]) then {
if (_item == "MeleeCrowbar") then {
player addMagazine 'crowbar_swing';
};
if (_item == "MeleeSledge") then {
player addMagazine 'sledge_swing';
};
if (_item == "MeleeHatchet") then {
player addMagazine 'hatchet_swing';
};

View File

@@ -1,14 +1,36 @@
/*
DayZ Crafting
Usage: spawn player_goFishing;
Made for DayZ Epoch please ask permission to use/edit/distrubute email vbawol@veteranbastards.com.
DayZ Epoch Crafting 0.3
Made for DayZ Unleashed by [VB]AWOL please ask permission to use/edit/distrubute email vbawol@veteranbastards.com.
Thanks to thevisad for help with the spawn call fixes.
USAGE EXAMPLE:
class ItemActions
{
class Crafting
{
text = "Craft Tent";
script = ";['Crafting','CfgMagazines', _id] spawn player_craftItem;"; // [Class of itemaction,CfgMagazines or CfgWeapons, item]
neednearby[] = {"workshop","fire"};
requiretools[] = {"ItemToolbox","ItemKnife"}; // (cfgweapons only)
output[] = {{"ItemTent",1}}; // (CfgMagazines, qty)
input[] = {{"ItemCanvas",2},{"ItemPole",2}}; // (CfgMagazines, qty)
inputweapons[] = {"ItemToolbox"}; // consume toolbox (cfgweapons only)
outputweapons[] = {"ItemToolbox"}; // return toolbox (cfgweapons only)
};
};
*/
private ["_onLadder","_canDo","_selectedRecipeOutput","_proceed","_itemIn","_countIn","_missing","_missingQty","_qty","_itemOut","_countOut","_started","_finished","_animState","_isMedic","_removed","_tobe_removed_total","_textCreate","_textMissing","_selectedRecipeInput","_num_removed","_removed_total","_temp_removed_array","_abort","_reason","_isNear","_missingTools","_hastoolweapon","_selectedRecipeTools","_distance","_crafting","_needNear","_consumeweapons","_item","_craft_doLoop"];
private ["_onLadder","_canDo","_selectedRecipeOutput","_proceed","_itemIn","_countIn","_missing","_missingQty","_qty","_itemOut","_countOut","_started","_finished","_animState","_isMedic","_removed","_tobe_removed_total","_textCreate","_textMissing","_selectedRecipeInput","_num_removed","_removed_total","_temp_removed_array","_abort","_reason","_isNear","_missingTools","_hastoolweapon","_selectedRecipeTools","_distance","_crafting","_needNear","_item","_baseClass","_num_removed_weapons","_outputWeapons","_inputWeapons"];
if(TradeInprogress) exitWith { cutText ["\n\nCrafting already in progress." , "PLAIN DOWN"]; };
TradeInprogress = true;
// temp array of removed parts
// This is used to find correct recipe based what itemaction was click allows multiple recipes per item.
_crafting = _this select 0;
// This tells the script what type of item we are clicking on
_baseClass = _this select 1;
_item = _this select 2;
_abort = false;
_distance = 3;
@@ -17,12 +39,8 @@ _reason = "";
_onLadder = (getNumber (configFile >> "CfgMovesMaleSdr" >> "States" >> (animationState player) >> "onLadder")) == 1;
_canDo = (!r_drag_sqf and !r_player_unconscious and !_onLadder);
_item = _this;
_crafting = "Crafting";
// check if fire is reqired
_needNear = getArray (configFile >> "cfgMagazines" >> _item >> "ItemActions" >> _crafting >> "neednearby");
// Need Near Requirements
_needNear = getArray (configFile >> _baseClass >> _item >> "ItemActions" >> _crafting >> "neednearby");
if("fire" in _needNear) then {
_isNear = {inflamed _x} count (position player nearObjects _distance);
if(_isNear == 0) then {
@@ -30,15 +48,13 @@ if("fire" in _needNear) then {
_reason = "fire";
};
};
if("workshop" in _needNear) then {
_isNear = count (nearestObjects [player, ["Wooden_shed_DZ","WoodShack_DZ","WorkBench_DZ"], 5]);
_isNear = count (nearestObjects [player, ["Wooden_shed_DZ","WoodShack_DZ","WorkBench_DZ"], _distance]); // Needs changed to your workbench class
if(_isNear == 0) then {
_abort = true;
_reason = "workshop";
};
};
if(_abort) exitWith {
cutText [format["\n\nCrafting needs a %1 within %2 meters",_reason,_distance], "PLAIN DOWN"];
TradeInprogress = false;
@@ -48,65 +64,56 @@ if(_abort) exitWith {
if (_canDo) then {
// Moved all recipes input and outputs to configs
_selectedRecipeOutput = getArray (configFile >> "cfgMagazines" >> _item >> "ItemActions" >> _crafting >> "output");
_selectedRecipeInput = getArray (configFile >> "cfgMagazines" >> _item >> "ItemActions" >> _crafting >> "input");
_selectedRecipeTools = getArray (configFile >> "cfgMagazines" >> _item >> "ItemActions" >> _crafting >> "requiretools");
_consumeweapons = getArray (configFile >> "cfgMagazines" >> _item >> "ItemActions" >> _crafting >> "consumeweapons");
_selectedRecipeTools = getArray (configFile >> _baseClass >> _item >> "ItemActions" >> _crafting >> "requiretools");
_selectedRecipeOutput = getArray (configFile >> _baseClass >> _item >> "ItemActions" >> _crafting >> "output");
_selectedRecipeInput = getArray (configFile >> _baseClass >> _item >> "ItemActions" >> _crafting >> "input");
_outputWeapons = getArray (configFile >> _baseClass >> _item >> "ItemActions" >> _crafting >> "outputweapons");
_inputWeapons = getArray (configFile >> _baseClass >> _item >> "ItemActions" >> _crafting >> "inputweapons");
_craft_doLoop = true;
while {_craft_doLoop} do {
_temp_removed_array = [];
_missing = "";
_missingTools = false;
{
_hastoolweapon = _x in weapons player;
if(!_hastoolweapon) exitWith { _craft_doLoop = false; _missingTools = true; _missing = _x; };
} forEach _selectedRecipeTools;
if(!_missingTools) then {
//diag_log format["Selected Recipe Input: %1", _selectedRecipeInput];
//diag_log format["Selected Recipe Output: %1", _selectedRecipeOutput];
// Dry run to see if all parts are available.
_proceed = true;
{
_itemIn = _x select 0;
_countIn = _x select 1;
//diag_log format["Recipe Check: %1 %2", _itemIn,_countIn];
// not neccessary
//if (!(_itemIn in magazines player)) exitWith { _missing = _itemIn; _missingQty = _countIn; _proceed = false; };
// match against class and parentClass
_qty = { (_x == _itemIn) || (configName(inheritsFrom(configFile >> "cfgMagazines" >> _x)) == _itemIn) } count magazines player;
_qty = { (_x == _itemIn) || (configName(inheritsFrom(configFile >> "cfgMagazines" >> _x)) == _itemIn) } count magazines player;
if(_qty < _countIn) exitWith { _missing = _itemIn; _missingQty = (_countIn - _qty); _proceed = false; };
} forEach _selectedRecipeInput;
// If all parts proceed
if (_proceed) then {
cutText ["\n\nCrafting started", "PLAIN DOWN"];
player playActionNow "Medic";
[player,"repair",0,false] call dayz_zombieSpeak;
[player,50,true,(getPosATL player)] spawn player_alertZombies;
r_interrupt = false;
_animState = animationState player;
r_doLoop = true;
_started = false;
_finished = false;
while {r_doLoop} do {
_animState = animationState player;
_isMedic = ["medic",_animState] call fnc_inString;
@@ -123,9 +130,9 @@ if (_canDo) then {
sleep 0.1;
};
r_doLoop = false;
if (_finished) then {
_removed_total = 0; // count total of removed items
_tobe_removed_total = 0; // count total of all to be removed items
// Take items
@@ -135,7 +142,7 @@ if (_canDo) then {
_countIn = _x select 1;
// diag_log format["Recipe Finish: %1 %2", _itemIn,_countIn];
_tobe_removed_total = _tobe_removed_total + _countIn;
{
if( (_removed < _countIn) && ((_x == _itemIn) || configName(inheritsFrom(configFile >> "cfgMagazines" >> _x)) == _itemIn)) then {
_num_removed = ([player,_x] call BIS_fnc_invRemove);
@@ -145,48 +152,47 @@ if (_canDo) then {
_temp_removed_array set [count _temp_removed_array,_x];
};
};
} forEach magazines player;
} forEach _selectedRecipeInput;
//diag_log format["removed: %1 of: %2", _removed, _tobe_removed_total];
// Only proceed if all parts were removed successfully
if(_removed_total == _tobe_removed_total) then {
// Put items
_num_removed_weapons = 0;
{
// consumeweapons
_num_removed_weapons = _num_removed_weapons + ([player,_x] call BIS_fnc_invRemove);
} forEach _inputWeapons;
if (_num_removed_weapons == (count _inputWeapons)) then {
{
player removeWeapon _x;
} forEach _consumeweapons;
_itemOut = _x select 0;
_countOut = _x select 1;
//diag_log format["Recipe Output: %1 %2", _itemOut,_countOut];
player addWeapon _x;
} forEach _outputWeapons;
{
_itemOut = _x select 0;
_countOut = _x select 1;
for "_x" from 1 to _countOut do {
player addMagazine _itemOut;
};
// get display name
_textCreate = getText(configFile >> "CfgMagazines" >> _itemOut >> "displayName");
for "_x" from 1 to _countOut do {
player addMagazine _itemOut;
};
_textCreate = getText(configFile >> "CfgMagazines" >> _itemOut >> "displayName");
// Add crafted item
cutText [format["\n\nCrafted Item: %1 x %2",_textCreate,_countOut], "PLAIN DOWN"];
} forEach _selectedRecipeOutput;
} forEach _selectedRecipeOutput;
};
} else {
// Refund parts since we failed
{player addMagazine _x;} forEach _temp_removed_array;
cutText [format["\n\nMissing Parts after first check Item: %1 / %2",_removed_total,_tobe_removed_total], "PLAIN DOWN"];
};
} else {
r_interrupt = false;
if (vehicle player == player) then {
@@ -196,7 +202,7 @@ if (_canDo) then {
cutText ["\n\nCanceled crafting.", "PLAIN DOWN"];
_craft_doLoop = false;
};
} else {
_textMissing = getText(configFile >> "CfgMagazines" >> _missing >> "displayName");
cutText [format["\n\nMissing %1 more of %2",_missingQty, _textMissing], "PLAIN DOWN"];
@@ -209,7 +215,6 @@ if (_canDo) then {
};
};
} else {
cutText ["\n\nCrafting needs a fire within 3 meters.", "PLAIN DOWN"];
cutText ["\n\nCanceled crafting.", "PLAIN DOWN"];
};
TradeInprogress = false;

View File

@@ -18,7 +18,9 @@ player removeWeapon _item;
if (_item == "MeleeHatchet") then {_item = "ItemHatchet";};
if (_item == "MeleeCrowbar") then {_item = "MeleeCrowbar";};
if (_item == "MeleeMachete") then {_item = "ItemMachete";};
if (_item == "MeleeFishingPole") then {_item = "MeleeFishingPole";};
//if (_item == "MeleeFishingPole") then {_item = "MeleeFishingPole";};
//if (_item == "MeleeSledge") then {_item = "MeleeSledge";};
_bag = createVehicle [format["WeaponHolder_%1",_item],getPosATL player,[], 0, "CAN_COLLIDE"];
_bag setdir (getDir player);

View File

@@ -127,7 +127,6 @@ for "_x" from 1 to _total_trades do {
} else {
// Return items from botched trade.
// TODO: this may never happen if so remove
for "_x" from 1 to _removed do {
player addMagazine _part_in;
};

View File

@@ -124,6 +124,9 @@ diag_log (str(_backpackMag));
if (_primweapon == "MeleeCrowbar") then {
_newUnit addMagazine 'crowbar_swing';
};
if (_primweapon == "MeleeSledge") then {
_newUnit addMagazine 'sledge_swing';
};
if (_primweapon == "MeleeHatchet") then {
_newUnit addMagazine 'hatchet_swing';
};

View File

@@ -786,7 +786,9 @@ class CfgBuildingLoot {
{ "ItemFuelBarrel","magazine"},
{ "WeaponHolder_ItemMachete", "object"},
{ "ItemFishingPole","weapon" },
{ "ItemLightBulb","magazine"}
{ "ItemLightBulb","magazine"},
{ "ItemSledgeHandle","magazine"}
};
itemChance[] = {
0.05,
@@ -794,7 +796,7 @@ class CfgBuildingLoot {
0.02,
0.04,
0.03,
0.27,
0.26,
0.03,
0.08,
0.05,
@@ -802,7 +804,8 @@ class CfgBuildingLoot {
0.01,
0.03,
0.01,
0.02
0.02,
0.01
};
};
class Supermarket: Default {

View File

@@ -82,10 +82,6 @@ if (!isDedicated) then {
player_reloadMag = compile preprocessFileLineNumbers "\z\addons\dayz_code\actions\player_reloadMags.sqf";
player_loadCrate = compile preprocessFileLineNumbers "\z\addons\dayz_code\actions\player_loadCrate.sqf";
player_craftItem = compile preprocessFileLineNumbers "\z\addons\dayz_code\actions\player_craftItem.sqf";
player_craftItem1 = compile preprocessFileLineNumbers "\z\addons\dayz_code\actions\player_craftItem1.sqf";
player_craftItem2 = compile preprocessFileLineNumbers "\z\addons\dayz_code\actions\player_craftItem2.sqf";
player_craftItem3 = compile preprocessFileLineNumbers "\z\addons\dayz_code\actions\player_craftItem3.sqf";
player_craftItem4 = compile preprocessFileLineNumbers "\z\addons\dayz_code\actions\player_craftItem4.sqf";
player_tentPitch = compile preprocessFileLineNumbers "\z\addons\dayz_code\actions\tent_pitch.sqf";
player_vaultPitch = compile preprocessFileLineNumbers "\z\addons\dayz_code\actions\vault_pitch.sqf";
player_drink = compile preprocessFileLineNumbers "\z\addons\dayz_code\actions\player_drink.sqf";
@@ -269,14 +265,6 @@ if (!isDedicated) then {
if (player isKindOf "PZombie_VB") exitWith {
player switchAction "walkf";
};
if (!r_fracture_legs and (time - dayz_lastCheckBit > 4)) then {
_inBuilding = [player] call fnc_isInsideBuilding;
_nearbyObjects = nearestObjects[getPosATL player, dayz_disallowedVault, 8];
if (!_inBuilding and (count _nearbyObjects == 0)) then {
dayz_lastCheckBit = time;
call player_CombatRoll;
};
};
};
//if (_dikCode == 57) then {_handled = true}; // space
//if (_dikCode in actionKeys 'MoveForward' or _dikCode in actionKeys 'MoveBack') then {r_interrupt = true};

View File

@@ -450,7 +450,7 @@ if(isNil "dayz_zedsAttackVehicles") then {
dayz_updateObjects = ["Car", "Helicopter", "Motorcycle", "Ship", "TentStorage", "VaultStorage","LockboxStorage","OutHouse_DZ","Wooden_shed_DZ","WoodShack_DZ","StorageShed_DZ"];
dayz_disallowedVault = ["TentStorage", "BuiltItems"];
dayz_reveal = ["AllVehicles","WeaponHolder","Land_A_tent","BuiltItems","ModularItems"];
dayz_allowedObjects = ["TentStorage","TentStorageDomed","TentStorageDomed2", "VaultStorageLocked", "Hedgehog_DZ", "Sandbag1_DZ","TrapBear","Fort_RazorWire","WoodGate_DZ","Land_HBarrier1_DZ","Land_HBarrier3_DZ","Fence_corrugated_DZ","M240Nest_DZ","CanvasHut_DZ","ParkBench_DZ","MetalGate_DZ","OutHouse_DZ","Wooden_shed_DZ","WoodShack_DZ","StorageShed_DZ","Plastic_Pole_EP1_DZ","Generator_DZ","StickFence_DZ","LightPole_DZ","FuelPump_DZ","DesertCamoNet_DZ","ForestCamoNet_DZ","DesertLargeCamoNet_DZ","ForestLargeCamoNet_DZ","SandNest_DZ","DeerStand_DZ","MetalPanel_DZ","WorkBench_DZ","WoodFloor_DZ","WoodLargeWall_DZ","WoodLargeWallDoor_DZ","WoodLargeWallWin_DZ","WoodSmallWall_DZ","WoodSmallWallWin_DZ","WoodSmallWallDoor_DZ","LockboxStorageLocked","WoodFloorHalf_DZ","WoodFloorQuarter_DZ","WoodStairs_DZ","WoodStairsSans_DZ","WoodSmallWallThird_DZ","WoodLadder_DZ","Land_DZE_GarageWoodDoor","Land_DZE_LargeWoodDoor","Land_DZE_WoodDoor","Land_DZE_GarageWoodDoorLocked","Land_DZE_LargeWoodDoorLocked","Land_DZE_WoodDoorLocked","CinderWallHalf_DZ","CinderWall_DZ","CinderWallDoorway_DZ","CinderWallDoor_DZ","CinderWallDoorLocked_DZ"];
dayz_allowedObjects = ["TentStorage","TentStorageDomed","TentStorageDomed2", "VaultStorageLocked", "Hedgehog_DZ", "Sandbag1_DZ","TrapBear","Fort_RazorWire","WoodGate_DZ","Land_HBarrier1_DZ","Land_HBarrier3_DZ","Fence_corrugated_DZ","M240Nest_DZ","CanvasHut_DZ","ParkBench_DZ","MetalGate_DZ","OutHouse_DZ","Wooden_shed_DZ","WoodShack_DZ","StorageShed_DZ","Plastic_Pole_EP1_DZ","Generator_DZ","StickFence_DZ","LightPole_DZ","FuelPump_DZ","DesertCamoNet_DZ","ForestCamoNet_DZ","DesertLargeCamoNet_DZ","ForestLargeCamoNet_DZ","SandNest_DZ","DeerStand_DZ","MetalPanel_DZ","WorkBench_DZ","WoodFloor_DZ","WoodLargeWall_DZ","WoodLargeWallDoor_DZ","WoodLargeWallWin_DZ","WoodSmallWall_DZ","WoodSmallWallWin_DZ","WoodSmallWallDoor_DZ","LockboxStorageLocked","WoodFloorHalf_DZ","WoodFloorQuarter_DZ","WoodStairs_DZ","WoodStairsSans_DZ","WoodSmallWallThird_DZ","WoodLadder_DZ","Land_DZE_GarageWoodDoor","Land_DZE_LargeWoodDoor","Land_DZE_WoodDoor","Land_DZE_GarageWoodDoorLocked","Land_DZE_LargeWoodDoorLocked","Land_DZE_WoodDoorLocked","CinderWallHalf_DZ","CinderWall_DZ","CinderWallDoorway_DZ","CinderWallDoor_DZ","CinderWallDoorLocked_DZ","CinderWallSmallDoorway_DZ","CinderWallDoorSmall_DZ","CinderWallDoorSmallLocked_DZ","MetalFloor_DZ"];
DZE_LockableStorage = ["VaultStorage","VaultStorageLocked","LockboxStorageLocked","LockboxStorage"];
DZE_LockedStorage = ["VaultStorageLocked","LockboxStorageLocked"];

View File

@@ -1084,6 +1084,9 @@ class FSM
"" \n
"if (player hasWeapon ""MeleeCrowbar"") then {" \n
" player addMagazine 'crowbar_swing';" \n
"};" \n
"if (player hasWeapon ""MeleeSledge"") then {" \n
" player addMagazine 'sledge_swing';" \n
"};" \n
"if (player hasWeapon ""MeleeHatchet"") then {" \n
" player addMagazine 'hatchet_swing';" \n