Перейти к публикации
Поиск в
  • Дополнительно...
Искать результаты, содержащие...
Искать результаты в...
  • Нужна помощь?

    Создайте тему в соответствующем разделе
    Не нужно писать всё в чат!
  • Загляните на торговую площадку

    Там вы можете купить
    всё что касается игровых серверов
  • Не хотите бан?

    Пожалуйста, ознакомьтесь с нашими правилами
    Не нарушайте порядок!
  • Продаёте или покупаете?

    Пользуйтесь услугами гаранта
    Мы сделаем вашу сделку безопасной
  • 0
Verum

Проблема с крафтом

Впервые столкнулся с проблемой такого рода (делал куда более сложные крафты).
Собственно вот код

class CraftCherenok extends RecipeBase
{	
	override void Init()
	{
		m_Name = "Изготовить черенок для лопаты";
		m_IsInstaRecipe = false;//should this recipe be performed instantly without animation
		m_AnimationLength = 5;//animation length in relative time units
		m_Specialty = -0.02;// value > 0 for roughness, value < 0 for precision
		
		
		//conditions
		m_MinDamageIngredient[0] = -1;//-1 = disable check
		m_MaxDamageIngredient[0] = 3;//-1 = disable check
		
		m_MinQuantityIngredient[0] = -1;//-1 = disable check
		m_MaxQuantityIngredient[0] = -1;//-1 = disable check
		
		m_MinDamageIngredient[1] = -1;//-1 = disable check
		m_MaxDamageIngredient[1] = 3;//-1 = disable check
		
		m_MinQuantityIngredient[1] = 1;//-1 = disable check
		m_MaxQuantityIngredient[1] = -1;//-1 = disable check
		//----------------------------------------------------------------------------------------------------------------------
		
		//INGREDIENTS
		//ingredient 1
		InsertIngredient(0,"Handsaw");//you can insert multiple ingredients this way

		m_IngredientAddHealth[0] = -20;// 0 = do nothing
		m_IngredientSetHealth[0] = -1; // -1 = do nothing
		m_IngredientAddQuantity[0] = 0;// 0 = do nothing
		m_IngredientDestroy[0] = false;//true = destroy, false = do nothing
		m_IngredientUseSoftSkills[0] = false;// set 'true' to allow modification of the values by softskills on this ingredient
		
		//ingredient 2
		InsertIngredient(1,"WoodenPlank");//you can insert multiple ingredients this way
		
		m_IngredientAddHealth[1] = 0;// 0 = do nothing
		m_IngredientSetHealth[1] = -1; // -1 = do nothing
		m_IngredientAddQuantity[1] = -1;// 0 = do nothing
		m_IngredientDestroy[1] = true;// false = do nothing
		m_IngredientUseSoftSkills[1] = false;// set 'true' to allow modification of the values by softskills on this ingredient
		//----------------------------------------------------------------------------------------------------------------------
		
		//result1
		AddResult("Cherenok");//add results here

		m_ResultSetFullQuantity[0] = true;//true = set full quantity, false = do nothing
		m_ResultSetQuantity[0] = -1;//-1 = do nothing
		m_ResultSetHealth[0] = -1;//-1 = do nothing
		m_ResultInheritsHealth[0] = -1;// (value) == -1 means do nothing; a (value) >= 0 means this result will inherit health from ingredient number (value);(value) == -2 means this result will inherit health from all ingredients averaged(result_health = combined_health_of_ingredients / number_of_ingredients)
		m_ResultInheritsColor[0] = -1;// (value) == -1 means do nothing; a (value) >= 0 means this result classname will be a composite of the name provided in AddResult method and config value "color" of ingredient (value)
		m_ResultToInventory[0] = -2;//(value) == -2 spawn result on the ground;(value) == -1 place anywhere in the players inventory, (value) >= 0 means switch position with ingredient number(value)
		m_ResultUseSoftSkills[0] = false;// set 'true' to allow modification of the values by softskills on this result
		m_ResultReplacesIngredient[0] = -1;// value == -1 means do nothing; a value >= 0 means this result will transfer item propertiesvariables, attachments etc.. from an ingredient value
	}
};

Категорически не хочет крафтить (красная пила при наведении на доску).
Пытался добавить аналогичный крафт с бревном, но он не отображается (есть крафт досок и дров), добавленного крафта из бревна нет.
 

Поделиться сообщением


Ссылка на сообщение
Поделиться на других сайтах

Рекомендованные сообщения

  • 0

Handsaw а должно быть HandSaw регистр тут строгий 

Поделиться сообщением


Ссылка на сообщение
Поделиться на других сайтах
MagicByte MagicByte MagicByte
  • 0

Во-первых код не был до конца написан, отсутствовали два оверрайда проверки, а они должны быть
Во-вторых количество ингредиентов типа пилы можно было и добавить m_MinQuantityIngredient[0] = 1;
В-третьих скорее всего забыл добавить рецепт в общий список. Совокупность всех трех проблем и дало результат невозможности сделать данный предмет.
P.s. Как ты делал

Пожалуйста, Войдите или Зарегистрируйтесь, чтобы увидеть это: Вложение.

Изменено пользователем AKuznecov (история изменений)

Поделиться сообщением


Ссылка на сообщение
Поделиться на других сайтах
  • 0

@AKuznecov крафт внесен в список.

Что касается данного крафта, то рядом с этим файлом лежит другой файл, где вместо одно пилы ножовка, а вместо доски лист металла, и все работает. Это и смутило.

Спасибо в любом случае, сейчас проверю.

Поделиться сообщением


Ссылка на сообщение
Поделиться на других сайтах
  • 0

@AKuznecov Вот тоже пример.. отмоддил дефолтный скрипт, всё работает кроме крафта черенка ))))

modded class SawWoodenLog extends RecipeBase
{	
	override void Init()
	{
		m_Name = "#STR_sawwoodenlog0";
		m_IsInstaRecipe = false;//should this recipe be performed instantly without animation
		m_AnimationLength = 2;//animation length in relative time units
		m_Specialty = 0.02;// value > 0 for roughness, value < 0 for precision
		
		
		//conditions
		m_MinDamageIngredient[0] = -1;//-1 = disable check
		m_MaxDamageIngredient[0] = 3;//-1 = disable check
		
		m_MinQuantityIngredient[0] = -1;//-1 = disable check
		m_MaxQuantityIngredient[0] = -1;//-1 = disable check
		
		m_MinDamageIngredient[1] = -1;//-1 = disable check
		m_MaxDamageIngredient[1] = 3;//-1 = disable check
		
		m_MinQuantityIngredient[1] = -1;//-1 = disable check
		m_MaxQuantityIngredient[1] = -1;//-1 = disable check
		//----------------------------------------------------------------------------------------------------------------------
		
		//INGREDIENTS
		//ingredient 1
		InsertIngredient(0,"WoodenLog");//you can insert multiple ingredients this way
		
		m_IngredientAddHealth[0] = 0;// 0 = do nothing
		m_IngredientSetHealth[0] = -1; // -1 = do nothing
		m_IngredientAddQuantity[0] = -1;// 0 = do nothing
		m_IngredientDestroy[0] = false;//true = destroy, false = do nothing
		m_IngredientUseSoftSkills[0] = false;// set 'true' to allow modification of the values by softskills on this ingredient
		
		//ingredient 2
		InsertIngredient(1,"Hacksaw");//you can insert multiple ingredients this way
		InsertIngredient(1,"HandSaw");//you can insert multiple ingredients this way
		InsertIngredient(1,"WoodAxe");//you can insert multiple ingredients this way
		InsertIngredient(1,"Hatchet");//you can insert multiple ingredients this way
		InsertIngredient(1,"FirefighterAxe");//you can insert multiple ingredients this way
	
		m_IngredientAddHealth[1] = -10;// 0 = do nothing
		m_IngredientSetHealth[1] = -1; // -1 = do nothing
		m_IngredientAddQuantity[1] = 0;// 0 = do nothing
		m_IngredientDestroy[1] = false;// false = do nothing
		m_IngredientUseSoftSkills[1] = true;// set 'true' to allow modification of the values by softskills on this ingredient
		
		//----------------------------------------------------------------------------------------------------------------------
		
		//result1
		AddResult("Firewood");//add results here

		m_ResultSetFullQuantity[0] = false;//true = set full quantity, false = do nothing
		m_ResultSetQuantity[0] = -1;//-1 = do nothing
		m_ResultSetHealth[0] = -1;//-1 = do nothing
		m_ResultInheritsHealth[0] = 0;// (value) == -1 means do nothing; a (value) >= 0 means this result will inherit health from ingredient number (value);(value) == -2 means this result will inherit health from all ingredients averaged(result_health = combined_health_of_ingredients / number_of_ingredients)
		m_ResultInheritsColor[0] = -1;// (value) == -1 means do nothing; a (value) >= 0 means this result classname will be a composite of the name provided in AddResult method and config value "color" of ingredient (value)
		m_ResultToInventory[0] = -2;//(value) == -2 spawn result on the ground;(value) == -1 place anywhere in the players inventory, (value) >= 0 means switch position with ingredient number(value)
		m_ResultUseSoftSkills[0] = false;// set 'true' to allow modification of the values by softskills on this result
		m_ResultReplacesIngredient[0] = -1;// value == -1 means do nothing; a value >= 0 means this result will transfer item propertiesvariables, attachments etc.. from an ingredient value
		
		//result2
		AddResult("Firewood");//add results here

		m_ResultSetFullQuantity[1] = false;//true = set full quantity, false = do nothing
		m_ResultSetQuantity[1] = -1;//-1 = do nothing
		m_ResultSetHealth[1] = -1;//-1 = do nothing
		m_ResultInheritsHealth[1] = 0;// (value) == -1 means do nothing; a (value) >= 0 means this result will inherit health from ingredient number (value);(value) == -2 means this result will inherit health from all ingredients averaged(result_health = combined_health_of_ingredients / number_of_ingredients)
		m_ResultInheritsColor[1] = -1;// (value) == -1 means do nothing; a (value) >= 0 means this result classname will be a composite of the name provided in AddResult method and config value "color" of ingredient (value)
		m_ResultToInventory[1] = -2;//(value) == -2 spawn result on the ground;(value) == -1 place anywhere in the players inventory, (value) >= 0 means switch position with ingredient number(value)
		m_ResultUseSoftSkills[1] = false;// set 'true' to allow modification of the values by softskills on this result
		m_ResultReplacesIngredient[1] = -1;// value == -1 means do nothing; a value >= 0 means this result will transfer item propertiesvariables, attachments etc.. from an ingredient value
		
		//result3
		AddResult("Firewood");//add results here

		m_ResultSetFullQuantity[2] = false;//true = set full quantity, false = do nothing
		m_ResultSetQuantity[2] = -1;//-1 = do nothing
		m_ResultSetHealth[2] = -1;//-1 = do nothing
		m_ResultInheritsHealth[2] = 0;// (value) == -1 means do nothing; a (value) >= 0 means this result will inherit health from ingredient number (value);(value) == -2 means this result will inherit health from all ingredients averaged(result_health = combined_health_of_ingredients / number_of_ingredients)
		m_ResultInheritsColor[2] = -1;// (value) == -1 means do nothing; a (value) >= 0 means this result classname will be a composite of the name provided in AddResult method and config value "color" of ingredient (value)
		m_ResultToInventory[2] = -2;//(value) == -2 spawn result on the ground;(value) == -1 place anywhere in the players inventory, (value) >= 0 means switch position with ingredient number(value)
		m_ResultUseSoftSkills[2] = false;// set 'true' to allow modification of the values by softskills on this result
		m_ResultReplacesIngredient[2] = -1;// value == -1 means do nothing; a value >= 0 means this result will transfer item propertiesvariables, attachments etc.. from an ingredient value		//----------------------------------------------------------------------------------------------------------------------
	
    //result3
		AddResult("Cherenok");//add results here

		m_ResultSetFullQuantity[3] = false;//true = set full quantity, false = do nothing
		m_ResultSetQuantity[3] = -1;//-1 = do nothing
		m_ResultSetHealth[3] = -1;//-1 = do nothing
		m_ResultInheritsHealth[3] = 0;// (value) == -1 means do nothing; a (value) >= 0 means this result will inherit health from ingredient number (value);(value) == -2 means this result will inherit health from all ingredients averaged(result_health = combined_health_of_ingredients / number_of_ingredients)
		m_ResultInheritsColor[3] = -1;// (value) == -1 means do nothing; a (value) >= 0 means this result classname will be a composite of the name provided in AddResult method and config value "color" of ingredient (value)
		m_ResultToInventory[3] = -2;//(value) == -2 spawn result on the ground;(value) == -1 place anywhere in the players inventory, (value) >= 0 means switch position with ingredient number(value)
		m_ResultUseSoftSkills[3] = false;// set 'true' to allow modification of the values by softskills on this result
		m_ResultReplacesIngredient[3] = -1;// value == -1 means do nothing; a value >= 0 means this result will transfer item propertiesvariables, attachments etc.. from an ingredient value		//----------------------------------------------------------------------------------------------------------------------
	
    }

	override bool CanDo(ItemBase ingredients[], PlayerBase player)//final check for recipe's validity
	{
		return true;
	}

	override void Do(ItemBase ingredients[], PlayerBase player,array<ItemBase> results, float specialty_weight)//gets called upon recipe's completion
	{
	}
};

 

Поделиться сообщением


Ссылка на сообщение
Поделиться на других сайтах
  • 0

@Verum Проверил ваш файл, не работает.
Тоже самое всё.

Пожалуйста, Войдите или Зарегистрируйтесь, чтобы увидеть это: Вложение.

Поделиться сообщением


Ссылка на сообщение
Поделиться на других сайтах
  • 0
2 часа назад, Verum сказал:

@AKuznecov Вот тоже пример.. отмоддил дефолтный скрипт, всё работает кроме крафта черенка ))))

modded class SawWoodenLog extends RecipeBase { override void Init() { m_Name = "#STR_sawwoodenlog0"; m_IsInstaRecipe = false;//should this recipe be performed instantly without animation m_AnimationLength = 2;//animation length in relative time units m_Specialty = 0.02;// value > 0 for roughness, value < 0 for precision //conditions m_MinDamageIngredient[0] = -1;//-1 = disable check m_MaxDamageIngredient[0] = 3;//-1 = disable check m_MinQuantityIngredient[0] = -1;//-1 = disable check m_MaxQuantityIngredient[0] = -1;//-1 = disable check m_MinDamageIngredient[1] = -1;//-1 = disable check m_MaxDamageIngredient[1] = 3;//-1 = disable check m_MinQuantityIngredient[1] = -1;//-1 = disable check m_MaxQuantityIngredient[1] = -1;//-1 = disable check //---------------------------------------------------------------------------------------------------------------------- //INGREDIENTS //ingredient 1 InsertIngredient(0,"WoodenLog");//you can insert multiple ingredients this way m_IngredientAddHealth[0] = 0;// 0 = do nothing m_IngredientSetHealth[0] = -1; // -1 = do nothing m_IngredientAddQuantity[0] = -1;// 0 = do nothing m_IngredientDestroy[0] = false;//true = destroy, false = do nothing m_IngredientUseSoftSkills[0] = false;// set 'true' to allow modification of the values by softskills on this ingredient //ingredient 2 InsertIngredient(1,"Hacksaw");//you can insert multiple ingredients this way InsertIngredient(1,"HandSaw");//you can insert multiple ingredients this way InsertIngredient(1,"WoodAxe");//you can insert multiple ingredients this way InsertIngredient(1,"Hatchet");//you can insert multiple ingredients this way InsertIngredient(1,"FirefighterAxe");//you can insert multiple ingredients this way m_IngredientAddHealth[1] = -10;// 0 = do nothing m_IngredientSetHealth[1] = -1; // -1 = do nothing m_IngredientAddQuantity[1] = 0;// 0 = do nothing m_IngredientDestroy[1] = false;// false = do nothing m_IngredientUseSoftSkills[1] = true;// set 'true' to allow modification of the values by softskills on this ingredient //---------------------------------------------------------------------------------------------------------------------- //result1 AddResult("Firewood");//add results here m_ResultSetFullQuantity[0] = false;//true = set full quantity, false = do nothing m_ResultSetQuantity[0] = -1;//-1 = do nothing m_ResultSetHealth[0] = -1;//-1 = do nothing m_ResultInheritsHealth[0] = 0;// (value) == -1 means do nothing; a (value) >= 0 means this result will inherit health from ingredient number (value);(value) == -2 means this result will inherit health from all ingredients averaged(result_health = combined_health_of_ingredients / number_of_ingredients) m_ResultInheritsColor[0] = -1;// (value) == -1 means do nothing; a (value) >= 0 means this result classname will be a composite of the name provided in AddResult method and config value "color" of ingredient (value) m_ResultToInventory[0] = -2;//(value) == -2 spawn result on the ground;(value) == -1 place anywhere in the players inventory, (value) >= 0 means switch position with ingredient number(value) m_ResultUseSoftSkills[0] = false;// set 'true' to allow modification of the values by softskills on this result m_ResultReplacesIngredient[0] = -1;// value == -1 means do nothing; a value >= 0 means this result will transfer item propertiesvariables, attachments etc.. from an ingredient value //result2 AddResult("Firewood");//add results here m_ResultSetFullQuantity[1] = false;//true = set full quantity, false = do nothing m_ResultSetQuantity[1] = -1;//-1 = do nothing m_ResultSetHealth[1] = -1;//-1 = do nothing m_ResultInheritsHealth[1] = 0;// (value) == -1 means do nothing; a (value) >= 0 means this result will inherit health from ingredient number (value);(value) == -2 means this result will inherit health from all ingredients averaged(result_health = combined_health_of_ingredients / number_of_ingredients) m_ResultInheritsColor[1] = -1;// (value) == -1 means do nothing; a (value) >= 0 means this result classname will be a composite of the name provided in AddResult method and config value "color" of ingredient (value) m_ResultToInventory[1] = -2;//(value) == -2 spawn result on the ground;(value) == -1 place anywhere in the players inventory, (value) >= 0 means switch position with ingredient number(value) m_ResultUseSoftSkills[1] = false;// set 'true' to allow modification of the values by softskills on this result m_ResultReplacesIngredient[1] = -1;// value == -1 means do nothing; a value >= 0 means this result will transfer item propertiesvariables, attachments etc.. from an ingredient value //result3 AddResult("Firewood");//add results here m_ResultSetFullQuantity[2] = false;//true = set full quantity, false = do nothing m_ResultSetQuantity[2] = -1;//-1 = do nothing m_ResultSetHealth[2] = -1;//-1 = do nothing m_ResultInheritsHealth[2] = 0;// (value) == -1 means do nothing; a (value) >= 0 means this result will inherit health from ingredient number (value);(value) == -2 means this result will inherit health from all ingredients averaged(result_health = combined_health_of_ingredients / number_of_ingredients) m_ResultInheritsColor[2] = -1;// (value) == -1 means do nothing; a (value) >= 0 means this result classname will be a composite of the name provided in AddResult method and config value "color" of ingredient (value) m_ResultToInventory[2] = -2;//(value) == -2 spawn result on the ground;(value) == -1 place anywhere in the players inventory, (value) >= 0 means switch position with ingredient number(value) m_ResultUseSoftSkills[2] = false;// set 'true' to allow modification of the values by softskills on this result m_ResultReplacesIngredient[2] = -1;// value == -1 means do nothing; a value >= 0 means this result will transfer item propertiesvariables, attachments etc.. from an ingredient value //---------------------------------------------------------------------------------------------------------------------- //result3 AddResult("Cherenok");//add results here m_ResultSetFullQuantity[3] = false;//true = set full quantity, false = do nothing m_ResultSetQuantity[3] = -1;//-1 = do nothing m_ResultSetHealth[3] = -1;//-1 = do nothing m_ResultInheritsHealth[3] = 0;// (value) == -1 means do nothing; a (value) >= 0 means this result will inherit health from ingredient number (value);(value) == -2 means this result will inherit health from all ingredients averaged(result_health = combined_health_of_ingredients / number_of_ingredients) m_ResultInheritsColor[3] = -1;// (value) == -1 means do nothing; a (value) >= 0 means this result classname will be a composite of the name provided in AddResult method and config value "color" of ingredient (value) m_ResultToInventory[3] = -2;//(value) == -2 spawn result on the ground;(value) == -1 place anywhere in the players inventory, (value) >= 0 means switch position with ingredient number(value) m_ResultUseSoftSkills[3] = false;// set 'true' to allow modification of the values by softskills on this result m_ResultReplacesIngredient[3] = -1;// value == -1 means do nothing; a value >= 0 means this result will transfer item propertiesvariables, attachments etc.. from an ingredient value //---------------------------------------------------------------------------------------------------------------------- } override bool CanDo(ItemBase ingredients[], PlayerBase player)//final check for recipe's validity { return true; } override void Do(ItemBase ingredients[], PlayerBase player,array<ItemBase> results, float specialty_weight)//gets called upon recipe's completion { } };


modded class SawWoodenLog extends RecipeBase
{	
	override void Init()
	{
		m_Name = "#STR_sawwoodenlog0";
		m_IsInstaRecipe = false;//should this recipe be performed instantly without animation
		m_AnimationLength = 2;//animation length in relative time units
		m_Specialty = 0.02;// value > 0 for roughness, value < 0 for precision
		
		
		//conditions
		m_MinDamageIngredient[0] = -1;//-1 = disable check
		m_MaxDamageIngredient[0] = 3;//-1 = disable check
		
		m_MinQuantityIngredient[0] = -1;//-1 = disable check
		m_MaxQuantityIngredient[0] = -1;//-1 = disable check
		
		m_MinDamageIngredient[1] = -1;//-1 = disable check
		m_MaxDamageIngredient[1] = 3;//-1 = disable check
		
		m_MinQuantityIngredient[1] = -1;//-1 = disable check
		m_MaxQuantityIngredient[1] = -1;//-1 = disable check
		//----------------------------------------------------------------------------------------------------------------------
		
		//INGREDIENTS
		//ingredient 1
		InsertIngredient(0,"WoodenLog");//you can insert multiple ingredients this way
		
		m_IngredientAddHealth[0] = 0;// 0 = do nothing
		m_IngredientSetHealth[0] = -1; // -1 = do nothing
		m_IngredientAddQuantity[0] = -1;// 0 = do nothing
		m_IngredientDestroy[0] = false;//true = destroy, false = do nothing
		m_IngredientUseSoftSkills[0] = false;// set 'true' to allow modification of the values by softskills on this ingredient
		
		//ingredient 2
		InsertIngredient(1,"Hacksaw");//you can insert multiple ingredients this way
		InsertIngredient(1,"HandSaw");//you can insert multiple ingredients this way
		InsertIngredient(1,"WoodAxe");//you can insert multiple ingredients this way
		InsertIngredient(1,"Hatchet");//you can insert multiple ingredients this way
		InsertIngredient(1,"FirefighterAxe");//you can insert multiple ingredients this way
	
		m_IngredientAddHealth[1] = -10;// 0 = do nothing
		m_IngredientSetHealth[1] = -1; // -1 = do nothing
		m_IngredientAddQuantity[1] = 0;// 0 = do nothing
		m_IngredientDestroy[1] = false;// false = do nothing
		m_IngredientUseSoftSkills[1] = true;// set 'true' to allow modification of the values by softskills on this ingredient
		
		//----------------------------------------------------------------------------------------------------------------------
		
		//result1
		AddResult("Firewood");//add results here

		m_ResultSetFullQuantity[0] = false;//true = set full quantity, false = do nothing
		m_ResultSetQuantity[0] = -1;//-1 = do nothing
		m_ResultSetHealth[0] = -1;//-1 = do nothing
		m_ResultInheritsHealth[0] = 0;// (value) == -1 means do nothing; a (value) >= 0 means this result will inherit health from ingredient number (value);(value) == -2 means this result will inherit health from all ingredients averaged(result_health = combined_health_of_ingredients / number_of_ingredients)
		m_ResultInheritsColor[0] = -1;// (value) == -1 means do nothing; a (value) >= 0 means this result classname will be a composite of the name provided in AddResult method and config value "color" of ingredient (value)
		m_ResultToInventory[0] = -2;//(value) == -2 spawn result on the ground;(value) == -1 place anywhere in the players inventory, (value) >= 0 means switch position with ingredient number(value)
		m_ResultUseSoftSkills[0] = false;// set 'true' to allow modification of the values by softskills on this result
		m_ResultReplacesIngredient[0] = -1;// value == -1 means do nothing; a value >= 0 means this result will transfer item propertiesvariables, attachments etc.. from an ingredient value
		
		//result2
		AddResult("Firewood");//add results here

		m_ResultSetFullQuantity[1] = false;//true = set full quantity, false = do nothing
		m_ResultSetQuantity[1] = -1;//-1 = do nothing
		m_ResultSetHealth[1] = -1;//-1 = do nothing
		m_ResultInheritsHealth[1] = 0;// (value) == -1 means do nothing; a (value) >= 0 means this result will inherit health from ingredient number (value);(value) == -2 means this result will inherit health from all ingredients averaged(result_health = combined_health_of_ingredients / number_of_ingredients)
		m_ResultInheritsColor[1] = -1;// (value) == -1 means do nothing; a (value) >= 0 means this result classname will be a composite of the name provided in AddResult method and config value "color" of ingredient (value)
		m_ResultToInventory[1] = -2;//(value) == -2 spawn result on the ground;(value) == -1 place anywhere in the players inventory, (value) >= 0 means switch position with ingredient number(value)
		m_ResultUseSoftSkills[1] = false;// set 'true' to allow modification of the values by softskills on this result
		m_ResultReplacesIngredient[1] = -1;// value == -1 means do nothing; a value >= 0 means this result will transfer item propertiesvariables, attachments etc.. from an ingredient value
		
		//result3
		AddResult("Firewood");//add results here

		m_ResultSetFullQuantity[2] = false;//true = set full quantity, false = do nothing
		m_ResultSetQuantity[2] = -1;//-1 = do nothing
		m_ResultSetHealth[2] = -1;//-1 = do nothing
		m_ResultInheritsHealth[2] = 0;// (value) == -1 means do nothing; a (value) >= 0 means this result will inherit health from ingredient number (value);(value) == -2 means this result will inherit health from all ingredients averaged(result_health = combined_health_of_ingredients / number_of_ingredients)
		m_ResultInheritsColor[2] = -1;// (value) == -1 means do nothing; a (value) >= 0 means this result classname will be a composite of the name provided in AddResult method and config value "color" of ingredient (value)
		m_ResultToInventory[2] = -2;//(value) == -2 spawn result on the ground;(value) == -1 place anywhere in the players inventory, (value) >= 0 means switch position with ingredient number(value)
		m_ResultUseSoftSkills[2] = false;// set 'true' to allow modification of the values by softskills on this result
		m_ResultReplacesIngredient[2] = -1;// value == -1 means do nothing; a value >= 0 means this result will transfer item propertiesvariables, attachments etc.. from an ingredient value		//----------------------------------------------------------------------------------------------------------------------
	
    //result3
		AddResult("Cherenok");//add results here

		m_ResultSetFullQuantity[3] = false;//true = set full quantity, false = do nothing
		m_ResultSetQuantity[3] = -1;//-1 = do nothing
		m_ResultSetHealth[3] = -1;//-1 = do nothing
		m_ResultInheritsHealth[3] = 0;// (value) == -1 means do nothing; a (value) >= 0 means this result will inherit health from ingredient number (value);(value) == -2 means this result will inherit health from all ingredients averaged(result_health = combined_health_of_ingredients / number_of_ingredients)
		m_ResultInheritsColor[3] = -1;// (value) == -1 means do nothing; a (value) >= 0 means this result classname will be a composite of the name provided in AddResult method and config value "color" of ingredient (value)
		m_ResultToInventory[3] = -2;//(value) == -2 spawn result on the ground;(value) == -1 place anywhere in the players inventory, (value) >= 0 means switch position with ingredient number(value)
		m_ResultUseSoftSkills[3] = false;// set 'true' to allow modification of the values by softskills on this result
		m_ResultReplacesIngredient[3] = -1;// value == -1 means do nothing; a value >= 0 means this result will transfer item propertiesvariables, attachments etc.. from an ingredient value		//----------------------------------------------------------------------------------------------------------------------
	
    }

	override bool CanDo(ItemBase ingredients[], PlayerBase player)//final check for recipe's validity
	{
		return true;
	}

	override void Do(ItemBase ingredients[], PlayerBase player,array<ItemBase> results, float specialty_weight)//gets called upon recipe's completion
	{
	}
};

 

потому как в этом классе дефолтном уже изначально все прописано авторами игры было, потому и работает)

Поделиться сообщением


Ссылка на сообщение
Поделиться на других сайтах
  • 0

@123new 
Так как мне сделать этот несчастный крафт.. с помощью ручной пилы и доски, получить нужны мне предмет?! ?

Поделиться сообщением


Ссылка на сообщение
Поделиться на других сайтах
  • 0
12 минут назад, Verum сказал:

@123new 
Так как мне сделать этот несчастный крафт.. с помощью ручной пилы и доски, получить нужны мне предмет?! ?

попробуй заменить

modded class PluginRecipesManager extends PluginBase
{
	void RegisterRecipies()
	{
		super.RegisterRecipies();
		RegisterRecipe(new CraftWoodCherenok);
	}
};

на

modded class PluginRecipesManager extends PluginBase
{
	override void RegisterRecipies()
	{
		super.RegisterRecipies();
		RegisterRecipe(new CraftWoodCherenok);
	}
};

 

Поделиться сообщением


Ссылка на сообщение
Поделиться на других сайтах
  • 0
1 час назад, 123new сказал:

попробуй заменить

modded class PluginRecipesManager extends PluginBase { void RegisterRecipies() { super.RegisterRecipies(); RegisterRecipe(new CraftWoodCherenok); } };


modded class PluginRecipesManager extends PluginBase
{
	void RegisterRecipies()
	{
		super.RegisterRecipies();
		RegisterRecipe(new CraftWoodCherenok);
	}
};

на

modded class PluginRecipesManager extends PluginBase { override void RegisterRecipies() { super.RegisterRecipies(); RegisterRecipe(new CraftWoodCherenok); } };


modded class PluginRecipesManager extends PluginBase
{
	override void RegisterRecipies()
	{
		super.RegisterRecipies();
		RegisterRecipe(new CraftWoodCherenok);
	}
};

 

Не помогло... Ребят, есть у кого рабочий крафт чего либо с помощью пилы  и бревна или доски?

Поделиться сообщением


Ссылка на сообщение
Поделиться на других сайтах
  • 0

Работает всё просто надо было немного подумать, а так как я дал код правильный то ошибка была на видном месте, так то чтобы заработал крафт

Пожалуйста, Войдите или Зарегистрируйтесь, чтобы увидеть это: Вложение.

Пожалуйста, Войдите или Зарегистрируйтесь, чтобы увидеть это: Вложение.

Изменено пользователем AKuznecov (история изменений)

Поделиться сообщением


Ссылка на сообщение
Поделиться на других сайтах
  • 0

@AKuznecov Можно указать слепому на это место?

 

Изменено пользователем Verum (история изменений)

Поделиться сообщением


Ссылка на сообщение
Поделиться на других сайтах
  • 0

Пора гайд писать чего из чего состоит и как это работает

Поделиться сообщением


Ссылка на сообщение
Поделиться на других сайтах
  • 0

@AKuznecov много вопросов лежит вроде бы на поверхности.. но бывают сложности.. как и сдесь..всего лишь регистр, но ломал все

Поделиться сообщением


Ссылка на сообщение
Поделиться на других сайтах
  • 0

парни, подскажите

5 листов + пила = бочка

у меня в руке 10 листов +пила.

после крафта тратится 1 лист и 9 остается. (хотя 5 прописано в крафте инградинта метал)

мне нужно чтобы неважно сколько листов в руках (конечно больше 5) происходил крафт. 5 удалялось, остальные оставались. (как с крафтом ванильного ящика например. неважно сколько гвоздей и неважно сколько досок -крафт возьмет свое, а остальное оставит на земле.
 

class AD_CraftBarrelBlue extends RecipeBase
{
	override void Init()
	{
		m_Name = "Сделать синюю бочку";
		m_IsInstaRecipe = false;	// should this recipe be performed instantly without animation
		m_AnimationLength = 2;		// animation length in relative time units
		m_Specialty = 0;			// softskills modifier. value > 0 for roughness, value < 0 for precision

		//ingredient 1
		InsertIngredient(0,"MetalPlate");
		
		m_MinDamageIngredient[0] = -1;			// -1 = disable check
		m_MaxDamageIngredient[0] = 3;			// -1 = disable check
		
		m_MinQuantityIngredient[0] = 5;			// -1 = disable check
		m_MaxQuantityIngredient[0] = -1;			// -1 = disable check
		
		m_IngredientAddHealth[0] = 0;			// 0 = do nothing
		m_IngredientSetHealth[0] = -1; 			// -1 = do nothing
		m_IngredientAddQuantity[0] = 0;			// 0 = do nothing
		m_IngredientDestroy[0] = true;			// true = destroy, false = do nothing
		m_IngredientUseSoftSkills[0] = false;	// set 'true' to allow modification of the values by softskills on this ingredient
		
		//ingredient 2
		InsertIngredient(1,"SledgeHammer");		// you can insert multiple ingredients this way

		m_MinDamageIngredient[1] = -1;			// -1 = disable check
		m_MaxDamageIngredient[1] = 3;			// -1 = disable check
		
		m_MinQuantityIngredient[1] = -1;		// -1 = disable check
		m_MaxQuantityIngredient[1] = -1;		// -1 = disable check
		
		m_IngredientAddHealth[1] = 0;			// 0 = do nothing
		m_IngredientSetHealth[1] = -1;			// -1 = do nothing
		m_IngredientAddQuantity[1] = 0;			// 0 = do nothing
		m_IngredientDestroy[1] = true;			// false = do nothing
		m_IngredientUseSoftSkills[1] = false;	// set 'true' to allow modification of the values by softskills on this ingredient
		
		//result 1
		AddResult("Barrel_Blue");			// add results here

		m_ResultSetFullQuantity[0] = true;		// true = set full quantity, false = do nothing
		m_ResultSetQuantity[0] = -1;			// -1 = do nothing
		m_ResultSetHealth[0] = -1;				// -1 = do nothing
		m_ResultInheritsHealth[0] = 1;			// (value) == -1 means do nothing; a (value) >= 0 means this result will inherit health from ingredient number (value);(value) == -2 means this result will inherit health from all ingredients averaged(result_health = combined_health_of_ingredients / number_of_ingredients)
		m_ResultInheritsColor[0] = -1;			// (value) == -1 means do nothing; a (value) >= 0 means this result classname will be a composite of the name provided in AddResult method and config value "color" of ingredient (value)
		m_ResultToInventory[0] = -2;			// (value) == -2 spawn result on the ground;(value) == -1 place anywhere in the players inventory, (value) >= 0 means switch position with ingredient number(value)
		m_ResultUseSoftSkills[0] = false;		// set 'true' to allow modification of the values by softskills on this result
		m_ResultReplacesIngredient[0] = -1;		// value == -1 means do nothing; a value >= 0 means this result will transfer item propertiesvariables, attachments etc.. from an ingredient value
	}

	override bool CanDo(ItemBase ingredients[], PlayerBase player)//final check for recipe's validity
	{
		return true;
	}

};

 

Изменено пользователем topden (история изменений)

Поделиться сообщением


Ссылка на сообщение
Поделиться на других сайтах
  • 0

ну очевидна же ошибка в 1-й цифре
 

class AD_CraftBarrelBlue extends RecipeBase
{
	override void Init()
	{
		m_Name = "Сделать синюю бочку";
		m_IsInstaRecipe = false;	// should this recipe be performed instantly without animation
		m_AnimationLength = 2;		// animation length in relative time units
		m_Specialty = 0;			// softskills modifier. value > 0 for roughness, value < 0 for precision

		//ingredient 1
		InsertIngredient(0,"MetalPlate");
		
		m_MinDamageIngredient[0] = -1;			// -1 = disable check
		m_MaxDamageIngredient[0] = 3;			// -1 = disable check
		
		m_MinQuantityIngredient[0] = 5;			// -1 = disable check
		m_MaxQuantityIngredient[0] = -1;			// -1 = disable check
		
		m_IngredientAddHealth[0] = 0;			// 0 = do nothing
		m_IngredientSetHealth[0] = -1; 			// -1 = do nothing
		m_IngredientAddQuantity[0] = -5;			// 0 = нету количество ингредиентов; 5 - 5 штук будет использоваться
		m_IngredientDestroy[0] = false;			// true = destroy, false = do nothing
		m_IngredientUseSoftSkills[0] = false;	// set 'true' to allow modification of the values by softskills on this ingredient
		
		//ingredient 2
		InsertIngredient(1,"HandSaw");		// you can insert multiple ingredients this way
    	InsertIngredient(1,"Hacksaw");		// you can insert multiple ingredients this way                                                                                    
		m_MinDamageIngredient[1] = -1;			// -1 = disable check
		m_MaxDamageIngredient[1] = 3;			// -1 = disable check
		
		m_MinQuantityIngredient[1] = -1;		// -1 = disable check
		m_MaxQuantityIngredient[1] = -1;		// -1 = disable check
		
		m_IngredientAddHealth[1] = -10;			// 0 = do nothing
		m_IngredientSetHealth[1] = -1;			// -1 = do nothing
		m_IngredientAddQuantity[1] = 0;			// 0 = do nothing
		m_IngredientDestroy[1] = false;			// false = do nothing
		m_IngredientUseSoftSkills[1] = false;	// set 'true' to allow modification of the values by softskills on this ingredient
		
		//result 1
		AddResult("Barrel_Blue");			// add results here

		m_ResultSetFullQuantity[0] = true;		// true = set full quantity, false = do nothing
		m_ResultSetQuantity[0] = -1;			// -1 = do nothing
		m_ResultSetHealth[0] = -1;				// -1 = do nothing
		m_ResultInheritsHealth[0] = 1;			// (value) == -1 means do nothing; a (value) >= 0 means this result will inherit health from ingredient number (value);(value) == -2 means this result will inherit health from all ingredients averaged(result_health = combined_health_of_ingredients / number_of_ingredients)
		m_ResultInheritsColor[0] = -1;			// (value) == -1 means do nothing; a (value) >= 0 means this result classname will be a composite of the name provided in AddResult method and config value "color" of ingredient (value)
		m_ResultToInventory[0] = -2;			// (value) == -2 spawn result on the ground;(value) == -1 place anywhere in the players inventory, (value) >= 0 means switch position with ingredient number(value)
		m_ResultUseSoftSkills[0] = false;		// set 'true' to allow modification of the values by softskills on this result
		m_ResultReplacesIngredient[0] = -1;		// value == -1 means do nothing; a value >= 0 means this result will transfer item propertiesvariables, attachments etc.. from an ingredient value
	}

	override bool CanDo(ItemBase ingredients[], PlayerBase player)//final check for recipe's validity
	{
		return true;
	}

};

 

Изменено пользователем AKuznecov (история изменений)

Поделиться сообщением


Ссылка на сообщение
Поделиться на других сайтах

Создайте аккаунт или войдите в него для комментирования

Вы должны быть пользователем, чтобы оставить комментарий

Создать аккаунт

Зарегистрируйтесь для получения аккаунта. Это просто!

Зарегистрировать аккаунт

Войти

Уже зарегистрированы? Войдите здесь.

Войти сейчас

×
×
  • Создать...

Важная информация

Используя этот сайт, вы автоматически обязуетесь соблюдать наши Правила и Политика конфиденциальности.
Чтобы сделать этот веб-сайт лучше, мы разместили cookies на вашем устройстве. Вы можете изменить свои настройки cookies, в противном случае мы будем считать, что вы согласны с этим.

Поддержка