Special Aircraft Service

Please login or register.

Login with username, password and session length
Advanced search  
Pages: 1 2 3 4 [5] 6   Go Down

Author Topic: Random Failures Mod public beta 0.5  (Read 21994 times)

0 Members and 1 Guest are viewing this topic.

Tran Long

  • member
  • Offline Offline
  • Posts: 144
  • KEYBOARD ARMY
Re: Random Failures Mod public beta 0.5
« Reply #48 on: December 31, 2013, 01:17:37 AM »

Very nice MR griff, thank you :D
Logged

SAS~Poltava

  • Avid FMB user
  • SAS Honourable Member
  • member
  • Offline Offline
  • Posts: 3554
  • Help Ukraine fight
    • Check out my modded campaigns
Re: Random Failures Mod public beta 0.5
« Reply #49 on: December 31, 2013, 03:22:06 AM »

Super! Thanks!!!  ;D
Logged
You want to give financial support to a front line Ukraine unit fighting the Russian invaders? Paypal kyivragnarock@gmail.com

Epervier

  • 4.09 Guardian Angel !
  • SAS Team
  • member
  • Offline Offline
  • Posts: 9556
  • I'm French and Rebel_409! Nobody is perfect!
    • Some tinkering here
Re: Random Failures Mod public beta 0.5
« Reply #50 on: December 31, 2013, 03:57:03 AM »

link first post updated (tks to Griffon_301) !
Logged
If your results do not live up to your expectations, tell yourself that the great oak was once an acorn too. - Lao Zi -

Tran Long

  • member
  • Offline Offline
  • Posts: 144
  • KEYBOARD ARMY
Re: Random Failures Mod public beta 0.5
« Reply #51 on: January 01, 2014, 01:33:19 AM »

Could you make a version for 4.12, please?
Logged

Dataman

  • SAS~Tachikoma
  • member
  • Offline Offline
  • Posts: 212
Re: Random Failures Mod public beta 0.5
« Reply #52 on: April 12, 2014, 02:29:02 PM »

Could you make a version for 4.12, please?
I've been testing the current 4.10 version in 4.12.2 and I haven't run into any problems(or failures) yet. I'll report back once something happens.
Logged

jg1234

  • member
  • Offline Offline
  • Posts: 192
Re: Random Failures Mod public beta 0.5
« Reply #53 on: October 13, 2016, 12:39:07 PM »

I realize this is the first post on this thread in the past two years.

Maybe someone can help?

I am running DBW 1.71 with only a few mods including Plutonium Universal Max Effects.  When I try this mod it crashes as soon as the loading screen is done.

My questions are:

  • Is this mod compatible with Plutonium Effects ?
  • Do I need the AI Engine Mod 2.6 ? (Searched but couldn't find that by the way)
  • Do I need anything added to the conf file ?  The first post had some information but I thought that was for mission builders?

Any help is appreciated. Thanks - jg1234
Logged

max_thehitman

  • SAS~Area51
  • Modder
  • member
  • Offline Offline
  • Posts: 8976
  • Beer...Girls...IL2+Mods!
Re: Random Failures Mod public beta 0.5
« Reply #54 on: October 13, 2016, 07:50:13 PM »

I realize this is the first post on this thread in the past two years.

Maybe someone can help?

I am running DBW 1.71 with only a few mods including Plutonium Universal Max Effects.  When I try this mod it crashes as soon as the loading screen is done.

My questions are:

  • Is this mod compatible with Plutonium Effects ?
  • Do I need the AI Engine Mod 2.6 ? (Searched but couldn't find that by the way)
  • Do I need anything added to the conf file ?  The first post had some information but I thought that was for mission builders?

Any help is appreciated. Thanks - jg1234

The only way to find out would be to look into your log file to discover what is
making the game crash.
Search for Log file - https://www.sas1946.com/main/index.php/topic,19308.0.html

I do not use Plutinium but I read its very good, but heavy on the special effects and may be incompatible with
some other mods. Look into that Log File.

Logged
Everything I like is either illegal, immoral or fattening ! Welcome to SAS1946

jg1234

  • member
  • Offline Offline
  • Posts: 192
Re: Random Failures Mod public beta 0.5
« Reply #55 on: October 14, 2016, 07:22:37 AM »

Thanks max_thehitman,

I'll check the log files. I appreciate the link to that post.

Cheers - jg1234
Logged

Tokyo_Express_420

  • member
  • Offline Offline
  • Posts: 167
Re: Random Failures Mod public beta 0.5
« Reply #56 on: May 14, 2023, 07:26:47 AM »

Any news on this mod being adapted for 4.12?

Thanks,

- Tokyo Express
Logged

WxTech

  • Modder
  • member
  • Offline Offline
  • Posts: 6065
Re: Random Failures Mod public beta 0.5
« Reply #57 on: May 25, 2023, 01:10:26 PM »

Adapting code for other versions would be made easier if the modder provided annotated Java files of the classes altered. Having to work from the clean decompiled classfile, which does not include comments, makes it harder and less certain to find all the changes.

Which is the reason I tend to include my annotated Java files with my mods.
Logged
Great minds discuss ideas. Average minds discuss events. Small minds discuss people. - Hyman Rickover (but probably predating his use.)

WxTech

  • Modder
  • member
  • Offline Offline
  • Posts: 6065
Re: Random Failures Mod public beta 0.5
« Reply #58 on: May 25, 2023, 01:27:08 PM »

Only Aircraft.class is involved here, and a quick check of the java suggests it *should* be straightforward to implement this for other versions. It can be set up so as to be not in effect if one chooses, and hence act as though not even present at all.

This class is already touched by me for such things as the full throttle/carb cutout smoke, and more recently for the consideration of engine count as it applies to the size of a plane's ground impact fireball.
Logged
Great minds discuss ideas. Average minds discuss events. Small minds discuss people. - Hyman Rickover (but probably predating his use.)

WxTech

  • Modder
  • member
  • Offline Offline
  • Posts: 6065
Re: Random Failures Mod public beta 0.5
« Reply #59 on: May 25, 2023, 01:38:39 PM »

Here is what I've divined as the related code, after a quick overview:


Code: [Select]
    private boolean failedset;  //random failures mod
    private boolean fail;  //random failures mod
    private boolean failset;  //random failures mod

Code: [Select]
    public void rareAction(float f, boolean bool)
    {
        if(World.cur().diffCur.Reliability)
        {
            Random random = new Random();
            int i = random.nextInt(100);
            int FailRate = 20;
            if(Mission.cur() != null)
                FailRate = Mission.cur().sectFile().get("Mods", "FailureRate", 0);
            if(i < FailRate)
                randomfail();
            if(((Interpolate) (super.FM)).actor == World.getPlayerAircraft() && !failedset)
                setafail();
        }
    }

Code: [Select]
    private void randomfail()
    {
        Random random = new Random();
        int randomvalue = random.nextInt(1000);
        int enginenum = random.nextInt(3);
        int enginenumlog = enginenum + 1;
        float f = World.Rnd().nextFloat();
        float season = 0.0F;
        float enginerandom = (float)randomvalue - season;
        if(World.cur().camouflage == 2 || World.cur().camouflage == 1)
            season = 500F;
        else
            season = 0.0F;
        if(enginerandom == 10F)
        {
            ((FlightModelMain) (super.FM)).EI.engines[0].setEngineStops(this);
            super.playSound("weapon.MGunMk108s", true);
        }
        if(enginerandom == 150F)
        {
            ((FlightModelMain) (super.FM)).EI.engines[enginenum].setKillPropAngleDevice(this);
            if(((Interpolate) (super.FM)).actor == World.getPlayerAircraft())
            {
                HUD.log(AircraftHotKeys.hudLogWeaponId, "Failure: Engine " + enginenumlog + " Prop Angle Device Damaged!");
                super.playSound("weapon.MGunMk108s", true);
            }
        }
        if(enginerandom == 56F)
        {
            ((FlightModelMain) (super.FM)).EI.engines[enginenum].setCyliderKnockOut(this, 1);
            if(((Interpolate) (super.FM)).actor == World.getPlayerAircraft())
            {
                HUD.log(AircraftHotKeys.hudLogWeaponId, "Failure: Engine " + enginenumlog + " Cylinders Damaged!");
                super.playSound("weapon.MGunMk108s", true);
            }
        }
        if(enginerandom == 123F)
        {
            ((FlightModelMain) (super.FM)).EI.engines[0].setReadyness(this, f);
            if(((Interpolate) (super.FM)).actor == World.getPlayerAircraft())
            {
                HUD.log(AircraftHotKeys.hudLogWeaponId, "Failure: Engine " + enginenumlog + " Crank Case Damaged!");
                super.playSound("weapon.MGunMk108s", true);
            }
        }
        if(enginerandom == 19F)
        {
            ((FlightModelMain) (super.FM)).AS.hitEngine(this, enginenum, 2);
            if(((Interpolate) (super.FM)).actor == World.getPlayerAircraft())
            {
                HUD.log(AircraftHotKeys.hudLogWeaponId, "Failure: Engine " + enginenumlog + " Crank Case Damaged!");
                super.playSound("weapon.MGunMk108s", true);
            }
        }
        if(enginerandom == 11F)
        {
            ((FlightModelMain) (super.FM)).AS.hitEngine(this, enginenum, 3);
            if(((Interpolate) (super.FM)).actor == World.getPlayerAircraft())
            {
                HUD.log(AircraftHotKeys.hudLogWeaponId, "Failure: Engine " + enginenumlog + " Cylinders Damaged - Engine On Fire!");
                super.playSound("weapon.MGunMk108s", true);
            }
        }
        if(enginerandom == 145F)
        {
            ((FlightModelMain) (super.FM)).EI.engines[enginenum].setKillCompressor(this);
            if(((Interpolate) (super.FM)).actor == World.getPlayerAircraft())
            {
                HUD.log(AircraftHotKeys.hudLogWeaponId, "Failure: Engine " + enginenumlog + " Compressor Out!");
                super.playSound("weapon.MGunMk108s", true);
            }
        }
        if(enginerandom == 32F)
        {
            ((FlightModelMain) (super.FM)).EI.engines[enginenum].setMagnetoKnockOut(this, 0);
            if(((Interpolate) (super.FM)).actor == World.getPlayerAircraft())
            {
                HUD.log(AircraftHotKeys.hudLogWeaponId, "Failure: Engine " + enginenumlog + " Magneto #0 Destroyed!");
                super.playSound("weapon.MGunMk108s", true);
            }
        }
        if(enginerandom == 31F)
        {
            ((FlightModelMain) (super.FM)).EI.engines[enginenum].setMagnetoKnockOut(this, 1);
            if(((Interpolate) (super.FM)).actor == World.getPlayerAircraft())
            {
                HUD.log(AircraftHotKeys.hudLogWeaponId, "Failure: Engine " + enginenumlog + " Magneto #1 Destroyed!");
                super.playSound("weapon.MGunMk108s", true);
            }
        }
        if(enginerandom == 62F)
        {
            ((FlightModelMain) (super.FM)).AS.hitTank(this, 0, 1);
            ((FlightModelMain) (super.FM)).AS.doSetTankState(this, 0, 1);
        }
        if(enginerandom == 24F)
        {
            ((FlightModelMain) (super.FM)).AS.setOilState(this, enginenum, 1);
            if(((Interpolate) (super.FM)).actor == World.getPlayerAircraft())
                HUD.log(AircraftHotKeys.hudLogWeaponId, "Failure: Engine " + enginenumlog + " Oil Filter Damaged!");
        }
        if(enginerandom == 36F)
        {
            ((FlightModelMain) (super.FM)).AS.hitOil(this, enginenum);
            if(((Interpolate) (super.FM)).actor == World.getPlayerAircraft())
                HUD.log(AircraftHotKeys.hudLogWeaponId, "Failure: Engine " + enginenumlog + " Oil Tank Leak!");
        }
        if(enginerandom == 52F)
        {
            ((FlightModelMain) (super.FM)).CT.GearControl = f;
            ((FlightModelMain) (super.FM)).Gears.setHydroOperable(false);
            if(((Interpolate) (super.FM)).actor == World.getPlayerAircraft())
                HUD.log("Gear: Hydraulic system Failed!");
        }
    }

Code: [Select]
    private void setafail()
    {
        Random random = new Random();
        int enginenum = random.nextInt(3);
        int enginenumlog = enginenum + 1;
        float f = World.Rnd().nextFloat();
        int failtype = 0;
        if(Mission.cur() != null)
            failtype = Mission.cur().sectFile().get("Mods", "FailType", 0);
        if(Time.current() < (long)(Mission.cur().sectFile().get("Mods", "FailTimer", 0) * 60))
            fail = true;
        if(failtype > 0 && failtype == 1 && fail)
        {
            ((FlightModelMain) (super.FM)).EI.engines[0].setEngineStops(this);
            failedset = true;
        }
        if(failtype > 0 && failtype == 2 && fail)
        {
            ((FlightModelMain) (super.FM)).EI.engines[enginenum].setKillPropAngleDevice(this);
            HUD.log(AircraftHotKeys.hudLogWeaponId, "Failure: Engine " + enginenumlog + " Prop Angle Device Damaged!");
            super.playSound("weapon.MGunMk108s", true);
            failedset = true;
        }
        if(failtype > 0 && failtype == 3 && fail)
        {
            ((FlightModelMain) (super.FM)).EI.engines[enginenum].setCyliderKnockOut(this, 1);
            HUD.log(AircraftHotKeys.hudLogWeaponId, "Failure: Engine " + enginenumlog + " Cylinders Damaged!");
            super.playSound("weapon.MGunMk108s", true);
            failedset = true;
        }
        if(failtype > 0 && failtype == 4 && fail)
        {
            ((FlightModelMain) (super.FM)).EI.engines[0].setReadyness(this, f);
            HUD.log(AircraftHotKeys.hudLogWeaponId, "Failure: Engine " + enginenumlog + " Crank Case Damaged!");
            super.playSound("weapon.MGunMk108s", true);
            failedset = true;
        }
        if(failtype > 0 && failtype == 5 && fail)
        {
            ((FlightModelMain) (super.FM)).AS.hitEngine(this, enginenum, 2);
            HUD.log(AircraftHotKeys.hudLogWeaponId, "Failure: Engine " + enginenumlog + " Crank Case Damaged!");
            super.playSound("weapon.MGunMk108s", true);
            failedset = true;
        }
        if(failtype > 0 && failtype == 6 && fail)
        {
            ((FlightModelMain) (super.FM)).AS.hitEngine(this, enginenum, 3);
            HUD.log(AircraftHotKeys.hudLogWeaponId, "Failure: Engine " + enginenumlog + " Cylinders Damaged - Engine On Fire!");
            super.playSound("weapon.MGunMk108s", true);
            failedset = true;
        }
        if(failtype > 0 && failtype == 7 && fail)
        {
            ((FlightModelMain) (super.FM)).EI.engines[enginenum].setKillCompressor(this);
            HUD.log(AircraftHotKeys.hudLogWeaponId, "Failure: Engine " + enginenumlog + " Compressor Out!");
            super.playSound("weapon.MGunMk108s", true);
            failedset = true;
        }
        if(failtype > 0 && failtype == 8 && fail)
        {
            ((FlightModelMain) (super.FM)).EI.engines[enginenum].setMagnetoKnockOut(this, 0);
            HUD.log(AircraftHotKeys.hudLogWeaponId, "Failure: Engine " + enginenumlog + " Magneto #0 Destroyed!");
            super.playSound("weapon.MGunMk108s", true);
            failedset = true;
        }
        if(failtype > 0 && failtype == 9 && fail)
        {
            ((FlightModelMain) (super.FM)).EI.engines[enginenum].setMagnetoKnockOut(this, 1);
            HUD.log(AircraftHotKeys.hudLogWeaponId, "Failure: Engine " + enginenumlog + " Magneto #1 Destroyed!");
            super.playSound("weapon.MGunMk108s", true);
            failedset = true;
        }
        if(failtype > 0 && failtype == 10 && fail)
        {
            ((FlightModelMain) (super.FM)).AS.hitTank(this, 0, 1);
            ((FlightModelMain) (super.FM)).AS.doSetTankState(this, 0, 1);
            failedset = true;
        }
        if(failtype > 0 && failtype == 11 && fail)
        {
            ((FlightModelMain) (super.FM)).AS.setOilState(this, enginenum, 1);
            HUD.log(AircraftHotKeys.hudLogWeaponId, "Failure: Engine " + enginenumlog + " Oil Filter Damaged!");
            failedset = true;
        }
        if(failtype > 0 && failtype == 12 && fail)
        {
            ((FlightModelMain) (super.FM)).AS.hitOil(this, enginenum);
            HUD.log(AircraftHotKeys.hudLogWeaponId, "Failure: Engine " + enginenumlog + " Oil Tank Leak!");
            failedset = true;
        }
        if(failtype > 0 && failtype == 13 && fail)
        {
            ((FlightModelMain) (super.FM)).CT.GearControl = f;
            ((FlightModelMain) (super.FM)).Gears.setHydroOperable(false);
            HUD.log("Gear: Hydraulic system Failed!");
            failedset = true;
        }
    }
Logged
Great minds discuss ideas. Average minds discuss events. Small minds discuss people. - Hyman Rickover (but probably predating his use.)
Pages: 1 2 3 4 [5] 6   Go Up
 

Page created in 0.034 seconds with 26 queries.