Advertisement
Guest User

Untitled

a guest
Jul 15th, 2019
82
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 10.77 KB | None | 0 0
  1. #include "cfgPatches.hpp"
  2. #include "basicDefines_A3.hpp"
  3. #include "config_macros_glass.hpp"
  4.  
  5. class CfgVehicles
  6. {
  7. // Parent class declarations
  8. class House{};
  9. class House_F: House{};
  10. class Hopital_Zoko_1: House_F
  11. {
  12. scope = 2; // 2 = public = shown in editor
  13. displayName = "Hopital"; // Name in editor
  14. model = \hopital_zoko\Hopital_Zoko_1.p3d; // Path to model
  15.  
  16. vehicleClass = Structures; // category in editor; "Structures" value is a class defined in CfgVehicleClasses
  17. mapSize = 20.27; // Scale of icon in editor
  18. cost = 40000; // Score penalty for destroying the house
  19.  
  20. class HitPoints // Entities representing destructible subparts of the house
  21. {
  22. class Hitzone_1_hitpoint
  23. {
  24. armor = 20;
  25. material = -1;
  26. name = Dam_1; // Name of selection in Hit-points lod in p3d
  27. visual = DamT_1; // Name of selection in resolution lods in p3d that will have it's textures and materials switched (according to "class Damage definitions") based on damage of this hitpoint
  28. passThrough = 1.0; // Coefficient for how much damage done to this hitpoints is also done to total damage of the house
  29. radius = 0.375; // Radius of spheres around each vertex of this hitpoint in Hit-points lod. These spheres represent the volume from which this hitpoint takes damage
  30. convexComponent = Dam_1;
  31. explosionShielding = 50; // Multiplier for damage taken from explosives
  32. minimalHit = 0.001; // Minimal damage that can be dealt to the hitpoint. Any lower damage is ignored
  33.  
  34. class DestructionEffects //
  35. {
  36. class Dust
  37. {
  38. simulation = particles; // Visual effect
  39. type = HousePartDust; // Class of this particular effect, defined in CfgCloudlets
  40. position = Dam_1_effects; // Point of origin for this effect, defined in Memory lod in p3d
  41. intensity = 1;
  42. interval = 1;
  43. lifeTime = 0.01;
  44. };
  45. class Dust2: Dust
  46. {
  47. type = HousePartDustLong;
  48. };
  49. class Walls: Dust
  50. {
  51. type = HousePartWall;
  52. };
  53. class DamageAround
  54. {
  55. simulation = damageAround; // Effect dealing damage in a radius
  56. type = DamageAroundHousePart; // Class of this particular effect, defined in CfgDamageAround
  57. position = Dam_1_effects;
  58. intensity = 1;
  59. interval = 1;
  60. lifeTime = 1;
  61. };
  62. };
  63. };
  64. class Hitzone_2_hitpoint: Hitzone_1_hitpoint
  65. {
  66. name = Dam_2;
  67. convexComponent = Dam_2;
  68.  
  69. class DestructionEffects: DestructionEffects
  70. {
  71. class Dust: Dust
  72. {
  73. position = Dam_2_effects;
  74. };
  75. class Dust2: Dust2
  76. {
  77. position = Dam_2_effects;
  78. };
  79. class Walls: Walls
  80. {
  81. position = Dam_2_effects;
  82. };
  83. class DamageAround: DamageAround
  84. {
  85. position = Dam_2_effects;
  86. };
  87. };
  88. };
  89.  
  90. // Hitpoint of each window, defined using macros from config_macros_glass.hpp to avoid a giant wall of text due to having 14 particle effects each.
  91. // In practice they are defined in the same manner as the hitpoints above. These follow Glass_#_hitpoint naming trend.
  92. // First parameter being number id, second being a value for armor parameter and third being a value for radius parameter.
  93. BIG_GLASS_HITPOINT(1,0.01,0.175)
  94. BIG_GLASS_HITPOINT(2,0.01,0.175)
  95. DOOR_GLASS_HITPOINT(3,0.01,0.175)
  96. DOOR_GLASS_HITPOINT(4,0.01,0.175)
  97. DOOR_GLASS_HITPOINT(5,0.01,0.175)
  98. NORMAL_GLASS_HITPOINT(6,0.01,0.175)
  99. NORMAL_GLASS_HITPOINT(7,0.01,0.175)
  100. NORMAL_GLASS_HITPOINT(8,0.01,0.175)
  101. };
  102. class Damage
  103. {
  104. // Texture pairs (below 0.5 health and 0.5+) for switching visuals (can also use generated)
  105. tex[] =
  106. {
  107. // Window textures
  108. "A3\Structures_F\Data\Windows\window_set_CA.paa",
  109. "A3\Structures_F\Data\Windows\destruct_half_window_set_CA.paa",
  110.  
  111. // Grey color
  112. "#(argb,8,8,3)color(0.501961,0.501961,0.501961,1.0,co)",
  113. "#(argb,8,8,3)color(0.294118,0.294118,0.294118,1.0,co)",
  114.  
  115. // Brown color
  116. "#(argb,8,8,3)color(0.501961,0.25098,0,1.0,co)",
  117. "#(argb,8,8,3)color(0.392157,0.196078,0,1.0,co)",
  118.  
  119. // Yellow color
  120. "#(argb,8,8,3)color(1,1,0.501961,1.0,co)",
  121. "#(argb,8,8,3)color(0.513725,0.513725,0.203922,1.0,co)",
  122.  
  123. // Light grey color
  124. "#(argb,8,8,3)color(0.752941,0.752941,0.752941,1.0,co)",
  125. "#(argb,8,8,3)color(0.478431,0.478431,0.478431,1.0,co)",
  126.  
  127. // Red color
  128. "#(argb,8,8,3)color(1,0,0,1.0,co)",
  129. "#(argb,8,8,3)color(0.701961,0,0,1.0,co)"
  130. };
  131.  
  132. // Unlike textures, materials are not in pairs but in triplets (health: 0 - 0.49, 0.5 - 0.99, 1)
  133. mat[] =
  134. {
  135. "A3\Structures_F\Data\Windows\window_set.rvmat",
  136. "A3\Structures_F\Data\Windows\destruct_half_window_set.rvmat",
  137. "A3\Structures_F\Data\Windows\destruct_full_window_set.rvmat"
  138. };
  139. };
  140. class AnimationSources
  141. {
  142. // Animation sources for doors
  143. class Door_1_source
  144. {
  145. source = user; // "user" = custom source = not controlled by some engine value
  146. initPhase = 0; // Initial value of animations based on this source
  147. animPeriod = 1; // Coefficient for duration of change of this animation
  148. sound = "GenericDoorsSound"; /// Selects sound class from CfgAnimationSourceSounds that is going to be used for sounds of doors
  149. };
  150. class Door_2_source: Door_1_source {};
  151. class Door_3_source: Door_1_source {};
  152. class Door_4_source: Door_1_source {};
  153. class Door_5_source: Door_1_source {};
  154.  
  155. // Animation sources for windows
  156. class Glass_1_source
  157. {
  158. source = Hit; // "Hit" = value of this source is the health of an entity
  159. hitpoint = Glass_1; // Specifies health of what is the control value of this animation; "Glass_1_hitpoint" being the class defined in class Hitpoints
  160. raw = 1;
  161. };
  162. class Glass_2_source: Glass_1_source
  163. {
  164. hitpoint = Glass_2;
  165. };
  166. class Glass_3_source: Glass_1_source
  167. {
  168. hitpoint = Glass_3;
  169. };
  170. class Glass_4_source: Glass_1_source
  171. {
  172. hitpoint = Glass_4;
  173. };
  174. class Glass_5_source: Glass_1_source
  175. {
  176. hitpoint = Glass_5;
  177. };
  178. class Glass_6_source: Glass_1_source
  179. {
  180. hitpoint = Glass_6;
  181. };
  182. class Glass_7_source: Glass_1_source
  183. {
  184. hitpoint = Glass_7;
  185. };
  186. class Glass_8_source: Glass_1_source
  187. {
  188. hitpoint = Glass_8;
  189. };
  190. };
  191. // 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)
  192. class UserActions
  193. {
  194. class OpenDoor_1
  195. {
  196. 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.
  197. displayName = "Open Door"; // Label of the action used in the action menu itself.
  198. position = Door_1_trigger; // Point in Memory lod in p3d around which the action is available.
  199. priority = 0.4; // Priority coefficient used for sorting action in the action menu.
  200. radius = 1.5; // Range around the above defined point in which you need to be to access the action.
  201. onlyForPlayer = false; // Defines if the action is available only to players or AI as well.
  202. 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).
  203. statement = ([this, 'Door_1_rot'] call BIS_fnc_DoorNoHandleOpen); // Action taken when this action is selected in the action menu. In this case it calls a function that opens the door.
  204. };
  205. class CloseDoor_1: OpenDoor_1
  206. {
  207. displayName = "Close Door";
  208. priority = 0.2;
  209. 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.
  210. statement = ([this, 'Door_1_rot'] call BIS_fnc_DoorNoHandleClose);
  211. };
  212.  
  213. class OpenDoor_2: OpenDoor_1
  214. {
  215. position = Door_2_trigger;
  216. condition = ((this animationPhase 'Door_2_rot') < 0.5) && ((this animationPhase 'Hitzone_2_hide') < 0.99999);
  217. statement = ([this, 'Door_2_rot', 'Door_Handle_2_rot_1', 'Door_Handle_2_rot_2'] call BIS_fnc_DoorOpen);
  218. };
  219. class CloseDoor_2: CloseDoor_1
  220. {
  221. position = Door_2_trigger;
  222. condition = ((this animationPhase 'Door_2_rot') >= 0.5) && ((this animationPhase 'Hitzone_2_hide') < 0.99999);
  223. statement = ([this, 'Door_2_rot', 'Door_Handle_2_rot_1', 'Door_Handle_2_rot_2'] call BIS_fnc_DoorClose);
  224. };
  225.  
  226. class OpenDoor_3: OpenDoor_1
  227. {
  228. position = Door_3_trigger;
  229. condition = ((this animationPhase 'Door_3_rot') < 0.5);
  230. statement = ([this, 'Door_3_rot', 'Door_Handle_3_rot_1', 'Door_Handle_3_rot_2'] call BIS_fnc_DoorOpen);
  231. };
  232. class CloseDoor_3: CloseDoor_1
  233. {
  234. position = Door_3_trigger;
  235. condition = ((this animationPhase 'Door_3_rot') >= 0.5);
  236. statement = ([this, 'Door_3_rot', 'Door_Handle_3_rot_1', 'Door_Handle_3_rot_2'] call BIS_fnc_DoorClose);
  237. };
  238.  
  239. class OpenDoor_4: OpenDoor_1
  240. {
  241. position = Door_4_trigger;
  242. condition = ((this animationPhase 'Door_4_rot') < 0.5) && ((this animationPhase 'Hitzone_1_hide') < 0.99999);
  243. statement = ([this, 'Door_4_rot', 'Door_Handle_4_rot_1', 'Door_Handle_4_rot_2'] call BIS_fnc_DoorOpen);
  244. };
  245. class CloseDoor_4: CloseDoor_1
  246. {
  247. position = Door_4_trigger;
  248. condition = ((this animationPhase 'Door_4_rot') >= 0.5) && ((this animationPhase 'Hitzone_1_hide') < 0.99999);
  249. statement = ([this, 'Door_4_rot', 'Door_Handle_4_rot_1', 'Door_Handle_4_rot_2'] call BIS_fnc_DoorClose);
  250. };
  251.  
  252. class OpenDoor_5: OpenDoor_1
  253. {
  254. position = Door_5_trigger;
  255. condition = ((this animationPhase 'Door_5_rot') < 0.5);
  256. statement = ([this, 'Door_5_rot', 'Door_Handle_5_rot_1', 'Door_Handle_5_rot_2'] call BIS_fnc_DoorOpen);
  257. };
  258. class CloseDoor_5: CloseDoor_1
  259. {
  260. position = Door_5_trigger;
  261. condition = ((this animationPhase 'Door_5_rot') >= 0.5);
  262. statement = ([this, 'Door_5_rot', 'Door_Handle_5_rot_1', 'Door_Handle_5_rot_2'] call BIS_fnc_DoorClose);
  263. };
  264. };
  265. // 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.
  266. actionBegin1 = OpenDoor_1;
  267. actionEnd1 = OpenDoor_1;
  268. actionBegin2 = OpenDoor_2;
  269. actionEnd2 = OpenDoor_2;
  270. actionBegin3 = OpenDoor_3;
  271. actionEnd3 = OpenDoor_3;
  272. actionBegin4 = OpenDoor_4;
  273. actionEnd4 = OpenDoor_4;
  274. actionBegin5 = OpenDoor_5;
  275. actionEnd5 = OpenDoor_5;
  276. // Amount of doors of this house; a parameter for easy processing of all doors on different houses by scripts.
  277. numberOfDoors = 5;
  278. };
  279. };
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement