From 69c6d0a373202f77ae2ab84bef9ce63104180b41 Mon Sep 17 00:00:00 2001 From: alganthe Date: Mon, 24 Aug 2015 12:13:24 +0200 Subject: [PATCH] sitting framework --- documentation/framework/sitting-framework.md | 47 ++++++++++++++++++++ 1 file changed, 47 insertions(+) create mode 100644 documentation/framework/sitting-framework.md diff --git a/documentation/framework/sitting-framework.md b/documentation/framework/sitting-framework.md new file mode 100644 index 0000000000..c707671c84 --- /dev/null +++ b/documentation/framework/sitting-framework.md @@ -0,0 +1,47 @@ +--- +layout: wiki +title: Sitting framework +description: +group: framework +order: 5 +parent: wiki +--- + +## 1. adding sitting support to a chair + +```c++ +class CfgVehicles { + + #define MACRO_SEAT_ACTION \ // better use a macro, nobody wants to type this two times or more, right ? + class ACE_Actions { \ + class ACE_MainActions { \ + displayName = "$STR_ACE_Interaction_MainAction"; \ + selection = ""; \ + distance = 1.5; \ + condition = "true"; \ + class ACE_sitting_Sit { \ + displayName = "$STR_ACE_Sitting_Sit"; \ + condition = "_this call ace_sitting_fnc_canSit"; \ + statement = "_this call ace_sitting_fnc_sit"; \ + showDisabled = 0; \ + priority = 0; \ + icon = "z\ace\sitting\UI\sit_ca.paa"; \ + }; \ + }; \ + }; + + class ThingX; // base class for objects + + class yourChair: ThingX { // your chair class + XEH_ENABLED; // enable XEH on that object class + MACRO_SEAT_ACTION // add the interaction + ACE_sitting_canSit = 1; // enable sitting + ACE_sitting_sitDirection = 180; // sitting direction in degrees + ACE_sitting_sitPosition[] = {0, -0.1, -0.45}; // sitting position in a X Y Z plane + ACE_sitting_sitRotation = 10; // maximum rotation possible in degrees, left and right. + }; +}; +``` + +- No escape possible here, you'll have to fiddle with the position direction and rotation to have a normal pose. +- For the sitRotation 10 is use for chairs with arms, 45 for the ones without.