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
Olmaris

Вопрос нуба: Помощь в модификации класса

Есть такой мод MoreDoors, автор разрешает его репак и модификацию, возникло желание запретить вешать CodeLock (разрешить только велосипедные замки), на одну из дверей, а именно ShantyDoor, для этого клонирую class MoreDoorBase:

	class MoreDoorBase1 : Fence {
		scope = private;
		displayName = "Door";
		descriptionShort = "$STR_CfgVehicles_Fence1";
		bounding = "BSphere";
		overrideDrawArea = 3.0;
		forceFarBubble = "true";
		handheld = "false";
		lootCategory = "Crafted";
		carveNavmesh = 1;
		weight = 10000;
		itemSize[] = {2, 3};
		hiddenSelections[] = {"door1", "door2", "door3", "door4"};
		physLayer = "item_large";
		createProxyPhysicsOnInit = "false";
		createdProxiesOnInit[] = {"Deployed"};
		rotationFlags = 2;
		
		class DamageSystem {
			class GlobalHealth {
				class Health {
					hitpoints = 100;
					healthLevels[] = {{1, {""}}, {0.7, {""}}, {0.5, {""}}, {0.3, {""}}, {0, {""}}};
				};
			};
			
			class GlobalArmor {
				class Projectile {
					class Health {
						damage = 0;
					};
					
					class Blood {
						damage = 0;
					};
					
					class Shock {
						damage = 0;
					};
				};
				
				class Melee {
					class Health {
						damage = 0;
					};
					
					class Blood {
						damage = 0;
					};
					
					class Shock {
						damage = 0;
					};
				};
				
				class FragGrenade {
					class Health {
						damage = 0;
					};
					
					class Blood {
						damage = 0;
					};
					
					class Shock {
						damage = 0;
					};
				};
			};
		};
		attachments[] = {"Att_CombinationLock"};
		
		class GUIInventoryAttachmentsProps {
			class Base {
				name = "$STR_CfgVehicles_Fence_Att_Category_Base";
				description = "";
				attachmentSlots[] = {"Att_CombinationLock"};
				icon = "cat_bb_base";
				selection = "wall";
			};
			
			class Attachments {
				name = "$STR_CfgVehicles_Fence_Att_Category_Attachments";
				description = "";
				attachmentSlots[] = {"Wall_Camonet", "Wall_Barbedwire_1", "Wall_Barbedwire_2"};
				icon = "cat_bb_attachments";
				selection = "wall";
			};
			
			class Material {
				name = "$STR_CfgVehicles_Fence_Att_Category_Materials";
				description = "";
				attachmentSlots[] = {"Material_Nails", "Material_WoodenPlanks", "Material_MetalSheets", "Material_MetalWire"};
				icon = "cat_bb_material";
				selection = "wall";
			};
		};
		
		class AnimationSources {
			class AnimSourceShown {
				source = "user";
				animPeriod = 0.01;
				initPhase = 0;
			};
			
			class AnimSourceHidden {
				source = "user";
				animPeriod = 0.01;
				initPhase = 1;
			};
			
			class AnimRotate {
				source = "user";
				component = "Door1";
				animPeriod = 1;
				initPhase = 0;
				initOpened = 0.5;
			};
			
			class Wall_Interact_Rotate : AnimRotate {};
			
			class Wall_Barbedwire_1_Mounted_Rotate : AnimRotate {};
			
			class Wall_Barbedwire_2_Mounted_Rotate : AnimRotate {};
			
			class Wall_Camonet_Rotate : AnimRotate {};
			
			class Wall_Gate_Rotate : AnimRotate {};
			
			class Wall_Base_Down_Rotate : AnimRotate {};
			
			class Wall_Base_Up_Rotate : AnimRotate {};
			
			class Wall_Wood_Down_Rotate : AnimRotate {};
			
			class Wall_Wood_Up_Rotate : AnimRotate {};
			
			class Wall_Metal_Down_Rotate : AnimRotate {};
			
			class Wall_Metal_Up_Rotate : AnimRotate {};
			
			class Material_WoodenLogs : AnimSourceHidden {};
			
			class Material_MetalWire : AnimSourceHidden {};
			
			class Wall_Barbedwire_1 : AnimSourceHidden {};
			
			class Wall_Barbedwire_1_Mounted : AnimSourceHidden {};
			
			class Wall_Barbedwire_2 : AnimSourceHidden {};
			
			class Wall_Barbedwire_2_Mounted : AnimSourceHidden {};
			
			class Wall_Camonet : AnimSourceHidden {};
			
			class Deployed : AnimSourceHidden {};
			
			class Base : AnimSourceHidden {};
			
			class Wall_Platform : AnimSourceHidden {};
			
			class Wall_Platform_Stairs_Left : AnimSourceHidden {};
			
			class Wall_Platform_Stairs_Right : AnimSourceHidden {};
			
			class Wall_Gate : AnimSourceHidden {};
			
			class Wall_Base_Down : AnimSourceHidden {};
			
			class Wall_Base_Up : AnimSourceHidden {};
			
			class Wall_Metal_Down : AnimSourceHidden {};
			
			class Wall_Metal_Up : AnimSourceHidden {};
			
			class Wall_Wood_Down : AnimSourceHidden {};
			
			class Wall_Wood_Up : AnimSourceHidden {};
		};
		
		class Construction {
			class wall {
				class wall_gate {
					name = "$STR_CfgVehicles_Construction_Part_Gate";
					is_gate = 1;
					id = 5;
					required_parts[] = {};
					conflicted_parts[] = {};
					collision_data[] = {};
					build_action_type = 1;
					dismantle_action_type = 1;
					material_type = 5;
				};
			};
		};
		
		class PointLights {
			class PointLight {
				color[] = {1, 1, 1, 0.05};
				ambient[] = {0.01, 0.01, 0.01, 0.01};
				position = "light";
				hitpoint = "bulb";
				selection = "bulb";
				size = 0;
				radius = 5;
				brightness = 0.001;
				dayLight = 1;
				heatHazeRadius = 0;
				heatHazePower = 0;
				fireEffect = 0;
				fireEffectOctaves = 0;
				fireEffectPersistence = 0;
				fireEffectFract = 0;
			};
		};
	};

 

Возникает вопрос, как в новом классе прописать только использование CombinationLock" и "Att_CombinationLock4"?

 

Подозреваю, что атач прописан строкой attachments[] = {"Att_CombinationLock"};, но что это за Att_CombinationLockне могу найти 😞

Share this post


Link to post
Share on other sites

1 answer to this question

Recommended Posts

  • 0

attachments[] = {"Att_CombinationLock"};
Это велосипедный замок на 3 или 4 цифры, а также CodeLock модовский все к одному слоту привязано.
Чтобы убрать аттач CodeLock достаточно про модифицировать скрипт CodeLock.c вместо оригинального кода сделать следующий. AddAction - добавляет действие, а RemoveAction убирает его полностью. Правда это будет работать для всех модовских и ванильных дверей, заборов, ворот и тд, то бишь глобально уберет действие крепежа CodeLock к таких предметам .
 

class CodeLock : ItemBase {
	 override void SetActions() {
        super.SetActions();

        AddAction(ActionAttachCodeLockToFence);
        AddAction(ActionAttachCodeLockToTent);
    }
}
modded class CodeLock : ItemBase {
	 override void SetActions() {
        super.SetActions();

        RemoveAction(ActionAttachCodeLockToFence);
        RemoveAction(ActionAttachCodeLockToTent);
    }
}


 

 

Edited by AKuznecov (see edit history)

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.