ext_stores.nas 17 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444
  1. #On verifie et on largue
  2. var dropTanks = func(){
  3. for(var i = 2 ;i < 5 ; i = i + 1 ){
  4. var select = getprop("sim/weight["~ i ~"]/selected");
  5. if(select == "droptank"){ load.dropLoad(i);}
  6. }
  7. }
  8. var Clean = func(){
  9. setprop("consumables/fuel/tank[4]/selected", 0);
  10. setprop("consumables/fuel/tank[4]/capacity-gal_us", 0);
  11. setprop("consumables/fuel/tank[4]/level-gal_us", 0);
  12. setprop("consumables/fuel/tank[5]/selected", 0);
  13. setprop("consumables/fuel/tank[5]/capacity-gal_us", 0);
  14. setprop("consumables/fuel/tank[5]/level-gal_us", 0);
  15. setprop("consumables/fuel/tank[6]/selected", 0);
  16. setprop("consumables/fuel/tank[6]/capacity-gal_us", 0);
  17. setprop("consumables/fuel/tank[6]/level-gal_us", 0);
  18. setprop("sim/weight[0]/selected", "none");
  19. setprop("sim/weight[1]/selected", "none");
  20. setprop("sim/weight[2]/selected", "none");
  21. setprop("sim/weight[3]/selected", "none");
  22. setprop("sim/weight[4]/selected", "none");
  23. setprop("sim/weight[5]/selected", "none");
  24. setprop("sim/weight[6]/selected", "none");
  25. setprop("sim/weaponmode/selectedpylon/general", 0);
  26. weapons.UnchoosePylons();
  27. }
  28. var Ferry = func(){
  29. setprop("consumables/fuel/tank[4]/selected", 0);
  30. setprop("consumables/fuel/tank[4]/capacity-gal_us", 0);
  31. setprop("consumables/fuel/tank[4]/level-gal_us", 0);
  32. setprop("consumables/fuel/tank[5]/selected", 0);
  33. setprop("consumables/fuel/tank[5]/capacity-gal_us", 0);
  34. setprop("consumables/fuel/tank[5]/level-gal_us", 0);
  35. setprop("consumables/fuel/tank[6]/selected", 0);
  36. setprop("consumables/fuel/tank[6]/capacity-gal_us", 0);
  37. setprop("consumables/fuel/tank[6]/level-gal_us", 0);
  38. setprop("sim/weight[0]/selected", "IRIS-T");
  39. setprop("sim/weight[1]/selected", "none");
  40. setprop("sim/weight[2]/selected", "330 Gal Droptank");
  41. setprop("sim/weight[3]/selected", "330 Gal Droptank");
  42. setprop("sim/weight[4]/selected", "330 Gal Droptank");
  43. setprop("sim/weight[5]/selected", "none");
  44. setprop("sim/weight[6]/selected", "IRIS-T");
  45. setprop("consumables/fuel/tank[4]/selected", 1);
  46. setprop("consumables/fuel/tank[4]/capacity-gal_us", 330);
  47. setprop("consumables/fuel/tank[4]/level-gal_us", 330);
  48. setprop("consumables/fuel/tank[5]/selected", 1);
  49. setprop("consumables/fuel/tank[5]/capacity-gal_us", 330);
  50. setprop("consumables/fuel/tank[5]/level-gal_us", 330);
  51. setprop("consumables/fuel/tank[6]/selected", 1);
  52. setprop("consumables/fuel/tank[6]/capacity-gal_us", 330);
  53. setprop("consumables/fuel/tank[6]/level-gal_us", 330);
  54. setprop("sim/weaponmode/selectedpylon/general", 0);
  55. }
  56. var CAP = func(){
  57. setprop("consumables/fuel/tank[4]/selected", 0);
  58. setprop("consumables/fuel/tank[4]/capacity-gal_us", 0);
  59. setprop("consumables/fuel/tank[4]/level-gal_us", 0);
  60. setprop("consumables/fuel/tank[5]/selected", 0);
  61. setprop("consumables/fuel/tank[5]/capacity-gal_us", 0);
  62. setprop("consumables/fuel/tank[5]/level-gal_us", 0);
  63. setprop("consumables/fuel/tank[6]/selected", 0);
  64. setprop("consumables/fuel/tank[6]/capacity-gal_us", 0);
  65. setprop("consumables/fuel/tank[6]/level-gal_us", 0);
  66. setprop("sim/weight[0]/selected", "IRIS-T");
  67. setprop("sim/weight[1]/selected", "AIM-120 Slammer");
  68. setprop("sim/weight[2]/selected", "AIM-132 ASRAAM");
  69. setprop("sim/weight[3]/selected", "none");
  70. setprop("sim/weight[4]/selected", "AIM-132 ASRAAM");
  71. setprop("sim/weight[5]/selected", "AIM-120 Slammer");
  72. setprop("sim/weight[6]/selected", "IRIS-T");
  73. setprop("sim/weaponmode/selectedpylon/general", 0);
  74. }
  75. var CAPextended = func(){
  76. setprop("consumables/fuel/tank[4]/selected", 0);
  77. setprop("consumables/fuel/tank[4]/capacity-gal_us", 0);
  78. setprop("consumables/fuel/tank[4]/level-gal_us", 0);
  79. setprop("consumables/fuel/tank[5]/selected", 0);
  80. setprop("consumables/fuel/tank[5]/capacity-gal_us", 0);
  81. setprop("consumables/fuel/tank[5]/level-gal_us", 0);
  82. setprop("consumables/fuel/tank[6]/selected", 0);
  83. setprop("consumables/fuel/tank[6]/capacity-gal_us", 0);
  84. setprop("consumables/fuel/tank[6]/level-gal_us", 0);
  85. setprop("sim/weight[0]/selected", "IRIS-T");
  86. setprop("sim/weight[1]/selected", "AIM-120 Slammer");
  87. setprop("sim/weight[2]/selected", "AIM-132 ASRAAM");
  88. setprop("sim/weight[3]/selected", "330 Gal Droptank");
  89. setprop("sim/weight[4]/selected", "AIM-132 ASRAAM");
  90. setprop("sim/weight[5]/selected", "AIM-120 Slammer");
  91. setprop("sim/weight[6]/selected", "IRIS-T");
  92. setprop("consumables/fuel/tank[5]/selected", 1);
  93. setprop("consumables/fuel/tank[5]/capacity-gal_us", 330);
  94. setprop("consumables/fuel/tank[5]/level-gal_us", 330);
  95. setprop("sim/weaponmode/selectedpylon/general", 0);
  96. }
  97. var lgb = func(){
  98. setprop("consumables/fuel/tank[4]/selected", 0);
  99. setprop("consumables/fuel/tank[4]/capacity-gal_us", 0);
  100. setprop("consumables/fuel/tank[4]/level-gal_us", 0);
  101. setprop("consumables/fuel/tank[5]/selected", 0);
  102. setprop("consumables/fuel/tank[5]/capacity-gal_us", 0);
  103. setprop("consumables/fuel/tank[5]/level-gal_us", 0);
  104. setprop("consumables/fuel/tank[6]/selected", 0);
  105. setprop("consumables/fuel/tank[6]/capacity-gal_us", 0);
  106. setprop("consumables/fuel/tank[6]/level-gal_us", 0);
  107. setprop("sim/weight[0]/selected", "MICA");
  108. setprop("sim/weight[1]/selected", "GBU-16");
  109. setprop("sim/weight[2]/selected", "GBU-16");
  110. setprop("sim/weight[3]/selected", "none");
  111. setprop("sim/weight[4]/selected", "GBU-16");
  112. setprop("sim/weight[5]/selected", "GBU-16");
  113. setprop("sim/weight[6]/selected", "MICA");
  114. setprop("sim/weaponmode/selectedpylon/general", 0);
  115. }
  116. var lgbextended = func(){
  117. setprop("consumables/fuel/tank[4]/selected", 0);
  118. setprop("consumables/fuel/tank[4]/capacity-gal_us", 0);
  119. setprop("consumables/fuel/tank[4]/level-gal_us", 0);
  120. setprop("consumables/fuel/tank[5]/selected", 0);
  121. setprop("consumables/fuel/tank[5]/capacity-gal_us", 0);
  122. setprop("consumables/fuel/tank[5]/level-gal_us", 0);
  123. setprop("consumables/fuel/tank[6]/selected", 0);
  124. setprop("consumables/fuel/tank[6]/capacity-gal_us", 0);
  125. setprop("consumables/fuel/tank[6]/level-gal_us", 0);
  126. setprop("sim/weight[0]/selected", "MICA");
  127. setprop("sim/weight[1]/selected", "GBU-16");
  128. setprop("sim/weight[2]/selected", "GBU-16");
  129. setprop("sim/weight[3]/selected", "330 Gal Droptank");
  130. setprop("sim/weight[4]/selected", "GBU-16");
  131. setprop("sim/weight[5]/selected", "GBU-16");
  132. setprop("sim/weight[6]/selected", "MICA");
  133. setprop("consumables/fuel/tank[5]/selected", 1);
  134. setprop("consumables/fuel/tank[5]/capacity-gal_us", 330);
  135. setprop("consumables/fuel/tank[5]/level-gal_us", 330);
  136. setprop("sim/weaponmode/selectedpylon/general", 0);
  137. }
  138. var lgbheavy = func(){
  139. setprop("consumables/fuel/tank[4]/selected", 0);
  140. setprop("consumables/fuel/tank[4]/capacity-gal_us", 0);
  141. setprop("consumables/fuel/tank[4]/level-gal_us", 0);
  142. setprop("consumables/fuel/tank[5]/selected", 0);
  143. setprop("consumables/fuel/tank[5]/capacity-gal_us", 0);
  144. setprop("consumables/fuel/tank[5]/level-gal_us", 0);
  145. setprop("consumables/fuel/tank[6]/selected", 0);
  146. setprop("consumables/fuel/tank[6]/capacity-gal_us", 0);
  147. setprop("consumables/fuel/tank[6]/level-gal_us", 0);
  148. setprop("sim/weight[0]/selected", "AIM-9 Sidewinder");
  149. setprop("sim/weight[1]/selected", "none");
  150. setprop("sim/weight[2]/selected", "GBU-24");
  151. setprop("sim/weight[3]/selected", "GBU-24");
  152. setprop("sim/weight[4]/selected", "GBU-24");
  153. setprop("sim/weight[5]/selected", "none");
  154. setprop("sim/weight[6]/selected", "AIM-9 Sidewinder");
  155. setprop("sim/weaponmode/selectedpylon/general", 0);
  156. }
  157. var agm = func(){
  158. setprop("consumables/fuel/tank[4]/selected", 0);
  159. setprop("consumables/fuel/tank[4]/capacity-gal_us", 0);
  160. setprop("consumables/fuel/tank[4]/level-gal_us", 0);
  161. setprop("consumables/fuel/tank[5]/selected", 0);
  162. setprop("consumables/fuel/tank[5]/capacity-gal_us", 0);
  163. setprop("consumables/fuel/tank[5]/level-gal_us", 0);
  164. setprop("consumables/fuel/tank[6]/selected", 0);
  165. setprop("consumables/fuel/tank[6]/capacity-gal_us", 0);
  166. setprop("consumables/fuel/tank[6]/level-gal_us", 0);
  167. setprop("sim/weight[0]/selected", "AIM-9 Sidewinder");
  168. setprop("sim/weight[1]/selected", "AGM-65 Maverick");
  169. setprop("sim/weight[2]/selected", "AGM-65 Maverick");
  170. setprop("sim/weight[3]/selected", "AGM-65 Maverick");
  171. setprop("sim/weight[4]/selected", "AGM-65 Maverick");
  172. setprop("sim/weight[5]/selected", "AGM-65 Maverick");
  173. setprop("sim/weight[6]/selected", "AIM-9 Sidewinder");
  174. setprop("consumables/fuel/tank[5]/selected", 1);
  175. setprop("consumables/fuel/tank[5]/capacity-gal_us", 330);
  176. setprop("consumables/fuel/tank[5]/level-gal_us", 330);
  177. setprop("sim/weaponmode/selectedpylon/general", 0);
  178. }
  179. var agmextended = func(){
  180. setprop("consumables/fuel/tank[4]/selected", 0);
  181. setprop("consumables/fuel/tank[4]/capacity-gal_us", 0);
  182. setprop("consumables/fuel/tank[4]/level-gal_us", 0);
  183. setprop("consumables/fuel/tank[5]/selected", 0);
  184. setprop("consumables/fuel/tank[5]/capacity-gal_us", 0);
  185. setprop("consumables/fuel/tank[5]/level-gal_us", 0);
  186. setprop("consumables/fuel/tank[6]/selected", 0);
  187. setprop("consumables/fuel/tank[6]/capacity-gal_us", 0);
  188. setprop("consumables/fuel/tank[6]/level-gal_us", 0);
  189. setprop("sim/weight[0]/selected", "AIM-9 Sidewinder");
  190. setprop("sim/weight[1]/selected", "AGM-65 Maverick");
  191. setprop("sim/weight[2]/selected", "AGM-65 Maverick");
  192. setprop("sim/weight[3]/selected", "330 Gal Droptank");
  193. setprop("sim/weight[4]/selected", "AGM-65 Maverick");
  194. setprop("sim/weight[5]/selected", "AGM-65 Maverick");
  195. setprop("sim/weight[6]/selected", "AIM-9 Sidewinder");
  196. setprop("sim/weaponmode/selectedpylon/general", 0);
  197. }
  198. var GAmulti = func(){
  199. setprop("consumables/fuel/tank[4]/selected", 0);
  200. setprop("consumables/fuel/tank[4]/capacity-gal_us", 0);
  201. setprop("consumables/fuel/tank[4]/level-gal_us", 0);
  202. setprop("consumables/fuel/tank[5]/selected", 0);
  203. setprop("consumables/fuel/tank[5]/capacity-gal_us", 0);
  204. setprop("consumables/fuel/tank[5]/level-gal_us", 0);
  205. setprop("consumables/fuel/tank[6]/selected", 0);
  206. setprop("consumables/fuel/tank[6]/capacity-gal_us", 0);
  207. setprop("consumables/fuel/tank[6]/level-gal_us", 0);
  208. setprop("sim/weight[0]/selected", "IRIS-T");
  209. setprop("sim/weight[1]/selected", "AGM-65 Maverick");
  210. setprop("sim/weight[2]/selected", "GBU-16");
  211. setprop("sim/weight[3]/selected", "GBU-24");
  212. setprop("sim/weight[4]/selected", "GBU-16");
  213. setprop("sim/weight[5]/selected", "AGM-65 Maverick");
  214. setprop("sim/weight[6]/selected", "IRIS-T");
  215. setprop("sim/weaponmode/selectedpylon/general", 0);
  216. }
  217. var GAmultiextended = func(){
  218. setprop("consumables/fuel/tank[4]/selected", 0);
  219. setprop("consumables/fuel/tank[4]/capacity-gal_us", 0);
  220. setprop("consumables/fuel/tank[4]/level-gal_us", 0);
  221. setprop("consumables/fuel/tank[5]/selected", 0);
  222. setprop("consumables/fuel/tank[5]/capacity-gal_us", 0);
  223. setprop("consumables/fuel/tank[5]/level-gal_us", 0);
  224. setprop("consumables/fuel/tank[6]/selected", 0);
  225. setprop("consumables/fuel/tank[6]/capacity-gal_us", 0);
  226. setprop("consumables/fuel/tank[6]/level-gal_us", 0);
  227. setprop("sim/weight[0]/selected", "IRIS-T");
  228. setprop("sim/weight[1]/selected", "AGM-65 Maverick");
  229. setprop("sim/weight[2]/selected", "GBU-16");
  230. setprop("sim/weight[3]/selected", "330 Gal Droptank");
  231. setprop("sim/weight[4]/selected", "GBU-16");
  232. setprop("sim/weight[5]/selected", "AGM-65 Maverick");
  233. setprop("sim/weight[6]/selected", "IRIS-T");
  234. setprop("consumables/fuel/tank[5]/selected", 1);
  235. setprop("consumables/fuel/tank[5]/capacity-gal_us", 330);
  236. setprop("consumables/fuel/tank[5]/level-gal_us", 330);
  237. setprop("sim/weaponmode/selectedpylon/general", 0);
  238. }
  239. var antiship = func(){
  240. setprop("consumables/fuel/tank[4]/selected", 0);
  241. setprop("consumables/fuel/tank[4]/capacity-gal_us", 0);
  242. setprop("consumables/fuel/tank[4]/level-gal_us", 0);
  243. setprop("consumables/fuel/tank[5]/selected", 0);
  244. setprop("consumables/fuel/tank[5]/capacity-gal_us", 0);
  245. setprop("consumables/fuel/tank[5]/level-gal_us", 0);
  246. setprop("consumables/fuel/tank[6]/selected", 0);
  247. setprop("consumables/fuel/tank[6]/capacity-gal_us", 0);
  248. setprop("consumables/fuel/tank[6]/level-gal_us", 0);
  249. setprop("sim/weight[0]/selected", "IRIS-T");
  250. setprop("sim/weight[1]/selected", "none");
  251. setprop("sim/weight[2]/selected", "AGM-84 Harpoon");
  252. setprop("sim/weight[3]/selected", "none");
  253. setprop("sim/weight[4]/selected", "AGM-84 Harpoon");
  254. setprop("sim/weight[5]/selected", "none");
  255. setprop("sim/weight[6]/selected", "IRIS-T");
  256. setprop("sim/weaponmode/selectedpylon/general", 0);
  257. }
  258. var antishipextended = func(){
  259. setprop("consumables/fuel/tank[4]/selected", 0);
  260. setprop("consumables/fuel/tank[4]/capacity-gal_us", 0);
  261. setprop("consumables/fuel/tank[4]/level-gal_us", 0);
  262. setprop("consumables/fuel/tank[5]/selected", 0);
  263. setprop("consumables/fuel/tank[5]/capacity-gal_us", 0);
  264. setprop("consumables/fuel/tank[5]/level-gal_us", 0);
  265. setprop("consumables/fuel/tank[6]/selected", 0);
  266. setprop("consumables/fuel/tank[6]/capacity-gal_us", 0);
  267. setprop("consumables/fuel/tank[6]/level-gal_us", 0);
  268. setprop("sim/weight[0]/selected", "IRIS-T");
  269. setprop("sim/weight[1]/selected", "none");
  270. setprop("sim/weight[2]/selected", "AGM-84 Harpoon");
  271. setprop("sim/weight[3]/selected", "330 Gal Droptank");
  272. setprop("sim/weight[4]/selected", "AGM-84 Harpoon");
  273. setprop("sim/weight[5]/selected", "none");
  274. setprop("sim/weight[6]/selected", "IRIS-T");
  275. setprop("consumables/fuel/tank[5]/selected", 1);
  276. setprop("consumables/fuel/tank[5]/capacity-gal_us", 330);
  277. setprop("consumables/fuel/tank[5]/level-gal_us", 330);
  278. setprop("sim/weaponmode/selectedpylon/general", 0);
  279. }
  280. #La boite de dialogue
  281. var ext_loads_dlg = gui.Dialog.new("dialog","Aircraft/Mako/Dialogs/external-loads.xml");
  282. #Begining of the dropable function.
  283. #It has to be simplified and generic made
  284. #Need to know how to make a table
  285. dropLoad = func (number) {
  286. var select = getprop("sim/weight["~ number ~"]/selected");
  287. if(select != "none"){
  288. if(select == "Droptank"){
  289. tank_submodel(number,select);
  290. setprop("consumables/fuel/tank["~ number ~"]/selected", 0);
  291. settimer(func load.dropLoad_stop(number),2);
  292. setprop("controls/armament/station["~ number ~"]/release", 1);
  293. setprop("sim/weight["~ number ~"]/selected", "none");
  294. setprop("sim/weight["~ number ~"]/weight-lb", 0);
  295. }else{
  296. load.dropMissile(number);
  297. settimer(func load.dropLoad_stop(number),0.5);
  298. }
  299. }
  300. }
  301. #Need to be changed
  302. dropLoad_stop = func(n) {
  303. setprop("controls/armament/station["~ n ~"]/release", 0);
  304. }
  305. dropMissile = func (number) {
  306. var target = hud.closest_target();
  307. if(target == nil){ return;}
  308. #print(typeMissile);
  309. var typeMissile = getprop("sim/weight["~ number ~"]/selected");
  310. missile.Loading_missile(typeMissile);
  311. Current_missile = missile.MISSILE.new(number);
  312. Current_missile.status = 0;
  313. Current_missile.search(target);
  314. Current_missile.release();
  315. setprop("controls/armament/station["~ number ~"]/release", 1);
  316. setprop("sim/weight["~ number ~"]/selected", "none");
  317. setprop("sim/weight["~ number ~"]/weight-lb", 0);
  318. }
  319. #var tank_submodel = func (pylone, select){
  320. #Drop Tanks
  321. #if(pylone == 2 and select == "Droptank"){ setprop("controls/armament/station[2]/release-droptank", 1);}
  322. #if(pylone == 3 and select == "Droptank"){ setprop("controls/armament/station[3]/release-droptank", 1);}
  323. #if(pylone == 4 and select == "Droptank"){ setprop("controls/armament/station[4]/release-droptank", 1);}
  324. #}