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

Силок на кролика

Починил дефолтный силок на кролика. Всё работает, кролики ловятся.
В тайпсах прописал время жизни силку сутки.
Однако, после рестарта силок пропадает.
Может кто подсказать причину?

Share this post


Link to post
Share on other sites

7 answers to this question

Recommended Posts

  • 0

а скинь что ты делал для починки, надо знать класс силка, его параметры, функции

Share this post


Link to post
Share on other sites



  • 0
4 минуты назад, 123new сказал:

а скинь что ты делал для починки, надо знать класс силка, его параметры, функции


class CfgVehicles {
	class Inventory_Base;
	class Edible_Base;	
	class Trap_Base;	
	class Trap_RabbitSnare : Trap_Base {};
	
	class RabbitSnareTrap : Trap_RabbitSnare {
		displayName = "Силок на кролика";
		descriptionShort = "Самодельная ловушка из деревянной палки и проволоки, позволяющая поймать мелкое животное.";
		weight = 140;
		itemSize[] = {2, 4};
		class DamageSystem
        {
            class GlobalHealth
            {
                class Health
                {
                    hitpoints=50;
                };
            };
        };
	};
	
	class RabbitSnareTrapR : RabbitSnareTrap {
		displayName = "Силок на кролика";
		descriptionShort = "Самодельная ловушка из деревянной палки и верёвки, позволяющая поймать мелкое животное. Менее надёжная ловушка, чем силок из проволоки, и на которую хуже ловится живность.";
		weight = 140;
		itemSize[] = {2, 4};
		class DamageSystem
        {
            class GlobalHealth
            {
                class Health
                {
                    hitpoints=20;
                };
            };
        };
	};

	class RabbitLegMeat : Edible_Base {
		displayName = "Мясо кролика";
		descriptionShort = "Кроличья лапка. Можно приготовить на костре или сварить.";
		weight = 45;
		varQuantityInit = 150;
		varQuantityMin = 0;
		varQuantityMax = 150;
		
		class AnimationSources : FoodAnimationSources {};
		
		class Food {
			class FoodStages {
				class Raw {
					visual_properties[] = {0, 0, 0};
					nutrition_properties[] = {1, 258, 169, 109, 1, 4};
					cooking_properties[] = {0, 0};
				};
				
				class Rotten {
					visual_properties[] = {-1, -1, 5};
					nutrition_properties[] = {1, 150, 338, 30, 1, 4 + 		  16};
					cooking_properties[] = {0, 0};
				};
				
				class Baked {
					visual_properties[] = {0, 1, 1};
					nutrition_properties[] = {1, 240, 92, 77, 1};
					cooking_properties[] = {70, 45};
				};
				
				class Boiled {
					visual_properties[] = {0, 2, 2};
					nutrition_properties[] = {1, 240, 92, 77, 1};
					cooking_properties[] = {70, 55};
				};
				
				class Dried {
					visual_properties[] = {0, 3, 3};
					nutrition_properties[] = {1, 190, 60, 75, 1};
					cooking_properties[] = {70, 45, 80};
				};
				
				class Burned {
					visual_properties[] = {0, 4, 4};
					nutrition_properties[] = {1, 50, 25, 20, 1, 16};
					cooking_properties[] = {100, 30};
				};
			};
			
			class FoodStageTransitions : MeatStageTransitions {};
		};
	};
};
modded class Trap_RabbitSnare
{
	void Trap_RabbitSnare()
	{
		m_InitWaitTime = 600 * Math.RandomInt( 3, 6 );
		m_DefectRate = 10;
		m_UpdateWaitTime = 1;
		m_BaitNeeded = false;
		m_IsFoldable = true;
		m_IsUsable = true;
		m_MinimalDistanceFromPlayersToCatch = 6;

		m_AnimationPhaseSet = "inventory";
		m_AnimationPhaseTriggered = "placing";
		m_AnimationPhaseUsed = "rabbit_snare_used";

		m_WaterSurfaceForSetup = false;

		m_SurfaceForSetup = new map<string, float>;
		m_SurfaceForSetup.Set("cp_concrete", 0 );
		m_SurfaceForSetup.Set("cp_dirt", 1 );
		m_SurfaceForSetup.Set("cp_broadleaf_dense1", 1 );
		m_SurfaceForSetup.Set("cp_broadleaf_dense2", 1 );
		m_SurfaceForSetup.Set("cp_broadleaf_sparse1", 1 );
		m_SurfaceForSetup.Set("cp_broadleaf_sparse2", 1 );
		m_SurfaceForSetup.Set("cp_conifer_common1", 1 );
		m_SurfaceForSetup.Set("cp_conifer_common2", 1 );
		m_SurfaceForSetup.Set("cp_conifer_moss1", 1 );
		m_SurfaceForSetup.Set("cp_conifer_moss2", 1 );
		m_SurfaceForSetup.Set("cp_grass", 1 );
		m_SurfaceForSetup.Set("cp_grass_tall", 1 );
		m_SurfaceForSetup.Set("cp_gravel", 1 );
		m_SurfaceForSetup.Set("cp_rock", 1 );
	
		m_CatchesPond = new multiMap<string, float>;
	
		m_CatchesSea = new multiMap<string, float>;

		m_CatchesGroundAnimal = new multiMap<string, float>; /* Min - Max */
				
		m_CatchesGroundAnimal.Insert("DeadRabbit",1);
		m_CatchesGroundAnimal.Insert("DeadRabbit",1);
		
		m_CatchesGroundAnimal.Insert("",1);
		m_CatchesGroundAnimal.Insert("",1);
	}
	override void AlignCatch( ItemBase obj, string catch_name )
	{	
		
	}
}

 

Share this post


Link to post
Share on other sites
  • 0

@123new Функции-функциями, но классовое имя у него остаётся.. и всё работает...А вот рестарт его забирает..

 

Share this post


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

@123new Функции-функциями, но классовое имя у него остаётся.. и всё работает...А вот рестарт его забирает..

 

попробуй в последний класс добавить такой код

P.S. не тестил, первый раз такое пробую

override void OnStoreSave( ParamsWriteContext ctx )
{   
	super.OnStoreSave( ctx );
	ctx.Write( m_IsActive );
}
	
override bool OnStoreLoad( ParamsReadContext ctx, int version )
{
	//Print("+-+OnStoreLoad");
	if ( !super.OnStoreLoad( ctx, version ) )
		return false;
	
	ctx.Read( m_IsActive );
	
	if (m_IsActive)
	{
		m_IsActive = false;
		SetActive();
	}
	else
	{
		m_IsActive = true;
		SetInactive();
	}		
	return true;
}

 

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.