Special Aircraft Service

Please login or register.

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

Author Topic: Turn gunsight reticle on/off and brightness  (Read 9161 times)

0 Members and 1 Guest are viewing this topic.

marcost

  • Modder
  • member
  • Offline Offline
  • Posts: 1088
  • Keep calm and run away
Turn gunsight reticle on/off and brightness
« on: May 01, 2015, 09:56:50 AM »

Hi all

Changes function of the reticle brightness control introduced in 4.12 to toggle between four settings:

Reticle off
Low intensity
Normal intensity
High intensity

Add folder to Mods folder then bind a key or button in Controls to 'Toggle Reticle Brightness'

https://www.mediafire.com/download/acday7c5wcf3s7n/!Mart_reticle_brightness.rar


Unmodded has 9 brightness settings but no 'off'. I wanted the immersion of turning on the reticle when going into battle  ;)

Start-up brightness is set in another class so each mission begins on 'default' brightness. Would be better if it started 'off', maybe that is phase two.


Regards,

M
Logged

Kopfdorfer

  • member
  • Offline Offline
  • Posts: 2156
  • Potez 63.11 France's most significant AC in 1940
Re: Turn gunsight reticle on/off and brightness
« Reply #1 on: May 01, 2015, 11:43:51 AM »

Nice touch Marcost ,


Hope this gets picked up for th enext HSFX package.

Kopfdorfer
Logged

vpmedia

  • Modder
  • member
  • Offline Offline
  • Posts: 6652
  • www.vpmedia.hu/il2
    • VPMEDIA SKINS
Re: Turn gunsight reticle on/off and brightness
« Reply #2 on: May 02, 2015, 09:22:00 AM »

Thanks! Being able to activate the gunsight before battle definitely adds to the immersion.

PA_Willy

  • member
  • Offline Offline
  • Posts: 775
Re: Turn gunsight reticle on/off and brightness
« Reply #3 on: May 02, 2015, 09:53:03 AM »

Thank you a lot!
Logged

lantanido

  • member
  • Offline Offline
  • Posts: 17
    • escuadron69
Re: Turn gunsight reticle on/off and brightness
« Reply #4 on: July 08, 2015, 02:16:44 PM »

Thanks you!
Logged

Catahoulak9

  • Modder
  • member
  • Offline Offline
  • Posts: 402
Re: Turn gunsight reticle on/off and brightness
« Reply #5 on: July 08, 2015, 09:22:04 PM »

Thank you marcost. I've been waiting over 10 years for this. Great job.
Logged

karo

  • member
  • Offline Offline
  • Posts: 111
Re: Turn gunsight reticle on/off and brightness
« Reply #6 on: October 17, 2015, 12:56:44 PM »

Splendid mod! Thanks ;)
Logged

darky1958

  • member
  • Offline Offline
  • Posts: 333
  • Ne discere cessa.....
Re: Turn gunsight reticle on/off and brightness
« Reply #7 on: August 28, 2017, 07:05:24 PM »

Hi Marcost
Great job... 4.10  please!?
Regards
Darky
Logged

whistler

  • Modder
  • member
  • Offline Offline
  • Posts: 2784
Re: Turn gunsight reticle on/off and brightness
« Reply #8 on: February 17, 2018, 09:49:14 AM »

[...] Start-up brightness is set in another class so each mission begins on 'default' brightness. Would be better if it started 'off', maybe that is phase two. [...]

I agree marcost, the reticle should be off by default, at least when starting a scramble mission. I always forget I have this mod installed until I play night missions and only then I turn it off completely or set it to very dim when in combat. Do not link it to engine being on/off! remember in the Dunkirk movie that Spit taking down the Stuka while gliding 8)

EDIT: Do not link it to engine being on/off! >>> Unless you can detect the aircraft is grounded, that could work beautifully

What a nice mod this is. Thank you. Bring on phase two!
Logged
NG-HUD v3.6.1 | NG-MAP v3.2 | NG-CAM v2.0 | NG-PAL v1.2: https://www.sas1946.com/main/index.php/board,93.0.html

ianp

  • member
  • Offline Offline
  • Posts: 74
  • If the mind is blind the eyes can't see. ⛔🌏⛔
Re: Turn gunsight reticle on/off and brightness
« Reply #9 on: February 28, 2018, 05:38:55 PM »

Thank-you, good to have.
Logged
Earths atmosphere and the so called vacuum of space cannot exist side by side without solid separation, where is it?

Atoka220

  • Bomber
  • Modder
  • member
  • Offline Offline
  • Posts: 804
Re: Turn gunsight reticle on/off and brightness
« Reply #10 on: March 02, 2018, 11:38:29 AM »

Indeed really nice to have

I just find the reticle too bright. Even at noon in the mediterranean dim is enough for me, and it's hard to use at night, so can you lower brightness a bit marcost? Or anyone
Logged
There are 2 certain things in life: Death and CTDs

WxTech

  • Modder
  • member
  • Offline Offline
  • Posts: 5962
Re: Turn gunsight reticle on/off and brightness
« Reply #11 on: October 31, 2020, 07:05:09 PM »

If you want to have the reticle off at mission start always, simply set

reticleBrightness = 0.0F;

in the CockpitPilot(String s, String sl) method in CockpitPilot.java.

It's that simple. No need to have an entry of any sort in [Mods] in conf.ini. As long as you're content to always have the reticle off at mission start. I am, and so I use this. If any modder wants to release a version so altered, please have at it!

Following is all code (entire methods) in CockpitPilot.java pertaining to or containing reticle brightness control for this mod. I highlight the relevant line that sets the reticle as OFF at mission start with "<<<<<<--------------------------------------".

Code: [Select]
    public void toggleReticleBrightness()
    {
        toggleReticleBrightness(null);
    }

    public void toggleReticleBrightness(String s)
    {
        int i = -1;
        if(s == null)
            i = super.mesh.materialFind(getReticleMatName());
        else
            i = super.mesh.materialFind(s);
        if(i != -1)
        {
            Mat mat = super.mesh.material(i);
            mat.setLayer(0);
            if(s == null)
                reticleBrightness += 0.6F;  //increment by 0.6 each key press; 0, 0.6, 1.2, 1.8, 2.4(goes to 0); off, dim, norm, brt, off
            if(reticleBrightness >= 1.9F)
                reticleBrightness = 0.0F;
            float f = reticleBrightness * 0.75F;  //bright = 1.8 * 0.75 = 1.35
            if(f == 0.0F)
                f = 0.0F;
            mat.set((byte)24, f);
            if((int)(reticleBrightness * 5F + 1.0F) == 1)  //0.0 * 5 + 1 = 1
                HUD.log("Gunsight    Off");
            if((int)(reticleBrightness * 5F + 1.0F) == 10)  //1.8 * 5 + 1 = 10
                HUD.log("Gunsight  Bright");
            if((int)(reticleBrightness * 5F + 1.0F) == 7)  //1.2 * 5 + 1 = 7
                HUD.log("Gunsight Normal");
            if((int)(reticleBrightness * 5F + 1.0F) == 4)  //0.6 * 5 + 1 = 4
                HUD.log("Gunsight    Dim");
        }
    }

    public String getReticleMatName()
    {
        return "Reticle";
    }

    public float getReticleBrightness()
    {
        return reticleBrightness;
    }

    public void setReticleBrightness(float f)
    {
        reticleBrightness = f - 0.2F;
        toggleReticleBrightness();
    }

    public CockpitPilot(String s, String s1)
    {
        super(s, s1);
        stepAzimut = 45F;
        stepTangage = 30F;
        minMaxAzimut = 145F;
        maxTangage = 90F;
        minTangage = -60F;
        cameraCenter = new Point3d();
        isSimpleUse = false;
        normZN = -1F;
        gsZN = -1F;
        normZNs = null;
        reticleBrightness = 0.0F;  //makes reticle off on mission start <<<<<----------------------------------------
        pictBall = 0.0D;
        oldBallTime = 0L;
        HookNamed hooknamed = new HookNamed(super.mesh, "CAMERA");
        Loc loc = new Loc();
        hooknamed.computePos(this, super.pos.getAbs(), loc);
        loc.get(cameraCenter);
        setCameraOffset();
        try
        {
            HookNamed hooknamed1 = new HookNamed(super.mesh, "CAMERAAIM");
            loc.set(0.0D, 0.0D, 0.0D, 0.0F, 0.0F, 0.0F);
            hooknamed1.computePos(this, super.pos.getAbs(), loc);
            cameraAim = new Point3d();
            loc.get(cameraAim);
        }
        catch(Exception exception)
        {
            System.out.println(exception.getMessage());
            exception.printStackTrace();
        }
        try
        {
            HookNamed hooknamed2 = new HookNamed(super.mesh, "CAMERAUP");
            loc.set(0.0D, 0.0D, 0.0D, 0.0F, 0.0F, 0.0F);
            hooknamed2.computePos(this, super.pos.getAbs(), loc);
            cameraUp = new Point3d();
            loc.get(cameraUp);
        }
        catch(Exception exception1) { }
        super.pos.setBase(aircraft(), new Cockpit.HookOnlyOrient(), false);
        interpPut(new Interpolater(), "CockpitPilot", Time.current(), null);
        if(HookPilot.current != null)
            HookPilot.current.doUp(false);
        Main3D.cur3D().camera3D.ZNear = 1.2F;
        getZNearLimits();

        try
        {
            Mat mat = super.mesh.material(super.mesh.materialFind(getReticleMatName()));
            mat.setLayer(0);
            mat.set((byte)24, reticleBrightness);
        }
        catch(Throwable throwable) { }
    }
Logged
Great minds discuss ideas. Average minds discuss events. Small minds discuss people. - Hyman Rickover (but probably predating his use.)
Pages: [1] 2   Go Up
 

Page created in 0.039 seconds with 24 queries.