123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444 |
- #On verifie et on largue
- var dropTanks = func(){
- for(var i = 2 ;i < 5 ; i = i + 1 ){
- var select = getprop("sim/weight["~ i ~"]/selected");
- if(select == "droptank"){ load.dropLoad(i);}
- }
- }
- var Clean = func(){
- setprop("consumables/fuel/tank[4]/selected", 0);
- setprop("consumables/fuel/tank[4]/capacity-gal_us", 0);
- setprop("consumables/fuel/tank[4]/level-gal_us", 0);
- setprop("consumables/fuel/tank[5]/selected", 0);
- setprop("consumables/fuel/tank[5]/capacity-gal_us", 0);
- setprop("consumables/fuel/tank[5]/level-gal_us", 0);
- setprop("consumables/fuel/tank[6]/selected", 0);
- setprop("consumables/fuel/tank[6]/capacity-gal_us", 0);
- setprop("consumables/fuel/tank[6]/level-gal_us", 0);
-
- setprop("sim/weight[0]/selected", "none");
- setprop("sim/weight[1]/selected", "none");
- setprop("sim/weight[2]/selected", "none");
- setprop("sim/weight[3]/selected", "none");
- setprop("sim/weight[4]/selected", "none");
- setprop("sim/weight[5]/selected", "none");
- setprop("sim/weight[6]/selected", "none");
-
- setprop("sim/weaponmode/selectedpylon/general", 0);
- weapons.UnchoosePylons();
- }
- var Ferry = func(){
-
- setprop("consumables/fuel/tank[4]/selected", 0);
- setprop("consumables/fuel/tank[4]/capacity-gal_us", 0);
- setprop("consumables/fuel/tank[4]/level-gal_us", 0);
- setprop("consumables/fuel/tank[5]/selected", 0);
- setprop("consumables/fuel/tank[5]/capacity-gal_us", 0);
- setprop("consumables/fuel/tank[5]/level-gal_us", 0);
- setprop("consumables/fuel/tank[6]/selected", 0);
- setprop("consumables/fuel/tank[6]/capacity-gal_us", 0);
- setprop("consumables/fuel/tank[6]/level-gal_us", 0);
-
- setprop("sim/weight[0]/selected", "IRIS-T");
- setprop("sim/weight[1]/selected", "none");
- setprop("sim/weight[2]/selected", "330 Gal Droptank");
- setprop("sim/weight[3]/selected", "330 Gal Droptank");
- setprop("sim/weight[4]/selected", "330 Gal Droptank");
- setprop("sim/weight[5]/selected", "none");
- setprop("sim/weight[6]/selected", "IRIS-T");
-
- setprop("consumables/fuel/tank[4]/selected", 1);
- setprop("consumables/fuel/tank[4]/capacity-gal_us", 330);
- setprop("consumables/fuel/tank[4]/level-gal_us", 330);
- setprop("consumables/fuel/tank[5]/selected", 1);
- setprop("consumables/fuel/tank[5]/capacity-gal_us", 330);
- setprop("consumables/fuel/tank[5]/level-gal_us", 330);
- setprop("consumables/fuel/tank[6]/selected", 1);
- setprop("consumables/fuel/tank[6]/capacity-gal_us", 330);
- setprop("consumables/fuel/tank[6]/level-gal_us", 330);
-
- setprop("sim/weaponmode/selectedpylon/general", 0);
- }
- var CAP = func(){
- setprop("consumables/fuel/tank[4]/selected", 0);
- setprop("consumables/fuel/tank[4]/capacity-gal_us", 0);
- setprop("consumables/fuel/tank[4]/level-gal_us", 0);
- setprop("consumables/fuel/tank[5]/selected", 0);
- setprop("consumables/fuel/tank[5]/capacity-gal_us", 0);
- setprop("consumables/fuel/tank[5]/level-gal_us", 0);
- setprop("consumables/fuel/tank[6]/selected", 0);
- setprop("consumables/fuel/tank[6]/capacity-gal_us", 0);
- setprop("consumables/fuel/tank[6]/level-gal_us", 0);
- setprop("sim/weight[0]/selected", "IRIS-T");
- setprop("sim/weight[1]/selected", "AIM-120 Slammer");
- setprop("sim/weight[2]/selected", "AIM-132 ASRAAM");
- setprop("sim/weight[3]/selected", "none");
- setprop("sim/weight[4]/selected", "AIM-132 ASRAAM");
- setprop("sim/weight[5]/selected", "AIM-120 Slammer");
- setprop("sim/weight[6]/selected", "IRIS-T");
-
- setprop("sim/weaponmode/selectedpylon/general", 0);
- }
- var CAPextended = func(){
- setprop("consumables/fuel/tank[4]/selected", 0);
- setprop("consumables/fuel/tank[4]/capacity-gal_us", 0);
- setprop("consumables/fuel/tank[4]/level-gal_us", 0);
- setprop("consumables/fuel/tank[5]/selected", 0);
- setprop("consumables/fuel/tank[5]/capacity-gal_us", 0);
- setprop("consumables/fuel/tank[5]/level-gal_us", 0);
- setprop("consumables/fuel/tank[6]/selected", 0);
- setprop("consumables/fuel/tank[6]/capacity-gal_us", 0);
- setprop("consumables/fuel/tank[6]/level-gal_us", 0);
- setprop("sim/weight[0]/selected", "IRIS-T");
- setprop("sim/weight[1]/selected", "AIM-120 Slammer");
- setprop("sim/weight[2]/selected", "AIM-132 ASRAAM");
- setprop("sim/weight[3]/selected", "330 Gal Droptank");
- setprop("sim/weight[4]/selected", "AIM-132 ASRAAM");
- setprop("sim/weight[5]/selected", "AIM-120 Slammer");
- setprop("sim/weight[6]/selected", "IRIS-T");
-
- setprop("consumables/fuel/tank[5]/selected", 1);
- setprop("consumables/fuel/tank[5]/capacity-gal_us", 330);
- setprop("consumables/fuel/tank[5]/level-gal_us", 330);
- setprop("sim/weaponmode/selectedpylon/general", 0);
- }
- var lgb = func(){
- setprop("consumables/fuel/tank[4]/selected", 0);
- setprop("consumables/fuel/tank[4]/capacity-gal_us", 0);
- setprop("consumables/fuel/tank[4]/level-gal_us", 0);
- setprop("consumables/fuel/tank[5]/selected", 0);
- setprop("consumables/fuel/tank[5]/capacity-gal_us", 0);
- setprop("consumables/fuel/tank[5]/level-gal_us", 0);
- setprop("consumables/fuel/tank[6]/selected", 0);
- setprop("consumables/fuel/tank[6]/capacity-gal_us", 0);
- setprop("consumables/fuel/tank[6]/level-gal_us", 0);
- setprop("sim/weight[0]/selected", "MICA");
- setprop("sim/weight[1]/selected", "GBU-16");
- setprop("sim/weight[2]/selected", "GBU-16");
- setprop("sim/weight[3]/selected", "none");
- setprop("sim/weight[4]/selected", "GBU-16");
- setprop("sim/weight[5]/selected", "GBU-16");
- setprop("sim/weight[6]/selected", "MICA");
-
- setprop("sim/weaponmode/selectedpylon/general", 0);
- }
- var lgbextended = func(){
- setprop("consumables/fuel/tank[4]/selected", 0);
- setprop("consumables/fuel/tank[4]/capacity-gal_us", 0);
- setprop("consumables/fuel/tank[4]/level-gal_us", 0);
- setprop("consumables/fuel/tank[5]/selected", 0);
- setprop("consumables/fuel/tank[5]/capacity-gal_us", 0);
- setprop("consumables/fuel/tank[5]/level-gal_us", 0);
- setprop("consumables/fuel/tank[6]/selected", 0);
- setprop("consumables/fuel/tank[6]/capacity-gal_us", 0);
- setprop("consumables/fuel/tank[6]/level-gal_us", 0);
- setprop("sim/weight[0]/selected", "MICA");
- setprop("sim/weight[1]/selected", "GBU-16");
- setprop("sim/weight[2]/selected", "GBU-16");
- setprop("sim/weight[3]/selected", "330 Gal Droptank");
- setprop("sim/weight[4]/selected", "GBU-16");
- setprop("sim/weight[5]/selected", "GBU-16");
- setprop("sim/weight[6]/selected", "MICA");
-
- setprop("consumables/fuel/tank[5]/selected", 1);
- setprop("consumables/fuel/tank[5]/capacity-gal_us", 330);
- setprop("consumables/fuel/tank[5]/level-gal_us", 330);
- setprop("sim/weaponmode/selectedpylon/general", 0);
- }
- var lgbheavy = func(){
- setprop("consumables/fuel/tank[4]/selected", 0);
- setprop("consumables/fuel/tank[4]/capacity-gal_us", 0);
- setprop("consumables/fuel/tank[4]/level-gal_us", 0);
- setprop("consumables/fuel/tank[5]/selected", 0);
- setprop("consumables/fuel/tank[5]/capacity-gal_us", 0);
- setprop("consumables/fuel/tank[5]/level-gal_us", 0);
- setprop("consumables/fuel/tank[6]/selected", 0);
- setprop("consumables/fuel/tank[6]/capacity-gal_us", 0);
- setprop("consumables/fuel/tank[6]/level-gal_us", 0);
- setprop("sim/weight[0]/selected", "AIM-9 Sidewinder");
- setprop("sim/weight[1]/selected", "none");
- setprop("sim/weight[2]/selected", "GBU-24");
- setprop("sim/weight[3]/selected", "GBU-24");
- setprop("sim/weight[4]/selected", "GBU-24");
- setprop("sim/weight[5]/selected", "none");
- setprop("sim/weight[6]/selected", "AIM-9 Sidewinder");
-
- setprop("sim/weaponmode/selectedpylon/general", 0);
- }
- var agm = func(){
- setprop("consumables/fuel/tank[4]/selected", 0);
- setprop("consumables/fuel/tank[4]/capacity-gal_us", 0);
- setprop("consumables/fuel/tank[4]/level-gal_us", 0);
- setprop("consumables/fuel/tank[5]/selected", 0);
- setprop("consumables/fuel/tank[5]/capacity-gal_us", 0);
- setprop("consumables/fuel/tank[5]/level-gal_us", 0);
- setprop("consumables/fuel/tank[6]/selected", 0);
- setprop("consumables/fuel/tank[6]/capacity-gal_us", 0);
- setprop("consumables/fuel/tank[6]/level-gal_us", 0);
- setprop("sim/weight[0]/selected", "AIM-9 Sidewinder");
- setprop("sim/weight[1]/selected", "AGM-65 Maverick");
- setprop("sim/weight[2]/selected", "AGM-65 Maverick");
- setprop("sim/weight[3]/selected", "AGM-65 Maverick");
- setprop("sim/weight[4]/selected", "AGM-65 Maverick");
- setprop("sim/weight[5]/selected", "AGM-65 Maverick");
- setprop("sim/weight[6]/selected", "AIM-9 Sidewinder");
-
- setprop("consumables/fuel/tank[5]/selected", 1);
- setprop("consumables/fuel/tank[5]/capacity-gal_us", 330);
- setprop("consumables/fuel/tank[5]/level-gal_us", 330);
- setprop("sim/weaponmode/selectedpylon/general", 0);
- }
- var agmextended = func(){
- setprop("consumables/fuel/tank[4]/selected", 0);
- setprop("consumables/fuel/tank[4]/capacity-gal_us", 0);
- setprop("consumables/fuel/tank[4]/level-gal_us", 0);
- setprop("consumables/fuel/tank[5]/selected", 0);
- setprop("consumables/fuel/tank[5]/capacity-gal_us", 0);
- setprop("consumables/fuel/tank[5]/level-gal_us", 0);
- setprop("consumables/fuel/tank[6]/selected", 0);
- setprop("consumables/fuel/tank[6]/capacity-gal_us", 0);
- setprop("consumables/fuel/tank[6]/level-gal_us", 0);
- setprop("sim/weight[0]/selected", "AIM-9 Sidewinder");
- setprop("sim/weight[1]/selected", "AGM-65 Maverick");
- setprop("sim/weight[2]/selected", "AGM-65 Maverick");
- setprop("sim/weight[3]/selected", "330 Gal Droptank");
- setprop("sim/weight[4]/selected", "AGM-65 Maverick");
- setprop("sim/weight[5]/selected", "AGM-65 Maverick");
- setprop("sim/weight[6]/selected", "AIM-9 Sidewinder");
-
- setprop("sim/weaponmode/selectedpylon/general", 0);
- }
- var GAmulti = func(){
-
- setprop("consumables/fuel/tank[4]/selected", 0);
- setprop("consumables/fuel/tank[4]/capacity-gal_us", 0);
- setprop("consumables/fuel/tank[4]/level-gal_us", 0);
- setprop("consumables/fuel/tank[5]/selected", 0);
- setprop("consumables/fuel/tank[5]/capacity-gal_us", 0);
- setprop("consumables/fuel/tank[5]/level-gal_us", 0);
- setprop("consumables/fuel/tank[6]/selected", 0);
- setprop("consumables/fuel/tank[6]/capacity-gal_us", 0);
- setprop("consumables/fuel/tank[6]/level-gal_us", 0);
- setprop("sim/weight[0]/selected", "IRIS-T");
- setprop("sim/weight[1]/selected", "AGM-65 Maverick");
- setprop("sim/weight[2]/selected", "GBU-16");
- setprop("sim/weight[3]/selected", "GBU-24");
- setprop("sim/weight[4]/selected", "GBU-16");
- setprop("sim/weight[5]/selected", "AGM-65 Maverick");
- setprop("sim/weight[6]/selected", "IRIS-T");
-
- setprop("sim/weaponmode/selectedpylon/general", 0);
-
- }
- var GAmultiextended = func(){
- setprop("consumables/fuel/tank[4]/selected", 0);
- setprop("consumables/fuel/tank[4]/capacity-gal_us", 0);
- setprop("consumables/fuel/tank[4]/level-gal_us", 0);
- setprop("consumables/fuel/tank[5]/selected", 0);
- setprop("consumables/fuel/tank[5]/capacity-gal_us", 0);
- setprop("consumables/fuel/tank[5]/level-gal_us", 0);
- setprop("consumables/fuel/tank[6]/selected", 0);
- setprop("consumables/fuel/tank[6]/capacity-gal_us", 0);
- setprop("consumables/fuel/tank[6]/level-gal_us", 0);
- setprop("sim/weight[0]/selected", "IRIS-T");
- setprop("sim/weight[1]/selected", "AGM-65 Maverick");
- setprop("sim/weight[2]/selected", "GBU-16");
- setprop("sim/weight[3]/selected", "330 Gal Droptank");
- setprop("sim/weight[4]/selected", "GBU-16");
- setprop("sim/weight[5]/selected", "AGM-65 Maverick");
- setprop("sim/weight[6]/selected", "IRIS-T");
- setprop("consumables/fuel/tank[5]/selected", 1);
- setprop("consumables/fuel/tank[5]/capacity-gal_us", 330);
- setprop("consumables/fuel/tank[5]/level-gal_us", 330);
- setprop("sim/weaponmode/selectedpylon/general", 0);
- }
- var antiship = func(){
- setprop("consumables/fuel/tank[4]/selected", 0);
- setprop("consumables/fuel/tank[4]/capacity-gal_us", 0);
- setprop("consumables/fuel/tank[4]/level-gal_us", 0);
- setprop("consumables/fuel/tank[5]/selected", 0);
- setprop("consumables/fuel/tank[5]/capacity-gal_us", 0);
- setprop("consumables/fuel/tank[5]/level-gal_us", 0);
- setprop("consumables/fuel/tank[6]/selected", 0);
- setprop("consumables/fuel/tank[6]/capacity-gal_us", 0);
- setprop("consumables/fuel/tank[6]/level-gal_us", 0);
- setprop("sim/weight[0]/selected", "IRIS-T");
- setprop("sim/weight[1]/selected", "none");
- setprop("sim/weight[2]/selected", "AGM-84 Harpoon");
- setprop("sim/weight[3]/selected", "none");
- setprop("sim/weight[4]/selected", "AGM-84 Harpoon");
- setprop("sim/weight[5]/selected", "none");
- setprop("sim/weight[6]/selected", "IRIS-T");
-
- setprop("sim/weaponmode/selectedpylon/general", 0);
- }
- var antishipextended = func(){
- setprop("consumables/fuel/tank[4]/selected", 0);
- setprop("consumables/fuel/tank[4]/capacity-gal_us", 0);
- setprop("consumables/fuel/tank[4]/level-gal_us", 0);
- setprop("consumables/fuel/tank[5]/selected", 0);
- setprop("consumables/fuel/tank[5]/capacity-gal_us", 0);
- setprop("consumables/fuel/tank[5]/level-gal_us", 0);
- setprop("consumables/fuel/tank[6]/selected", 0);
- setprop("consumables/fuel/tank[6]/capacity-gal_us", 0);
- setprop("consumables/fuel/tank[6]/level-gal_us", 0);
- setprop("sim/weight[0]/selected", "IRIS-T");
- setprop("sim/weight[1]/selected", "none");
- setprop("sim/weight[2]/selected", "AGM-84 Harpoon");
- setprop("sim/weight[3]/selected", "330 Gal Droptank");
- setprop("sim/weight[4]/selected", "AGM-84 Harpoon");
- setprop("sim/weight[5]/selected", "none");
- setprop("sim/weight[6]/selected", "IRIS-T");
- setprop("consumables/fuel/tank[5]/selected", 1);
- setprop("consumables/fuel/tank[5]/capacity-gal_us", 330);
- setprop("consumables/fuel/tank[5]/level-gal_us", 330);
- setprop("sim/weaponmode/selectedpylon/general", 0);
- }
- #La boite de dialogue
- var ext_loads_dlg = gui.Dialog.new("dialog","Aircraft/Mako/Dialogs/external-loads.xml");
- #Begining of the dropable function.
- #It has to be simplified and generic made
- #Need to know how to make a table
- dropLoad = func (number) {
- var select = getprop("sim/weight["~ number ~"]/selected");
- if(select != "none"){
- if(select == "Droptank"){
- tank_submodel(number,select);
- setprop("consumables/fuel/tank["~ number ~"]/selected", 0);
- settimer(func load.dropLoad_stop(number),2);
- setprop("controls/armament/station["~ number ~"]/release", 1);
- setprop("sim/weight["~ number ~"]/selected", "none");
- setprop("sim/weight["~ number ~"]/weight-lb", 0);
- }else{
- load.dropMissile(number);
- settimer(func load.dropLoad_stop(number),0.5);
- }
- }
-
- }
- #Need to be changed
- dropLoad_stop = func(n) {
- setprop("controls/armament/station["~ n ~"]/release", 0);
- }
- dropMissile = func (number) {
- var target = hud.closest_target();
- if(target == nil){ return;}
-
- #print(typeMissile);
- var typeMissile = getprop("sim/weight["~ number ~"]/selected");
- missile.Loading_missile(typeMissile);
- Current_missile = missile.MISSILE.new(number);
- Current_missile.status = 0;
- Current_missile.search(target);
- Current_missile.release();
- setprop("controls/armament/station["~ number ~"]/release", 1);
- setprop("sim/weight["~ number ~"]/selected", "none");
- setprop("sim/weight["~ number ~"]/weight-lb", 0);
-
- }
- #var tank_submodel = func (pylone, select){
- #Drop Tanks
- #if(pylone == 2 and select == "Droptank"){ setprop("controls/armament/station[2]/release-droptank", 1);}
- #if(pylone == 3 and select == "Droptank"){ setprop("controls/armament/station[3]/release-droptank", 1);}
- #if(pylone == 4 and select == "Droptank"){ setprop("controls/armament/station[4]/release-droptank", 1);}
- #}
|