Jump to content
Sign in to follow this  
six_ten

Open two doors simultaneously with one action

Recommended Posts

I'd like to combine the door open action for a pair of doors. I've followed some older threads with information about this, but keep getting errors when I try what they did. Can someone help me rewrite this so I can open and close the doors together? I based my building on the Test_House in Samples_F.

  class OpenDoor_1
  {
   displayNameDefault = "<img image='\A3\Ui_f\data\IGUI\Cfg\Actions\open_door_ca.paa' size='2.5' />"; 
// This is displayed in the center of the screen just below crosshair. In this case it's an icon, not a text.
   displayName = "Open Door"; 
// Label of the action used in the action menu itself.
   position = Door_1and2_trigger; 
// Point in Memory lod in p3d around which the action is available.
   priority = 0.4; 
// Priority coefficient used for sorting action in the action menu.
   radius = 2.5; 
// Range around the above defined point in which you need to be to access the action.
   onlyForPlayer = false; 
// Defines if the action is available only to players or AI as well.

   condition = ((this animationPhase 'Door_1_rot') < 0.5) && ((this animationPhase 'Hitzone_2_hide') < 0.99999); 
   // Condition for showing the action in action menu. In this case it checks if the door is closed and if the part of the house in which the door is located hasn't been destroyed yet).
   statement = ([this, 'Door_1_rot'] execVM "\ART\ART_Arch\Scripts\DoorNoHandle_open.sqf"); 
   // Action taken when this action is selected in the action menu. In this case it runs a script that opens the door.
  };
  class CloseDoor_1: OpenDoor_1
  {
   displayName = "Close Door";
   priority = 0.2;
   condition = ((this animationPhase 'Door_1_rot') >= 0.5) && ((this animationPhase 'Hitzone_2_hide') < 0.99999); 
// Checks if the door is currently open and not destroyed.
   statement = ([this, 'Door_1_rot'] execVM "\ART\ART_Arch\Scripts\DoorNoHandle_close.sqf");
  };
  class OpenDoor_2: OpenDoor_1
  {
   position = Door_1and2_trigger;
   condition = ((this animationPhase 'Door_2_rot') < 0.5) && ((this animationPhase 'Hitzone_2_hide') < 0.99999);
   statement = ([this, 'Door_2_rot'] execVM "\ART\ART_Arch\Scripts\DoorNoHandle_open.sqf");
  };
  class CloseDoor_2: CloseDoor_1
  {
   position = Door_1and2_trigger;
   condition = ((this animationPhase 'Door_2_rot') >= 0.5) && ((this animationPhase 'Hitzone_2_hide') < 0.99999);
   statement = ([this, 'Door_2_rot'] execVM "\ART\ART_Arch\Scripts\DoorNoHandle_close.sqf");
  };

Share this post


Link to post
Share on other sites

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now
Sign in to follow this  

×