mirror of
https://github.com/EpochModTeam/DayZ-Epoch.git
synced 2026-04-17 09:53:21 +03:00
0.996b
+ [FIXED] Moved crafting input and output to to configs.
This commit is contained in:
@@ -38,7 +38,8 @@ class CfgMagazines {
|
|||||||
{
|
{
|
||||||
text = "Craft Large Sandbag";
|
text = "Craft Large Sandbag";
|
||||||
script = "spawn player_craftItem;";
|
script = "spawn player_craftItem;";
|
||||||
output[] = {"ItemSandbagLarge"};
|
output[] = {["ItemSandbagLarge",1]};
|
||||||
|
input[] = {["ItemSandbag",3],["ItemWire",1],["ItemTankTrap",1]};
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -7,11 +7,6 @@ private["_onLadder","_canDo","_recipe_ItemTinBar","_recipe_ItemAluminumBar","_re
|
|||||||
if(TradeInprogress) exitWith { cutText ["Crafting already in progress." , "PLAIN DOWN"]; };
|
if(TradeInprogress) exitWith { cutText ["Crafting already in progress." , "PLAIN DOWN"]; };
|
||||||
TradeInprogress = true;
|
TradeInprogress = true;
|
||||||
|
|
||||||
// Recipes
|
|
||||||
|
|
||||||
// 6 Tin cans = Tin Bar
|
|
||||||
// 6 Aluminum cans = Aluminum Bar
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
== Canned Foods
|
== Canned Foods
|
||||||
"FoodCanBakedBeans",
|
"FoodCanBakedBeans",
|
||||||
@@ -43,8 +38,6 @@ TradeInprogress = true;
|
|||||||
"ItemSodaMzlyEmpty",.
|
"ItemSodaMzlyEmpty",.
|
||||||
"ItemSodaRabbitEmpty"
|
"ItemSodaRabbitEmpty"
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
== Raw Meats
|
== Raw Meats
|
||||||
"FoodSteakRaw",
|
"FoodSteakRaw",
|
||||||
"FoodmeatRaw",
|
"FoodmeatRaw",
|
||||||
@@ -64,9 +57,12 @@ TradeInprogress = true;
|
|||||||
"FoodbaconCooked"
|
"FoodbaconCooked"
|
||||||
*/
|
*/
|
||||||
|
|
||||||
// New items:
|
// Removed metals:
|
||||||
// FoodChickenNoodle
|
// _recipe_ItemBronzeBar = [[["ItemBronzeBar",1] ],[["ItemCopperBar",3],["ItemTinBar",3]]];
|
||||||
// FoodBeefBakedBeans
|
|
||||||
|
// New item ideas:
|
||||||
|
// _recipe_FoodChickenNoodle = [["FoodchickenRaw",1],["FoodCanPasta",1],["ItemWaterbottle",1]];
|
||||||
|
// _recipe_FoodBeefBakedBeans = [["FoodbeefRaw",1],["FoodCanBakedBeans",1]];
|
||||||
// ItemSalt
|
// ItemSalt
|
||||||
|
|
||||||
_onLadder = (getNumber (configFile >> "CfgMovesMaleSdr" >> "States" >> (animationState player) >> "onLadder")) == 1;
|
_onLadder = (getNumber (configFile >> "CfgMovesMaleSdr" >> "States" >> (animationState player) >> "onLadder")) == 1;
|
||||||
@@ -74,74 +70,14 @@ _canDo = (!r_drag_sqf and !r_player_unconscious and !_onLadder);
|
|||||||
|
|
||||||
// reqire fire target
|
// reqire fire target
|
||||||
if (inflamed cursorTarget and _canDo) then {
|
if (inflamed cursorTarget and _canDo) then {
|
||||||
// Bad way to define static loot in library functions
|
|
||||||
// Better initially walkthrough all items which have output = _create
|
|
||||||
// and also fetch output quantity from config.
|
|
||||||
// best way: defining input and output with ratio in configFile
|
|
||||||
|
|
||||||
_recipe_ItemTinBar = [
|
// Moved all recipes input and outputs to configs
|
||||||
[ ["ItemTinBar",1] ],
|
|
||||||
[ ["TrashTinCan",6] ]
|
|
||||||
];
|
|
||||||
|
|
||||||
_recipe_ItemAluminumBar = [
|
|
||||||
[ ["ItemAluminumBar",1] ],
|
|
||||||
[ ["ItemSodaEmpty",6] ]
|
|
||||||
];
|
|
||||||
|
|
||||||
_recipe_ItemBronzeBar = [
|
|
||||||
[ ["ItemBronzeBar",1] ],
|
|
||||||
[ ["ItemCopperBar",3],["ItemTinBar",3] ]
|
|
||||||
];
|
|
||||||
|
|
||||||
_recipe_ItemGoldBar10oz = [
|
|
||||||
[ ["ItemGoldBar10oz",1] ],
|
|
||||||
[ ["ItemGoldBar",10] ]
|
|
||||||
];
|
|
||||||
|
|
||||||
_recipe_ItemGoldBar = [
|
|
||||||
[ ["ItemGoldBar",10] ],
|
|
||||||
[ ["ItemGoldBar10oz",1] ]
|
|
||||||
];
|
|
||||||
|
|
||||||
_recipe_ItemSilverBar10oz = [
|
_selectedRecipeOutput = getArray (configFile >> "cfgMagazines" >> _this >> "ItemActions" >> "Crafting" >> "output") select 0;
|
||||||
[ ["ItemSilverBar10oz",1] ],
|
_selectedRecipe = getArray (configFile >> "cfgMagazines" >> _this >> "ItemActions" >> "Crafting" >> "input") select 0;
|
||||||
[ ["ItemSilverBar",10] ]
|
|
||||||
];
|
|
||||||
|
|
||||||
_recipe_ItemSilverBar = [
|
diag_log format["Selected Recipe Input: %1", _selectedRecipe];
|
||||||
[ ["ItemSilverBar",10] ],
|
diag_log format["Selected Recipe Output: %1", _selectedRecipeOutput];
|
||||||
[ ["ItemSilverBar10oz",1] ]
|
|
||||||
];
|
|
||||||
|
|
||||||
_recipe_ItemCopperBar10oz = [
|
|
||||||
[ ["ItemCopperBar10oz",1] ],
|
|
||||||
[ ["ItemCopperBar",10] ]
|
|
||||||
];
|
|
||||||
|
|
||||||
_recipe_ItemCopperBar = [
|
|
||||||
[ ["ItemCopperBar",10] ],
|
|
||||||
[ ["ItemCopperBar10oz",1] ]
|
|
||||||
];
|
|
||||||
|
|
||||||
_recipe_ItemSandbagLarge = [
|
|
||||||
[ ["ItemSandbagLarge",1] ],
|
|
||||||
[ ["ItemSandbag",3],["ItemWire",1],["ItemTankTrap",1] ]
|
|
||||||
];
|
|
||||||
|
|
||||||
//_recipe_FoodChickenNoodle = [["FoodchickenRaw",1],["FoodCanPasta",1],["ItemWaterbottle",1]];
|
|
||||||
//_recipe_FoodBeefBakedBeans = [["FoodbeefRaw",1],["FoodCanBakedBeans",1]];
|
|
||||||
|
|
||||||
//Add new item
|
|
||||||
_item = _this;
|
|
||||||
_create = getArray (configFile >> "cfgMagazines" >> _item >> "ItemActions" >> "Crafting" >> "output") select 0;
|
|
||||||
|
|
||||||
_selectedRecipeArray = call compile format["_recipe_%1;",_create];
|
|
||||||
|
|
||||||
_selectedRecipeOutput = _selectedRecipeArray select 0;
|
|
||||||
_selectedRecipe = _selectedRecipeArray select 1;
|
|
||||||
|
|
||||||
diag_log format["Selected Recipe: %1", _selectedRecipe];
|
|
||||||
|
|
||||||
_proceed = true;
|
_proceed = true;
|
||||||
|
|
||||||
@@ -177,9 +113,7 @@ if (inflamed cursorTarget and _canDo) then {
|
|||||||
_removed = 0; // count of removed items
|
_removed = 0; // count of removed items
|
||||||
|
|
||||||
{
|
{
|
||||||
if( (_removed < _countIn)
|
if( (_removed < _countIn) && ((_x == _itemIn) || configName(inheritsFrom(configFile >> "cfgMagazines" >> _x)) == _itemIn)) then {
|
||||||
&& ((_x == _itemIn) || configName(inheritsFrom(configFile >> "cfgMagazines" >> _x)) == _itemIn)
|
|
||||||
) then {
|
|
||||||
diag_log format["removing: %1 kindOf: %2", _x, _itemIn];
|
diag_log format["removing: %1 kindOf: %2", _x, _itemIn];
|
||||||
player removeMagazine _x;
|
player removeMagazine _x;
|
||||||
_removed = _removed +1;
|
_removed = _removed +1;
|
||||||
@@ -202,7 +136,7 @@ if (inflamed cursorTarget and _canDo) then {
|
|||||||
} forEach _selectedRecipeOutput;
|
} forEach _selectedRecipeOutput;
|
||||||
|
|
||||||
// get display name
|
// get display name
|
||||||
_textCreate = getText(configFile >> "CfgMagazines" >> _create >> "displayName");
|
_textCreate = getText(configFile >> "CfgMagazines" >> _itemOut >> "displayName");
|
||||||
|
|
||||||
// Add crafted item
|
// Add crafted item
|
||||||
cutText [format["Crafted Item: %1 x %2",_textCreate,_countOut], "PLAIN DOWN"];
|
cutText [format["Crafted Item: %1 x %2",_textCreate,_countOut], "PLAIN DOWN"];
|
||||||
@@ -212,7 +146,7 @@ if (inflamed cursorTarget and _canDo) then {
|
|||||||
cutText [format["Missing %1 more of %2",_missingQty, _textMissing], "PLAIN DOWN"];
|
cutText [format["Missing %1 more of %2",_missingQty, _textMissing], "PLAIN DOWN"];
|
||||||
};
|
};
|
||||||
} else {
|
} else {
|
||||||
cutText ["Crafting needs a fire", "PLAIN DOWN"];
|
cutText ["You need to be looking at a fire to craft.", "PLAIN DOWN"];
|
||||||
};
|
};
|
||||||
|
|
||||||
TradeInprogress = false;
|
TradeInprogress = false;
|
||||||
@@ -1392,7 +1392,9 @@ class CfgMagazines
|
|||||||
{
|
{
|
||||||
text = "Smelt 10oz bar";
|
text = "Smelt 10oz bar";
|
||||||
script = "spawn player_craftItem;";
|
script = "spawn player_craftItem;";
|
||||||
output[] = {"ItemGoldBar10oz"};
|
output[] = {["ItemGoldBar10oz",1]};
|
||||||
|
input[] = {["ItemGoldBar",10]};
|
||||||
|
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
@@ -1411,7 +1413,8 @@ class CfgMagazines
|
|||||||
{
|
{
|
||||||
text = "Smelt 1oz bars";
|
text = "Smelt 1oz bars";
|
||||||
script = "spawn player_craftItem;";
|
script = "spawn player_craftItem;";
|
||||||
output[] = {"ItemGoldBar"};
|
output[] = {["ItemGoldBar",10]};
|
||||||
|
input[] = {["ItemGoldBar10oz",1]};
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
@@ -1430,7 +1433,8 @@ class CfgMagazines
|
|||||||
{
|
{
|
||||||
text = "Smelt 10oz bar";
|
text = "Smelt 10oz bar";
|
||||||
script = "spawn player_craftItem;";
|
script = "spawn player_craftItem;";
|
||||||
output[] = {"ItemSilverBar10oz"};
|
output[] = {["ItemSilverBar10oz"1]};
|
||||||
|
input[] = {["ItemSilverBar",10]};
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
@@ -1450,7 +1454,8 @@ class CfgMagazines
|
|||||||
{
|
{
|
||||||
text = "Smelt 1oz bars";
|
text = "Smelt 1oz bars";
|
||||||
script = "spawn player_craftItem;";
|
script = "spawn player_craftItem;";
|
||||||
output[] = {"ItemSilverBar"};
|
output[] = {["ItemSilverBar",10]};
|
||||||
|
input[] = {["ItemSilverBar10oz",1]};
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
@@ -1469,7 +1474,8 @@ class CfgMagazines
|
|||||||
{
|
{
|
||||||
text = "Smelt 10oz bar";
|
text = "Smelt 10oz bar";
|
||||||
script = "spawn player_craftItem;";
|
script = "spawn player_craftItem;";
|
||||||
output[] = {"ItemCopperBar10oz"};
|
output[] = {["ItemCopperBar10oz",1]};
|
||||||
|
input[] = {["ItemCopperBar",10]};
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
@@ -1489,7 +1495,8 @@ class CfgMagazines
|
|||||||
{
|
{
|
||||||
text = "Smelt 1oz bars";
|
text = "Smelt 1oz bars";
|
||||||
script = "spawn player_craftItem;";
|
script = "spawn player_craftItem;";
|
||||||
output[] = {"ItemCopperBar"};
|
output[] = {["ItemCopperBar",10]};
|
||||||
|
input[] = {["ItemCopperBar10oz",1]};
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
@@ -1530,7 +1537,8 @@ class CfgMagazines
|
|||||||
{
|
{
|
||||||
text = "Smelt 1oz bars";
|
text = "Smelt 1oz bars";
|
||||||
script = "spawn player_craftItem;";
|
script = "spawn player_craftItem;";
|
||||||
output[] = {"ItemAluminumBar"};
|
output[] = {["ItemAluminumBar",10]};
|
||||||
|
input[] = {["ItemAluminumBar10oz",1]};
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
@@ -1560,7 +1568,8 @@ class CfgMagazines
|
|||||||
{
|
{
|
||||||
text = "Smelt 1oz bars";
|
text = "Smelt 1oz bars";
|
||||||
script = "spawn player_craftItem;";
|
script = "spawn player_craftItem;";
|
||||||
output[] = {"ItemTinBar"};
|
output[] = {["ItemTinBar",10]};
|
||||||
|
input[] = {["ItemTinBar10oz",1]};
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -650,7 +650,8 @@ class cfgMagazines
|
|||||||
{
|
{
|
||||||
text = "Melt into Bars";
|
text = "Melt into Bars";
|
||||||
script = "spawn player_craftItem;";
|
script = "spawn player_craftItem;";
|
||||||
output[] = {"ItemTinBar"};
|
output[] = {["ItemTinBar",1]};
|
||||||
|
input[] = {["TrashTinCan",6]};
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
@@ -668,7 +669,8 @@ class cfgMagazines
|
|||||||
{
|
{
|
||||||
text = "Melt into Bars";
|
text = "Melt into Bars";
|
||||||
script = "spawn player_craftItem;";
|
script = "spawn player_craftItem;";
|
||||||
output[] = {"ItemAluminumBar"};
|
output[] = {["ItemAluminumBar",1]};
|
||||||
|
input[] = {["ItemSodaEmpty",6]};
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|||||||
Reference in New Issue
Block a user