Untitled

Anonymous
plain_text
02/20/2026 9:45 AM
8.1 KB
15
Indexable
/* This is a sample of a house with two stage destruction (a damaged version and a ruin), two destructible parts, five doors and eight windows */

//autor: Harti2000
//webseite: 



class CfgVehicles
{
    class House_F;

    class harti_rac_garage_F : House_F
	{
		scope = 2; // 2 = public = shown in editor
		displayName = "RAC Garage"; // Name in editor
		model = "\Harti_Fraktionen\RAC\Garage\harti_rac_garage.p3d"; // Path to model
		picture = "";
		Icon = "";
		mapSize = 4; // Scale of icon in editor
		cost = 100; // Score penalty for destroying the house
		editorCategory = "HARTI_FRK";
		editorSubcategory = "HARTI_RAC";
		armor = 5000;

		class AnimationSources

		{
			// Animation sources for doors
			
			class Gate_1_source {
				source = "user"; // "user" = custom source = not controlled by some engine value
				initPhase = 0; // Initial value of animations based on this source
				animPeriod 	= 1;
				sound 		= "RollDoorsSound";
			};
			class Gate_2_source : Gate_1_source {};
			class Gate_3_source : Gate_1_source {};
			class Gate_4_source : Gate_1_source {};
			class Gate_5_source : Gate_1_source {};
			class Gate_6_source : Gate_1_source {};
			



		};
		// This section defined custom actions for action menu. Each class defined here represent one action. Here we have Open+Close pairs of action for each door (1-5)
		class UserActions
		{		
			//----------------------------------NEW GATES--------------------------
			class OpenGate_1
			{
				displayNameDefault = "<img image='\A3\Ui_f\data\IGUI\Cfg\Actions\open_door_ca.paa' size='2.5' />";
				displayName = "Open Gate 1";
				position = "Gate_1_trigger";
				priority = 0.4; // Priority coefficient used for sorting action in the action menu.
				radius = 1.5; //
				onlyForPlayer = false; 
				condition= (("Harticards_Card_Police" in items player) && ((this animationSourcePhase "Gate_1_source") < 0.5) && (this getVariable ["bis_disabled_door_15",0]) == 0);
				statement = (this animateSource ["Gate_1_source", 4.5]);
			};
			class CloseGate_1: OpenGate_1
			{
				displayName ="$STR_DN_OUT_C_DOOR";
				condition = (("Harticards_Card_Police" in items player) && ((this animationSourcePhase "Gate_1_source") > 0.5) && (this getVariable ["bis_disabled_door_15",0]) == 0);
				statement = (this animateSource ["Gate_1_source", 0]);
			};
			
			class OpenGate_2: OpenGate_1
			{
				displayName = "Open Gate 2";
				position = "Gate_2_trigger";
				condition= (("Harticards_Card_Police" in items player) && ((this animationSourcePhase "Gate_2_source") < 0.5) && (this getVariable ["bis_disabled_door_16",0]) == 0);
				statement = (this animateSource ["Gate_2_source", 4.5]);
			};
			class CloseGate_2: OpenGate_2
			{
				displayName ="$STR_DN_OUT_C_DOOR";
				condition = (("Harticards_Card_Police" in items player) && ((this animationSourcePhase "Gate_2_source") > 0.5) && (this getVariable ["bis_disabled_door_16",0]) == 0);
				statement = (this animateSource ["Gate_2_source", 0]);
			};

			class OpenGate_3: OpenGate_1
			{
				displayName = "Open Gate 3";
				position = "Gate_3_trigger";
				actionNamedSel = "Gate_3_action";
				condition= (("Harticards_Card_Police" in items player) &&  ((this animationSourcePhase "Gate_3_source") < 0.5) && (this getVariable ["bis_disabled_door_17",0]) == 0);
				statement = (this animateSource ["Gate_3_source", 4.5]);
			};
			class CloseGate_3: OpenGate_3
			{
				displayName ="$STR_DN_OUT_C_DOOR";
				condition = (("Harticards_Card_Police" in items player) && ((this animationSourcePhase "Gate_3_source") > 0.5) && (this getVariable ["bis_disabled_door_17",0]) == 0);
				statement = (this animateSource ["Gate_3_source", 0]);
			};
			
			class OpenGate_4: OpenGate_1
			{
				displayName = "Open Gate 4";
				position = "Gate_4_trigger";
				condition= (("Harticards_Card_Police" in items player) &&  ((this animationSourcePhase "Gate_4_source") < 0.5) && (this getVariable ["bis_disabled_door_17",0]) == 0);
				statement = (this animateSource ["Gate_4_source", 4.5]);
			};
			class CloseGate_4: OpenGate_4
			{
				displayName ="$STR_DN_OUT_C_DOOR";
				condition = (("Harticards_Card_Police" in items player) && ((this animationSourcePhase "Gate_4_source") > 0.5) && (this getVariable ["bis_disabled_door_17",0]) == 0);
				statement = (this animateSource ["Gate_4_source", 0]);
			};
			
			class OpenGate_5: OpenGate_1
			{
				displayName = "Open Gate 5";
				position = "Gate_5_trigger";
				actionNamedSel = "Gate_5_action";
				condition= (("Harticards_Card_Police" in items player) &&  ((this animationSourcePhase "Gate_5_source") < 0.5) && (this getVariable ["bis_disabled_door_17",0]) == 0);
				statement = (this animateSource ["Gate_5_source", 4.5]);
			};
			class CloseGate_5: OpenGate_5
			{
				displayName ="$STR_DN_OUT_C_DOOR";
				condition = (("Harticards_Card_Police" in items player) && ((this animationSourcePhase "Gate_5_source") > 0.5) && (this getVariable ["bis_disabled_door_17",0]) == 0);
				statement = (this animateSource ["Gate_5_source", 0]);
			};
			
			class OpenGate_6: OpenGate_1
			{
				displayName = "Open Gate 6";
				position = "Gate_6_trigger";
				actionNamedSel = "Gate_6_action";
				condition= (("Harticards_Card_Police" in items player) &&  ((this animationSourcePhase "Gate_6_source") < 0.5) && (this getVariable ["bis_disabled_door_17",0]) == 0);
				statement = (this animateSource ["Gate_6_source", 4.5]);
			};
			class CloseGate_6: OpenGate_6
			{
				displayName ="$STR_DN_OUT_C_DOOR";
				condition = (("Harticards_Card_Police" in items player) && ((this animationSourcePhase "Gate_6_source") > 0.5) && (this getVariable ["bis_disabled_door_17",0]) == 0);
				statement = (this animateSource ["Gate_6_source", 0]);
			};
			
			
		};
		// Here are references binding specific positions in Path lod in p3d to specific actions from "class UserActions" for AI to know when to use which doors. The actionBegin# and ActionEnd# is a hardcoded naming system.
		// Amount of doors of this house; a parameter for easy processing of all doors on different houses by scripts.
		numberOfDoors = 0;
	};
};
Editor is loading...
Leave a Comment