Advertisement
Guest User

Untitled

a guest
Jul 15th, 2019
95
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 12.26 KB | None | 0 0
  1. // Note: this model config is created with 4-space [tab] symbols. If you use different settings, the structure may not be as clear.
  2. class CfgSkeletons
  3. {
  4. class Default
  5. {
  6. isDiscrete = 1;
  7. skeletonInherit = "";
  8. skeletonBones[] = {};
  9. };
  10.  
  11. // 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
  12. // (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.
  13. class Hopital_Zoko_1_skeleton: Default
  14. {
  15. skeletonInherit = "Default";
  16. skeletonBones[] =
  17. {
  18. // Pairs: 1st is newly defined bone, second is it`s "parent" in the skeleton (bone hierarchy).
  19. "Door_1", "",
  20.  
  21. "Door_2", "",
  22. "Door_Handle_2", "Door_2", // Door handle is linked to the door itself so that it moves with the door when the door is opened or closed.
  23. "Door_Handle_2_axis", "Door_2", // Same goes for the axis around which rotates the handle itself.
  24.  
  25. "Door_3", "",
  26. "Door_Handle_3", "Door_3",
  27. "Door_Handle_3_axis", "Door_3",
  28.  
  29. "Door_4", "",
  30. "Door_Handle_4", "Door_4",
  31. "Door_Handle_4_axis", "Door_4",
  32.  
  33. "Door_5", "",
  34. "Door_Handle_5", "Door_5",
  35. "Door_Handle_5_axis", "Door_5",
  36.  
  37. "Glass_1_hide", "",
  38. "Glass_1_unhide", "",
  39.  
  40. "Glass_2_hide", "",
  41. "Glass_2_unhide", "",
  42.  
  43. "Glass_3", "Door_1",
  44. "Glass_3_hide", "Door_1",
  45. "Glass_3_unhide", "Door_1",
  46. "Glass_3_effects", "Door_1",
  47.  
  48. "Glass_4_hide", "",
  49. "Glass_4_unhide", "",
  50.  
  51. "Glass_5_hide", "",
  52. "Glass_5_unhide", "",
  53.  
  54. "Glass_6_hide", "",
  55. "Glass_6_unhide", "",
  56.  
  57. "Glass_7_hide", "",
  58. "Glass_7_unhide", "",
  59.  
  60. "Glass_8_hide", "",
  61. "Glass_8_unhide", ""
  62. };
  63. };
  64.  
  65. // 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_#).
  66. // Doors are bound to these destroyable parts of they are part of them, so that they are hidden together by one animation.
  67. class Test_House_01_dam_F_skeleton: Default
  68. {
  69. skeletonInherit = "Default";
  70. skeletonBones[] =
  71. {
  72. "Dam_1", "",
  73. "Unhide_1", "",
  74.  
  75. "Dam_2", "",
  76. "Unhide_2", "",
  77.  
  78. "Door_1", "Dam_2",
  79.  
  80. "Door_2", "Dam_2",
  81. "Door_Handle_2", "Door_2",
  82. "Door_Handle_2_axis", "Door_2",
  83.  
  84. "Door_3", "",
  85. "Door_Handle_3", "Door_3",
  86. "Door_Handle_3_axis", "Door_3",
  87.  
  88. "Door_4", "Dam_1",
  89. "Door_Handle_4", "Door_4",
  90. "Door_Handle_4_axis", "Door_4",
  91.  
  92. "Door_5", "",
  93. "Door_Handle_5", "Door_5",
  94. "Door_Handle_5_axis", "Door_5"
  95. };
  96. };
  97. };
  98.  
  99. class CfgModels
  100. {
  101. class Default
  102. {
  103. sectionsInherit = "";
  104. sections[] = {};
  105. skeletonName = "";
  106. };
  107.  
  108. class Hopital_Zoko_1: Default // class name must be the same as name of p3d
  109. {
  110. skeletonName = "Hopital_Zoko_1_skeleton"; // Set to use above defined skeleton.
  111. sections[] =
  112. {
  113. // Selections from the model that are used in config.cpp for switching textures and materials.
  114. "DamT_1",
  115. "Glass_1_hide",
  116. "Glass_2_hide",
  117. "Glass_3_hide",
  118. "Glass_4_hide",
  119. "Glass_5_hide",
  120. "Glass_6_hide",
  121. "Glass_7_hide",
  122. "Glass_8_hide"
  123. };
  124. sectionsInherit = "";
  125. class Animations
  126. {
  127. // Animation for rotating door #1 (without a door handle)
  128. class Door_1_rot
  129. {
  130. type = rotation;
  131. source = Door_1_source; // Controler defined in class AnimationSources in config.cpp.
  132. selection = Door_1; // Selection from p3d that also has to be defined as a bone in this model`s skeleton.
  133. axis = Door_1_axis; // Axis of the rotation.
  134. memory = 1;
  135. minValue = 0; // Value of the controller at which the rotation will be angle0
  136. maxValue = 1; // Value of the controller at which the rotation will be angle1
  137. angle0 = 0;
  138. angle1 = (rad 110); // "rad" converts from degrees to radians
  139. };
  140.  
  141. // Animation for door #2 (with a door handle). Note that when door is being closed, the animations run in reverse.
  142. class Door_2_rot: Door_1_rot
  143. {
  144. source = Door_2_source;
  145. selection = Door_2;
  146. axis = Door_2_axis;
  147. minValue = 0.1; // Rotation of door starts at 0.1 instead of 0, because from 0 to 0.1 the handle is pressed down.
  148. angle1 = -(rad 120);
  149. };
  150. class Door_Handle_2_rot_1: Door_2_rot
  151. {
  152. selection = Door_Handle_2;
  153. axis = Door_Handle_2_axis;
  154. minValue = 0;
  155. maxValue = 0.1;
  156. angle1 = -(rad 50); // Press handle down
  157. };
  158. class Door_Handle_2_rot_2: Door_Handle_2_rot_1
  159. {
  160. minValue = 0.1;
  161. maxValue = 0.4;
  162. angle1 = (rad 50); // Release handle to go up
  163. };
  164.  
  165. // Animation for door #3
  166. class Door_3_rot: Door_1_rot
  167. {
  168. source = Door_3_source;
  169. selection = Door_3;
  170. axis = Door_3_axis;
  171. minValue = 0.1;
  172. angle1 = (rad 110);
  173. };
  174. class Door_Handle_3_rot_1: Door_3_rot
  175. {
  176. selection = Door_Handle_3;
  177. axis = Door_Handle_3_axis;
  178. minValue = 0;
  179. maxValue = 0.1;
  180. angle1 = -(rad 50);
  181. };
  182. class Door_Handle_3_rot_2: Door_Handle_3_rot_1
  183. {
  184. minValue = 0.1;
  185. maxValue = 0.4;
  186. angle1 = (rad 50);
  187. };
  188.  
  189. // Animation for door #4
  190. class Door_4_rot: Door_1_rot
  191. {
  192. source = Door_4_source;
  193. selection = Door_4;
  194. axis = Door_4_axis;
  195. minValue = 0.1;
  196. angle1 = -(rad 140);
  197. };
  198. class Door_Handle_4_rot_1: Door_4_rot
  199. {
  200. selection = Door_Handle_4;
  201. axis = Door_Handle_4_axis;
  202. minValue = 0;
  203. maxValue = 0.1;
  204. angle1 = -(rad 50);
  205. };
  206. class Door_Handle_4_rot_2: Door_Handle_4_rot_1
  207. {
  208. minValue = 0.1;
  209. maxValue = 0.4;
  210. angle1 = (rad 50);
  211. };
  212.  
  213. // Animation for door #5
  214. class Door_5_rot: Door_1_rot
  215. {
  216. source = Door_5_source;
  217. selection = Door_5;
  218. axis = Door_5_axis;
  219. minValue = 0.1;
  220. angle1 = -(rad 110);
  221. };
  222. class Door_Handle_5_rot_1: Door_5_rot
  223. {
  224. selection = Door_Handle_5;
  225. axis = Door_Handle_5_axis;
  226. minValue = 0;
  227. maxValue = 0.1;
  228. angle1 = -(rad 50);
  229. };
  230. class Door_Handle_5_rot_2: Door_Handle_5_rot_1
  231. {
  232. minValue = 0.1;
  233. maxValue = 0.4;
  234. angle1 = (rad 50);
  235. };
  236.  
  237. // Animations for window #1. One that hides faces of full glass pane when window is destroyed and second that shows faces with just shards of glass around the window frame when the window is destroyed.
  238. class Glass_1_hide
  239. {
  240. type = hide;
  241. source = Glass_1_source; // This source is defined in config.cpp and relates health of the window (0 = fine, 1 = destroyed)
  242. selection = Glass_1_hide; // Selection containing glass pane.
  243. minValue = 0;
  244. maxValue = 1;
  245. hideValue = 0.99999; // Threshold for switching the glass pane for glass shards.
  246. };
  247. class Glass_1_unhide: Glass_1_hide
  248. {
  249. selection = Glass_1_unhide; // Selection containing glass shards.
  250. hideValue = 0; // Glass shards are hidden when the window is ok...
  251. unhideValue = 0.99999; // ...and are shown when damage done to the window reaches set threshold.
  252. };
  253.  
  254. // Here follow animations for the rest of the windows, inherited from the first one.
  255. class Glass_2_hide: Glass_1_hide
  256. {
  257. source = Glass_2_source;
  258. selection = Glass_2_hide;
  259. };
  260. class Glass_2_unhide: Glass_1_unhide
  261. {
  262. source = Glass_2_source;
  263. selection = Glass_2_unhide;
  264. };
  265. class Glass_3_hide: Glass_1_hide
  266. {
  267. source = Glass_3_source;
  268. selection = Glass_3_hide;
  269. };
  270. class Glass_3_unhide: Glass_1_unhide
  271. {
  272. source = Glass_3_source;
  273. selection = Glass_3_unhide;
  274. };
  275. class Glass_4_hide: Glass_1_hide
  276. {
  277. source = Glass_4_source;
  278. selection = Glass_4_hide;
  279. };
  280. class Glass_4_unhide: Glass_1_unhide
  281. {
  282. source = Glass_4_source;
  283. selection = Glass_4_unhide;
  284. };
  285. class Glass_5_hide: Glass_1_hide
  286. {
  287. source = Glass_5_source;
  288. selection = Glass_5_hide;
  289. };
  290. class Glass_5_unhide: Glass_1_unhide
  291. {
  292. source = Glass_5_source;
  293. selection = Glass_5_unhide;
  294. };
  295. class Glass_6_hide: Glass_1_hide
  296. {
  297. source = Glass_6_source;
  298. selection = Glass_6_hide;
  299. };
  300. class Glass_6_unhide: Glass_1_unhide
  301. {
  302. source = Glass_6_source;
  303. selection = Glass_6_unhide;
  304. };
  305. class Glass_7_hide: Glass_1_hide
  306. {
  307. source = Glass_7_source;
  308. selection = Glass_7_hide;
  309. };
  310. class Glass_7_unhide: Glass_1_unhide
  311. {
  312. source = Glass_7_source;
  313. selection = Glass_7_unhide;
  314. };
  315. class Glass_8_hide: Glass_1_hide
  316. {
  317. source = Glass_8_source;
  318. selection = Glass_8_hide;
  319. };
  320. class Glass_8_unhide: Glass_1_unhide
  321. {
  322. source = Glass_8_source;
  323. selection = Glass_8_unhide;
  324. };
  325. };
  326. };
  327.  
  328. // This class represents the damage version. It has the same door animations, misses the window animations and has
  329. class Test_House_01_dam_F: Default
  330. {
  331. skeletonName = "Test_House_01_dam_F_skeleton"; // Uses skeleton for damage version.
  332. sections[] = {}; // No sections are needed at this stage.
  333. sectionsInherit = "";
  334. class Animations
  335. {
  336. // Animations for destructible parts. They are very similar to the glass animations above; only using different selections (= bones) and animation sources.
  337. class Hitzone_1_hide
  338. {
  339. type = hide;
  340. source = Hitzone_1_source;
  341. selection = Dam_1;
  342. minValue = 0;
  343. maxValue = 1;
  344. hideValue = 0.99999;
  345. };
  346. class Hitzone_1_unhide: Hitzone_1_hide
  347. {
  348. selection = Unhide_1;
  349. hideValue = 0;
  350. unhideValue = 0.99999;
  351. };
  352. class Hitzone_2_hide: Hitzone_1_hide
  353. {
  354. source = Hitzone_2_source;
  355. selection = Dam_2;
  356. };
  357. class Hitzone_2_unhide: Hitzone_2_hide
  358. {
  359. selection = Unhide_2;
  360. hideValue = 0;
  361. unhideValue = 0.99999;
  362. };
  363.  
  364. // Door animations, same as for the undamaged version of the house defined above.
  365. class Door_1_rot
  366. {
  367. type = rotation;
  368. source = Door_1_source;
  369. selection = Door_1;
  370. axis = Door_1_axis;
  371. memory = 1;
  372. minValue = 0;
  373. maxValue = 1;
  374. angle0 = 0;
  375. angle1 = (rad 110);
  376. };
  377.  
  378. class Door_2_rot: Door_1_rot
  379. {
  380. source = Door_2_source;
  381. selection = Door_2;
  382. axis = Door_2_axis;
  383. minValue = 0.1;
  384. angle1 = -(rad 120);
  385. };
  386. class Door_Handle_2_rot_1: Door_2_rot
  387. {
  388. selection = Door_Handle_2;
  389. axis = Door_Handle_2_axis;
  390. minValue = 0;
  391. maxValue = 0.1;
  392. angle1 = -(rad 50);
  393. };
  394. class Door_Handle_2_rot_2: Door_Handle_2_rot_1
  395. {
  396. minValue = 0.1;
  397. maxValue = 0.4;
  398. angle1 = (rad 50);
  399. };
  400.  
  401. class Door_3_rot: Door_1_rot
  402. {
  403. source = Door_3_source;
  404. selection = Door_3;
  405. axis = Door_3_axis;
  406. minValue = 0.1;
  407. angle1 = (rad 110);
  408. };
  409. class Door_Handle_3_rot_1: Door_3_rot
  410. {
  411. selection = Door_Handle_3;
  412. axis = Door_Handle_3_axis;
  413. minValue = 0;
  414. maxValue = 0.1;
  415. angle1 = -(rad 50);
  416. };
  417. class Door_Handle_3_rot_2: Door_Handle_3_rot_1
  418. {
  419. minValue = 0.1;
  420. maxValue = 0.4;
  421. angle1 = (rad 50);
  422. };
  423.  
  424. class Door_4_rot: Door_1_rot
  425. {
  426. source = Door_4_source;
  427. selection = Door_4;
  428. axis = Door_4_axis;
  429. minValue = 0.1;
  430. angle1 = -(rad 140);
  431. };
  432. class Door_Handle_4_rot_1: Door_4_rot
  433. {
  434. selection = Door_Handle_4;
  435. axis = Door_Handle_4_axis;
  436. minValue = 0;
  437. maxValue = 0.1;
  438. angle1 = -(rad 50);
  439. };
  440. class Door_Handle_4_rot_2: Door_Handle_4_rot_1
  441. {
  442. minValue = 0.1;
  443. maxValue = 0.4;
  444. angle1 = (rad 50);
  445. };
  446.  
  447. class Door_5_rot: Door_1_rot
  448. {
  449. source = Door_5_source;
  450. selection = Door_5;
  451. axis = Door_5_axis;
  452. minValue = 0.1;
  453. angle1 = -(rad 110);
  454. };
  455. class Door_Handle_5_rot_1: Door_5_rot
  456. {
  457. selection = Door_Handle_5;
  458. axis = Door_Handle_5_axis;
  459. minValue = 0;
  460. maxValue = 0.1;
  461. angle1 = -(rad 50);
  462. };
  463. class Door_Handle_5_rot_2: Door_Handle_5_rot_1
  464. {
  465. minValue = 0.1;
  466. maxValue = 0.4;
  467. angle1 = (rad 50);
  468. };
  469. };
  470. };
  471. };
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement