Jump to content
Search In
  • More options...
Find results that contain...
Find results in...
  • Need help?

    Create a topic in the appropriate section
    Don't write everything in the chat!
  • Take a look at the marketplace

    There you can buy
    everything related to game servers
  • Don't want a ban?

    Please read our rules
    Don't disturb the order!
  • Sell or buy?

    Use services of the guarantor
    We will make your deal safe
  • 0
Verum

Крафт

Вообщем на основе обычных тряпок сделал свои.
Изменено только Название и текстура.
Как и в дефолтных тряпках  стоит InventorySlot "Rags"

При этом, тряпки не вставляются в костёр.

class RagDirty : Rag {
		scope = public;
		displayName = "Грязная тряпка";
		descriptionShort = "Кусок грязной ткани. В экстренном случае можно использовать для остановки кровотечения, но есть шанс подхватить инфекцию.";
		model = "\dz\gear\consumables\Rags.p3d";
		itemSize[] = {1, 2};
		inventorySlot = "Rags";
		ChangeInventorySlot[] = {"Mask"};
		ChangeIntoOnAttach[] = {"", "MouthRag"};
		weight = 20;
		absorbency = 1;
		canBeSplit = 1;
		varQuantityInit = 6;
		varQuantityMin = 0;
		varQuantityMax = 6;
		varQuantityDestroyOnMin = 1;
		repairableWithKits[] = {5, 2};
		repairCosts[] = {30, 25};
		rotationFlags = 17;
		hiddenSelections[] = {"zbytek"};
		hiddenSelectionsTextures[] = {"\ResidentEvil\textures\Rag\dirty_rag.paa", "\ResidentEvil\textures\Rag\dirty_rag.paa", "\ResidentEvil\textures\Rag\dirty_rag.paa"};
		
		class DamageSystem {
			class GlobalHealth {
				class Health {
					hitpoints = 50;
					healthLevels[] = {{1, {"DZ\gear\consumables\data\rags_bandages.rvmat"}}, {0.7, {"DZ\gear\consumables\data\rags_bandages.rvmat"}}, {0.5, {"DZ\gear\consumables\data\rags_bandages_damage.rvmat"}}, {0.3, {"DZ\gear\consumables\data\rags_bandages_damage.rvmat"}}, {0, {"DZ\gear\consumables\data\rags_bandages_destruct.rvmat"}}};
				};
			};
		};
	};

А вот код костра...

class Fireplace : FireplaceBase {
		scope = public;
		displayName = "$STR_CfgVehicles_Fireplace0";
		descriptionShort = "$STR_CfgVehicles_Fireplace1";
		model = "\dz\gear\cooking\Fireplace.p3d";
		overrideDrawArea = 8.0;
		slopeTolerance = 0.3;
		physLayer = "item_large";
		openable = 0;
		lootCategory = "Crafted";
		itemSize[] = {4, 4};
		itemsCargoSize[] = {10, 4};
		useEntityHierarchy = "true";
		attachments[] = {"Firewood", "WoodenStick", "CookingEquipment", "Rags", "MedicalBandage", "Paper", "Bark", "CookingTripod", "Stones", "DirectCookingA", "DirectCookingB", "DirectCookingC", "SmokingA", "SmokingB", "SmokingC", "SmokingD"};
		
		class GUIInventoryAttachmentsProps {
			class CookingEquipment {
				name = "$STR_attachment_CookingEquipment0";
				description = "";
				attachmentSlots[] = {"CookingTripod", "CookingEquipment"};
				icon = "cat_fp_cooking";
				view_index = 1;
			};
			
			class Smoking {
				name = "$STR_attachment_Smoking";
				description = "";
				attachmentSlots[] = {"SmokingA", "SmokingB", "SmokingC", "SmokingD"};
				icon = "cookingequipment";
				view_index = 2;
			};
			
			class DirectCooking {
				name = "$STR_attachment_CookingEquipment0";
				description = "";
				attachmentSlots[] = {"DirectCookingA", "DirectCookingB", "DirectCookingC"};
				icon = "cookingequipment";
				view_index = 3;
			};
			
			class Upgrade {
				name = "$STR_attachment_Upgrade0";
				description = "";
				attachmentSlots[] = {"Stones"};
				icon = "cat_fp_upgrade";
				view_index = 4;
			};
			
			class Fuel {
				name = "$STR_attachment_Fuel0";
				description = "";
				attachmentSlots[] = {"Firewood", "WoodenStick"};
				icon = "cat_fp_fuel";
				view_index = 5;
			};
			
			class Kindling {
				name = "$STR_attachment_Kindling0";
				description = "";
				attachmentSlots[] = {"Rags", "MedicalBandage", "Paper", "Bark"};
				icon = "cat_fp_kindling";
				view_index = 6;
			};
		};
		hiddenSelections[] = {"ashes", "inventory"};
		hiddenSelectionsTextures[] = {"\dz\gear\cooking\data\stoneground_co.paa", "\dz\gear\cooking\data\fireplacekit_co.paa"};
		hiddenSelectionsMaterials[] = {"\dz\gear\cooking\data\stonegroundnoemit.rvmat", "\dz\gear\cooking\data\fireplacekit.rvmat"};
		hologramMaterial = "FireplaceKit";
		hologramMaterialPath = "dz\gear\cooking\data";
	};

Всю голову сломал почему не вставляются, если InventorySlot стоит и там и там Rags.

Прошу помочь.

Edited by Verum (see edit history)

Share this post


Link to post
Share on other sites

8 answers to this question

Recommended Posts

  • 0

Решение 

1. Моддим костер:
 

modded class FireplaceBase extends ItemBase
{    
    typename ATTACHMENT_CLEANRAGS             = RagClean;
    typename ATTACHMENT_DIRTYRAGS             = RagDirty;
    
    override void EEInit()
    {
        super.EEInit();
        
        //refresh visual on init
        RefreshFireplaceVisuals();
        
        m_FireConsumableTypes.Insert( ATTACHMENT_CLEANRAGS,     new FireConsumableType( ATTACHMENT_CLEANRAGS,         14,     true,    "Rags" ) );
        m_FireConsumableTypes.Insert( ATTACHMENT_DIRTYRAGS,     new FireConsumableType( ATTACHMENT_DIRTYRAGS,         14,     true,    "Rags" ) );
    }
}

2. Моддим сам предмет,  который хотим "сжигать", в данном примере - тряпка грязная
 

class RagDirty extends Rag
{
    void RagDirty()
    {

    }
    
    override bool CanPutAsAttachment( EntityAI parent )
    {
        if(!super.CanPutAsAttachment(parent))
        {
            return false;
        }
        if(GetQuantity() > 1 && PlayerBase.Cast(parent))
        {
            return false;
        }
        return true;
    }
    
    override bool HasFlammableMaterial()
    {
        return true;
    }
    
    override bool CanBeIgnitedBy( EntityAI igniter = NULL )
    {
        if ( GetHierarchyParent() ) return false;
        
        return true;
    }
    
    override bool CanIgniteItem( EntityAI ignite_target = NULL )
    {
        return false;
    }
    
    override void OnIgnitedTarget( EntityAI ignited_item )
    {
    }
    
    override void OnIgnitedThis( EntityAI fire_source )
    {
        Fireplace.IgniteEntityAsFireplace( this, fire_source );
    }

    override bool IsThisIgnitionSuccessful( EntityAI item_source = NULL )
    {
        return Fireplace.CanIgniteEntityAsFireplace( this );
    }
}

3. Ну и не забываем про аттачменты в конфиг.cpp

Share this post


Link to post
Share on other sites



  • 0

в attachments[] у костра вставил свои новые тряпки?

Share this post


Link to post
Share on other sites
  • 0
15 минут назад, 123new сказал:

в attachments[] у костра вставил свои новые тряпки?

У костра в аттачментс стоит класс слотов "Rags", как у моих и дефолтных тряпок... не работает...

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

Share this post


Link to post
Share on other sites
  • 0
21 минуту назад, 123new сказал:

в attachments[] у костра вставил свои новые тряпки?

У костра:

attachments[] = {"Firewood", "WoodenStick", "CookingEquipment", "Rags", "MedicalBandage", "Paper", "Bark", "CookingTripod", "Stones", "DirectCookingA", "DirectCookingB", "DirectCookingC", "SmokingA", "SmokingB", "SmokingC", "SmokingD"};
class Kindling { name = "$STR_attachment_Kindling0"; description = ""; attachmentSlots[] = {"Rags", "MedicalBandage", "Paper", "Bark"}; icon = "cat_fp_kindling"; view_index = 6; };


У дефолтных трапок и моих тряпок:
 

inventorySlot = "Rags";

 

Edited by Verum (see edit history)

Share this post


Link to post
Share on other sites
  • 0
24 минуты назад, Verum сказал:

Проблема решена. Спасибо @thessend

укажи хоть решение, полюбому кто-то искать будет еще

Share this post


Link to post
Share on other sites
  • 0

Уже не первый раз так. Проблема решена, а способ решения почему-то указать сложно. Уже вторую тему с нужной мне информацией по моей проблеме нахожу, но вот решением никто делиться не хочет. 

 

Share this post


Link to post
Share on other sites
  • 0

@AlAzrael Читать вы конечно тему не хотите, вас ткнуть нужно ? Тут решение описано как бэ..

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×
×
  • Create New...

Important Information

By using this site, you automaticly agree to our Guidelines and Privacy Policy.
We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.