Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // Note: this model config is created with 4-space [tab] symbols. If you use different settings, the structure may not be as clear.
- class CfgSkeletons
- {
- class Default
- {
- isDiscrete = 1;
- skeletonInherit = "";
- skeletonBones[] = {};
- };
- // Skeleton of undamaged variant of the house, containing doors and windows. Note that glass #3 is not a window but the glass pane of glass door (door #1). Therefore
- // (similar to door handles) it's bones need to be appropriately linked to bones of the door so that it moves along with it when the door is opened/closed.
- class m_bat_entreprise_skeleton: Default
- {
- skeletonInherit = "Default";
- skeletonBones[] =
- {
- // Pairs: 1st is newly defined bone, second is it`s "parent" in the skeleton (bone hierarchy).
- "Door_1", "",
- "Door_2", "",// Same goes for the axis around which rotates the handle itself.
- "Door_3", "",
- "Door_4", "",
- "Door_5", "",
- "Door_6", "",
- "Door_7", "",
- "Door_8", ""
- };
- };
- // Skeleton of damaged variant of the house. It has no bones for windows (since all windows are destroyed); on the other hand it has bones for destroyable parts (Dam_#) and their rubble (Unhide_#).
- // Doors are bound to these destroyable parts of they are part of them, so that they are hidden together by one animation.
- class m_bat_entreprise_dam_F_skeleton: Default
- {
- skeletonInherit = "Default";
- skeletonBones[] =
- {
- "Door_1", "",
- "Door_2", "",
- "Door_3", "",
- "Door_4", "",
- "Door_5", "",
- "Door_6", "",
- "Door_7", "",
- "Door_8", ""
- };
- };
- };
- class CfgModels
- {
- class Default
- {
- sectionsInherit = "";
- sections[] = {};
- skeletonName = "";
- };
- class m_bat_entreprise: Default // class name must be the same as name of p3d
- {
- skeletonName = "m_bat_entreprise_skeleton"; // Set to use above defined skeleton.
- sections[] =
- {
- // Selections from the model that are used in config.cpp for switching textures and materials.
- "DamT_1",
- "Glass_1_hide",
- "Glass_2_hide",
- "Glass_3_hide",
- "Glass_4_hide",
- "Glass_5_hide",
- "Glass_6_hide",
- "Glass_7_hide",
- "Glass_8_hide"
- };
- sectionsInherit = "";
- class Animations
- {
- // Animation for rotating door #1 (without a door handle)
- class Door_1_rot
- {
- type = rotation;
- source = Door_1_source; // Controler defined in class AnimationSources in config.cpp.
- selection = Door_1; // Selection from p3d that also has to be defined as a bone in this model`s skeleton.
- axis = Door_1_axis; // Axis of the rotation.
- memory = 1;
- minValue = 0; // Value of the controller at which the rotation will be angle0
- maxValue = 1; // Value of the controller at which the rotation will be angle1
- angle0 = 0;
- angle1 = (rad 90); // "rad" converts from degrees to radians
- };
- // Animation for door #2 (with a door handle). Note that when door is being closed, the animations run in reverse.
- class Door_2_rot: Door_1_rot
- {
- source = Door_2_source;
- selection = Door_2;
- axis = Door_2_axis;
- minValue = 0.1; // Rotation of door starts at 0.1 instead of 0, because from 0 to 0.1 the handle is pressed down.
- angle1 = (rad 90);
- };
- // Animation for door #3
- class Door_3_rot: Door_1_rot
- {
- source = Door_3_source;
- selection = Door_3;
- axis = Door_3_axis;
- minValue = 0.1;
- angle1 = (rad 90);
- };
- // Animation for door #4
- class Door_4_rot: Door_1_rot
- {
- source = Door_4_source;
- selection = Door_4;
- axis = Door_4_axis;
- minValue = 0.1;
- angle1 = (rad 95);
- };
- // Animation for door #5
- class Door_5_rot: Door_1_rot
- {
- source = Door_5_source;
- selection = Door_5;
- axis = Door_5_axis;
- minValue = 0.1;
- angle1 = (rad 95);
- };
- // Animation for door #6
- class Door_6_rot: Door_1_rot
- {
- source = Door_6_source;
- selection = Door_6;
- axis = Door_6_axis;
- minValue = 0.1;
- angle1 = (rad 95);
- };
- // Animation for door #7
- class Door_7_rot: Door_1_rot
- {
- source = Door_7_source;
- selection = Door_7;
- axis = Door_7_axis;
- minValue = 0.1;
- angle1 = -(rad 95);
- };
- class Door_8_rot: Door_1_rot
- {
- source = Door_8_source;
- selection = Door_8;
- axis = Door_8_axis;
- minValue = 0.1;
- angle1 = (rad 95);
- };
- };
- };
- };
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement