1
0

config_macros.hpp 7.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261
  1. //---Basic Definitions---
  2. //I learned all of this from this weeb mod lol https://steamcommunity.com/sharedfiles/filedetails/?id=1620525773
  3. #define StabilizedInAxesNone 0
  4. #define StabilizedInAxisX 1
  5. #define StabilizedInAxisY 2
  6. #define StabilizedInAxesBoth 3
  7. #define MACRO_AUTHOR "RD501"
  8. #define MACRO_AUTHOR_PPL "Namenai"
  9. #define MODNAME RD501
  10. //---Basic Functions---
  11. #define CONCAT(a,b) a##b
  12. #define CONCAT_3(a,b,c) CONCAT(a,CONCAT(b,c))
  13. #define CONCAT_4(a,b,c,d) CONCAT(a,CONCAT_3(b,c,d))
  14. #define CONCAT_5(a,b,c,d,e) CONCAT(a,CONCAT_4(b,c,d,e))
  15. #define CONCAT_6(a,b,c,d,e,f) CONCAT(a,CONCAT_5(b,c,d,e,f))
  16. #define CONCAT_7(a,b,c,d,e,f,g) CONCAT(a,CONCAT_6(b,c,d,e,f,g))
  17. #define UNDERSCORE_CONCAT(a,b) CONCAT_3(a,_,b)
  18. #define ADDON UNDERSCORE_CONCAT(MODNAME,COMPONENT)
  19. #define ADDON_NICE Research & Development 501
  20. #define DANKAUTHORS RD501
  21. //Adds the mod prefix to watever, used for classnames and such
  22. #define ADD_PREFIX(NAME)UNDERSCORE_CONCAT(MODNAME,NAME)
  23. #define concat_function(var) UNDERSCORE_CONCAT(ADDON,var)
  24. // #define quote_this(thing) #thing
  25. #define macro_single_quote(thing) '##thing##'
  26. #define MACRO_QUOTE(thing) #thing
  27. #define macro_new_config_prop(name) CONCAT_3(MODNAME,_,name)
  28. //Faction names,classes,and catagories
  29. #define macro_republic_faction CONCAT(MODNAME,_Republic_Faction)
  30. #define macro_rebel_faction CONCAT(MODNAME,_Rebel_Faction)
  31. #define macro_resistance_faction CONCAT(MODNAME,_Resistance_Faction)
  32. #define macro_cis_faction CONCAT(MODNAME,_CIS_Faction)
  33. #define macro_empire_faction CONCAT(MODNAME,_Empire_Faction)
  34. #define macro_faction(name) CONCAT_4(MODNAME,_,name,_Faction)
  35. #define macro_first_order_faction CONCAT(MODNAME,_First_Order)
  36. #define macro_ind_faction CONCAT(MODNAME,_Independent_Faction)
  37. #define macro_civ_faction CONCAT(MODNAME,_Civ_Faction)
  38. #define macro_editor_cat(name) CONCAT_3(MODNAME,_Editor_Category_,name)
  39. #define macro_editor_cat_air(name) CONCAT_3(MODNAME,_Editor_Category_Air_,name)
  40. #define macro_editor_vehicle_type(name) CONCAT_3(MODNAME,_Vehicle_Class_,name)
  41. #define macro_editor_vehicle_type_air(name) CONCAT_3(MODNAME,_Air_Vehicle_Class_,name)
  42. //---Functions---
  43. #define macro_mod_script_path RD501_Main\functions
  44. #define post_init_fnc(name)\
  45. class name\
  46. {\
  47. postInit = 1;\
  48. file = function_path(name) \
  49. };
  50. #define normal_fnc(name)\
  51. class name\
  52. {\
  53. file = function_path(name) \
  54. };
  55. #define function_path(scriptname) MACRO_QUOTE(CONCAT(ADDON,\scripts\scriptname.sqf))
  56. #define macro_hud_changer_interaction_icons RD501_Main\textures\interaction_Icons
  57. #define macro_fnc_name(title) CONCAT_3(MODNAME,_fnc_,title)
  58. #define macro_grp_fnc_name(grp,title) CONCAT_5(MODNAME,_,grp,_fnc_,title)
  59. #define macro_preprocess_fnc(file)\
  60. call compileFinal preprocessFileLineNumbers 'COMPONENT##\##file'
  61. //---Patches---
  62. #define macro_patch_name(component) CONCAT_3(MODNAME,_patch_,component)
  63. #define macro_A3_patch MACRO_QUOTE(A3_Data_F_Tank_Loadorder)
  64. #define macro_root_req MACRO_QUOTE(RD501_patch_main)
  65. #define macro_lvl2_req MACRO_QUOTE(RD501_patch_weapons), MACRO_QUOTE(RD501_patch_jumppack), MACRO_QUOTE(RD501_patch_helmets), MACRO_QUOTE(RD501_patch_vehicle_weapons)
  66. #define macro_lvl3_req MACRO_QUOTE(RD501_patch_units), MACRO_QUOTE(RD501_patch_vehicles), MACRO_QUOTE(RD501_patch_zeus)
  67. #define macro_lvl1_req MACRO_QUOTE(RD501_patch_particle_effects), MACRO_QUOTE(RD501_patch_VenatorMK2), MACRO_QUOTE(RD501_patch_emp)
  68. #define macro_lvl4_req MACRO_QUOTE(RD501_patch_droids_config), MACRO_QUOTE(macro_patch_name(laat_variants))
  69. #define macro_lvl5_req MACRO_QUOTE(macro_patch_name(legacy_classnames))
  70. #define macro_end_patches macro_lvl5_req
  71. //---Weapons, Mags, and Ammo
  72. #define macro_scope_magnification(zoom) 0.25/zoom
  73. #define macro_new_scope(scopename) CONCAT_3(MODNAME,_weapon_scope_,scopename)
  74. #define macro_new_weapon(family,name) CONCAT_5(MODNAME,_,family,_,name)
  75. #define macro_new_weapon_nofam(name) CONCAT_3(MODNAME,_,name)
  76. #define macro_new_ammo(name) CONCAT_3(MODNAME,_,name,_ammo)
  77. #define macro_new_mag(name,count) CONCAT_6(MODNAME,_,name,_x,count,_mag)
  78. #define macro_new_magwell(name) CONCAT_4(MODNAME,_,name,_magwell)
  79. #define macro_new_magwell_array(name) CONCAT_4(MODNAME,_,name,_magwell[])
  80. #define macro_no_muzzle_impulse muzzleImpulseFactor[] = {0.00, 0.00};
  81. #define macro_new_recoil(name) CONCAT_4(MODNAME,_,name,_recoil)
  82. //---Vehicles---
  83. #define macro_basic_air_weapons "Laserdesignator_pilotCamera","CMFlareLauncher"
  84. #define macro_basic_air_mags "Laserbatteries","300Rnd_CMFlare_Chaff_Magazine","300Rnd_CMFlare_Chaff_Magazine"
  85. #define macro_new_vehicle(group,name) CONCAT_5(MODNAME,_,group,_,name)
  86. //----uniforms,units,vests
  87. //wat we see in arsenal,weapon
  88. #define macro_new_uniform_class(side,name) CONCAT_5(MODNAME,_,side,_uniform_,name)
  89. //vests
  90. #define macro_new_vest_class(side,name) CONCAT_5(MODNAME,_,side,_vest_,name)
  91. //actualyt skin of uniforms,vehicle
  92. #define macro_new_uniform_skin_class(side,name) CONCAT_5(MODNAME,_,side,_uniform_skin_,name)
  93. //wat we see in zeus,vehicle
  94. #define macro_new_unit_class(side,name) CONCAT_5(MODNAME,_,side,_unit_,name)
  95. //backpak
  96. #define macro_new_backpack_class(side,name) CONCAT_6(MODNAME,_,side,_,name,_backpack)
  97. //compositions
  98. #define macro_new_composition(side,name) CONCAT_5(MODNAME,_,side,_composition_,name)
  99. //backpack presets
  100. #define macro_b1_at_backpack_inv \
  101. class _xx_MAAWS_HE \
  102. {\
  103. magazine = "MRAWS_HE_F";\
  104. count = 3;\
  105. };\
  106. class _xx_MAAWS_HEAT\
  107. {\
  108. magazine = "MRAWS_HEAT_F";\
  109. count = 2;\
  110. };
  111. #define macro_b1_aa_backpack_inv \
  112. class _xx_Titan_AA\
  113. {\
  114. magazine = "Titan_AA";\
  115. count = 6;\
  116. };
  117. //---Ordanance---
  118. #define macro_new_ordnance(name) CONCAT_3(MODNAME,_Ordnance_,name)
  119. #define macro_new_ordnance_ammo(name) CONCAT_3(MODNAME,_Ordnance_Ammo_,name)
  120. //---helmets
  121. #define macro_custom_helmet_textures \RD501_Helmets\_textures
  122. #define macro_new_helmet(group,name) CONCAT_5(MODNAME,_,group,_helmet_,name)
  123. #define macro_new_helmet_jlts(group,name) CONCAT_5(MODNAME,_,group,_helmet_,name)
  124. #define macro_clone_helmet_hitpoints\
  125. class HitpointsProtectionInfo\
  126. {\
  127. class Head\
  128. {\
  129. hitpointName = "HitHead";\
  130. armor = 50;\
  131. passThrough = 0.6;\
  132. };\
  133. };
  134. #define macro_clone_other_armor_values\
  135. explosionShielding = 2.2;\
  136. minimalHit = 0.01;\
  137. passThrough = 0.01;
  138. #define macro_ace_hearing_helmet_setting\
  139. ace_hearing_protection = 0.85; \
  140. ace_hearing_lowerVolume = 0.6;
  141. #define macro_rebreather_armor_stuff\
  142. containerClass = "Supply100";\
  143. mass = 20;\
  144. vestType = "Rebreather";
  145. #define macro_clone_armor_hitpoints \
  146. class HitpointsProtectionInfo\
  147. {\
  148. class Neck\
  149. {\
  150. hitpointName = "HitNeck";\
  151. armor = 8;\
  152. passThrough = 0.6;\
  153. };\
  154. class Arms\
  155. {\
  156. hitpointName = "HitArms";\
  157. armor = 16;\
  158. passThrough = 0.6;\
  159. };\
  160. class Chest\
  161. {\
  162. hitpointName = "HitChest";\
  163. armor = 32;\
  164. passThrough = 0.6;\
  165. };\
  166. class Diaphragm\
  167. {\
  168. hitpointName = "HitDiaphragm";\
  169. armor = 32;\
  170. passThrough = 0.6;\
  171. };\
  172. class Abdomen\
  173. {\
  174. hitpointName = "HitAbdomen";\
  175. armor = 16;\
  176. passThrough = 0.6;\
  177. };\
  178. class Pelvis\
  179. {\
  180. hitpointName = "HitPelvis";\
  181. armor = 16;\
  182. passThrough = 0.6;\
  183. };\
  184. class Body\
  185. {\
  186. hitpointName = "HitBody";\
  187. passThrough = 0.6;\
  188. };\
  189. };
  190. //---textures
  191. #define macro_unit_skin_textures RD501_Units\textures
  192. #define macro_vehicle_textures RD501_Vehicles\textures
  193. #define macro_b1_textures MRC\JLTS\characters\DroidArmor\data
  194. //---XEH prep---
  195. #define macro_prep_xeh(SCRIPT,name)\
  196. [MACRO_QUOTE(macro_mod_script_path\SCRIPT),MACRO_QUOTE(macro_fnc_name(name))] call CBA_fnc_compileFunction;
  197. //---particle efffects---
  198. #define macro_new_cloudlet(name) CONCAT_3(MODNAME,_cloudlet_,name)
  199. #define macro_new_complex_effect(name) CONCAT_3(MODNAME,_particle_effect_,name)
  200. #define macro_new_light(name) CONCAT_3(MODNAME,_light_,name)
  201. //---NVG----
  202. #define macro_thermal_nvg_default \
  203. thermalMode[] = {8};