Special Aircraft Service

Please login or register.

Login with username, password and session length
Advanced search  
Pages: [1]   Go Down

Author Topic: Problem after weapon loadout edits  (Read 1102 times)

0 Members and 1 Guest are viewing this topic.

vonOben

  • Modder
  • member
  • Offline Offline
  • Posts: 885
  • Wer den Tod fürchtet, hat das Leben verloren.
    • vonOben's Flight Sim Mods
Problem after weapon loadout edits
« on: April 26, 2019, 06:12:06 AM »

Hi

I've made some loadout edits in a class file, but I get some strange behaviour when trying to bomb.

When I press the drop bombs key, 2 bombs are dropped but the "original" bombs are still displayed attached to the aircraft.
And if I press the bomb key several times the same two bombs are dropped over and over again.

Any ideas what might be wrong?

I had no problems compiling and the log file shows no Java errors.


The Java code:

Code: [Select]
Aircraft.weaponTriggersRegister(class1, new int[] {
            0, 0, 10, 10, 3, 3, 3, 3, 3, 3,
            3, 3, 3, 3, 3, 3
        });
        Aircraft.weaponHooksRegister(class1, new String[] {
            "_MGUN01", "_MGUN02", "_MGUN03", "_MGUN04", "_ExternalBomb01", "_ExternalBomb02", "_ExternalBomb03", "_ExternalBomb04", "_ExternalBomb05", "_ExternalBomb06",
            "_ExternalBomb07", "_ExternalBomb08", "_ExternalBomb09", "_ExternalBomb10", "_ExternalBomb11", "_ExternalBomb12"
        });
        try
        {
            ArrayList arraylist = new ArrayList();
            Property.set(class1, "weaponsList", arraylist);
            HashMapInt hashmapint = new HashMapInt();
            Property.set(class1, "weaponsMap", hashmapint);
            byte byte0 = 16;
            Aircraft._WeaponSlot a_lweaponslot[] = new Aircraft._WeaponSlot[byte0];
            String s = "default";
            a_lweaponslot = new Aircraft._WeaponSlot[byte0];
            a_lweaponslot[0] = null;
            a_lweaponslot[1] = null;
            a_lweaponslot[2] = new Aircraft._WeaponSlot(10, "MGunVikkersKt", 500);
            a_lweaponslot[3] = new Aircraft._WeaponSlot(10, "MGunVikkersKt", 500);
            a_lweaponslot[4] = null;
            a_lweaponslot[5] = null;
            a_lweaponslot[6] = null;
            a_lweaponslot[7] = null;
            a_lweaponslot[8] = null;
            a_lweaponslot[9] = null;
            a_lweaponslot[10] = null;
            a_lweaponslot[11] = null;
            a_lweaponslot[12] = null;
            a_lweaponslot[13] = null;
            a_lweaponslot[14] = null;
            a_lweaponslot[15] = null;           
            arraylist.add(s);
            hashmapint.put(Finger.Int(s), a_lweaponslot);
            s = "8x50kg";
            a_lweaponslot = new Aircraft._WeaponSlot[byte0];
            a_lweaponslot[0] = null;
            a_lweaponslot[1] = null;
            a_lweaponslot[2] = new Aircraft._WeaponSlot(10, "MGunVikkersKt", 500);
            a_lweaponslot[3] = new Aircraft._WeaponSlot(10, "MGunVikkersKt", 500);
            a_lweaponslot[4] = new Aircraft._WeaponSlot(3, "BombGun50kg", 1);
            a_lweaponslot[5] = new Aircraft._WeaponSlot(3, "BombGun50kg", 1);
            a_lweaponslot[6] = new Aircraft._WeaponSlot(3, "BombGun50kg", 1);
            a_lweaponslot[7] = new Aircraft._WeaponSlot(3, "BombGun50kg", 1);
            a_lweaponslot[8] = null;
            a_lweaponslot[9] = null;
            a_lweaponslot[10] = new Aircraft._WeaponSlot(3, "BombGun50kg", 1);
            a_lweaponslot[11] = new Aircraft._WeaponSlot(3, "BombGun50kg", 1);
            a_lweaponslot[12] = new Aircraft._WeaponSlot(3, "BombGun50kg", 1);
            a_lweaponslot[13] = new Aircraft._WeaponSlot(3, "BombGun50kg", 1);
            a_lweaponslot[14] = null;
            a_lweaponslot[15] = null;           
            arraylist.add(s);
            hashmapint.put(Finger.Int(s), a_lweaponslot);
            s = "4x100kg+8x50kg";
            a_lweaponslot = new Aircraft._WeaponSlot[byte0];
            a_lweaponslot[0] = null;
            a_lweaponslot[1] = null;
            a_lweaponslot[2] = new Aircraft._WeaponSlot(10, "MGunVikkersKt", 500);
            a_lweaponslot[3] = new Aircraft._WeaponSlot(10, "MGunVikkersKt", 500);
            a_lweaponslot[4] = new Aircraft._WeaponSlot(3, "BombGun50kg", 1);
            a_lweaponslot[5] = new Aircraft._WeaponSlot(3, "BombGun50kg", 1);
            a_lweaponslot[6] = new Aircraft._WeaponSlot(3, "BombGun100kg", 1);
            a_lweaponslot[7] = new Aircraft._WeaponSlot(3, "BombGun100kg", 1);
            a_lweaponslot[8] = new Aircraft._WeaponSlot(3, "BombGun50kg", 1);
            a_lweaponslot[9] = new Aircraft._WeaponSlot(3, "BombGun50kg", 1);
            a_lweaponslot[10] = new Aircraft._WeaponSlot(3, "BombGun50kg", 1);
            a_lweaponslot[11] = new Aircraft._WeaponSlot(3, "BombGun50kg", 1);
            a_lweaponslot[12] = new Aircraft._WeaponSlot(3, "BombGun100kg", 1);
            a_lweaponslot[13] = new Aircraft._WeaponSlot(3, "BombGun100kg", 1);
            a_lweaponslot[14] = new Aircraft._WeaponSlot(3, "BombGun50kg", 1);
            a_lweaponslot[15] = new Aircraft._WeaponSlot(3, "BombGun50kg", 1);
            arraylist.add(s);
            hashmapint.put(Finger.Int(s), a_lweaponslot);
            s = "4x250kg";
            a_lweaponslot = new Aircraft._WeaponSlot[byte0];
            a_lweaponslot[0] = null;
            a_lweaponslot[1] = null;
            a_lweaponslot[2] = new Aircraft._WeaponSlot(10, "MGunVikkersKt", 500);
            a_lweaponslot[3] = new Aircraft._WeaponSlot(10, "MGunVikkersKt", 500);
            a_lweaponslot[4] = null;
            a_lweaponslot[5] = null;
            a_lweaponslot[6] = new Aircraft._WeaponSlot(3, "BombGun100kg", 1);
            a_lweaponslot[7] = new Aircraft._WeaponSlot(3, "BombGun100kg", 1);
            a_lweaponslot[8] = null;
            a_lweaponslot[9] = null;
            a_lweaponslot[10] = null;
            a_lweaponslot[11] = null;
            a_lweaponslot[12] = new Aircraft._WeaponSlot(3, "BombGun100kg", 1);
            a_lweaponslot[13] = new Aircraft._WeaponSlot(3, "BombGun100kg", 1);
            a_lweaponslot[14] = null;
            a_lweaponslot[15] = null;           
            arraylist.add(s);
            hashmapint.put(Finger.Int(s), a_lweaponslot);
            s = "none";
            a_lweaponslot = new Aircraft._WeaponSlot[byte0];
            a_lweaponslot[0] = null;
            a_lweaponslot[1] = null;
            a_lweaponslot[2] = null;
            a_lweaponslot[3] = null;
            a_lweaponslot[4] = null;
            a_lweaponslot[5] = null;
            a_lweaponslot[6] = null;
            a_lweaponslot[7] = null;
            a_lweaponslot[8] = null;
            a_lweaponslot[9] = null;
            a_lweaponslot[10] = null;
            a_lweaponslot[11] = null;
            a_lweaponslot[12] = null;
            a_lweaponslot[13] = null;
            a_lweaponslot[14] = null;
            a_lweaponslot[15] = null;           
            arraylist.add(s);
            hashmapint.put(Finger.Int(s), a_lweaponslot);
        }
        catch(Exception exception) { }
    }
}


Thanks in advance for any help!

Best regards

vonOben
Logged
vonOben's Flight Sim Mods  http://vonoben.free.fr/ Twenty Years online January 3, 2022!

SAS~Storebror

  • Editor
  • member
  • Offline Offline
  • Posts: 23586
  • Taking a timeout
    • STFU
Re: Problem after weapon loadout edits
« Reply #1 on: April 26, 2019, 06:14:31 AM »

You've got unlimited weapons enabled in your difficulty settings.

]cheers[
Mike
Logged
Don't split your mentality without thinking twice.

vonOben

  • Modder
  • member
  • Offline Offline
  • Posts: 885
  • Wer den Tod fürchtet, hat das Leben verloren.
    • vonOben's Flight Sim Mods
Re: Problem after weapon loadout edits
« Reply #2 on: April 27, 2019, 03:34:40 AM »

Thanks Mike!

Yes, that was the problem  :-[

Working ok now with unlimited weapons disabled!  :)

Best regards

vonOben
Logged
vonOben's Flight Sim Mods  http://vonoben.free.fr/ Twenty Years online January 3, 2022!

SAS~Ghost129er

  • SAS Team
  • member
  • Offline Offline
  • Posts: 2096
  • SAS Certified Lurk
Re: Problem after weapon loadout edits
« Reply #3 on: April 27, 2019, 04:19:34 AM »

LMAO.  ;D
Logged
Current activity: Giving his E46 330ci some TLC.
Pages: [1]   Go Up
 

Page created in 0.088 seconds with 27 queries.