Special Aircraft Service

Please login or register.

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

Author Topic: Is there a mod that allows the AI to open the canopy during takeoff and landing on the ground?  (Read 327 times)

0 Members and 1 Guest are viewing this topic.

zeke2122

  • member
  • Offline Offline
  • Posts: 3

I would like to modify the AI to open the canopy when taking off and landing at an airfield, just as it does when taking off and landing on an aircraft carrier. Is there such a mod?

Logged

WxTech

  • Modder
  • member
  • Offline Offline
  • Posts: 6066

I did a search on "ground automatic canopy opening" and found that the Bloch MB-174 incorporates this feature. From the plane's class (MB_174xyz.class) we see the operative code to enable this as shown below. For any desired plane having an openable canopy this code could be incorporated. It might be best to do this on a plane by plane basis, although it's certainly laborious if many planes are desired to feature this.

Code: [Select]
public void setOnGround(Point3d point3d, Orient orient, Vector3d vector3d)
{
super.setOnGround(point3d, orient, vector3d);
if(super.FM.isPlayers())
{
((FlightModelMain) (super.FM)).CT.bHasCockpitDoorControl = true;
((FlightModelMain) (super.FM)).CT.dvCockpitDoor = 0.5F;
((FlightModelMain) (super.FM)).CT.cockpitDoorControl = 1.0F;
}
}


public void update(float f)
{
.
.
.
.
if(!super.FM.isPlayers() && ((FlightModelMain) (super.FM)).Gears.onGround())
if(((FlightModelMain) (super.FM)).EI.engines[1].getRPM() < 100F)
((FlightModelMain) (super.FM)).CT.cockpitDoorControl = 1.0F;
else
((FlightModelMain) (super.FM)).CT.cockpitDoorControl = 0.0F;
.
.
.
.
}

Method setOnGround() establishes when the gear is on the ground for all planes. Additionally for the player, it sets the canopy to open when the plane's gear is in contact with the ground. And I think it sets for the player a slower sliding speed while opening /closing (dvCockpitDoor = 0.5 versus 0.75 as set in the daughter class and used by AI.)

The important bit is in method update(), where a continuous check is performed on AI planes to see if the gear is on the ground. If so, AND if the motor RPM is less than 100%, the canopy is set to open. In all other instances it's set to close.


I can see how this might be refined. For instance, we might like to have the canopy open and close at some point well after take-off and/or well before landing. Additional checks on one or both of airspeed and height above ground would be necessary to incorporate. I'll do a class search to see if any plane already does anything like this...
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: 6066

One potential concern is the behaviour of the canopy in recorded tracks...
Logged
Great minds discuss ideas. Average minds discuss events. Small minds discuss people. - Hyman Rickover (but probably predating his use.)

HaFu1939

  • member
  • Offline Offline
  • Posts: 414

The behaviour of canopies in recorded tracks is terrible, unfortunately there is nothing you can do about it. Except of dividing the records into multiple sections after each canopy closing 😊. The last mod pack which solved this problem was HSFX.



Didn't I say that this is a matter of mismatching flight models already?
Nice to know that VP, purely by accident, has the same old "non opening canopy" flight models like you've had when you recorded your tracks.
No, we are not gonna change that in BAT.
We've added opening canopies to the regarding planes for a reason.

]cheers[
Mike

It is really necessary to consider whether a new feature like this wouldn’t problematize everyday use of e.g. B.A.T.
Logged

Epervier

  • 4.09 Guardian Angel !
  • SAS Team
  • member
  • Offline Offline
  • Posts: 9556
  • I'm French and Rebel_409! Nobody is perfect!
    • Some tinkering here

I did a search on "ground automatic canopy opening" and found that the Bloch MB-174 ...
For several years now, this method has been integrated into all the aircraft I've distributed for the 409.
Logged
If your results do not live up to your expectations, tell yourself that the great oak was once an acorn too. - Lao Zi -

Frankiek

  • SAS Team
  • member
  • Offline Offline
  • Posts: 3058

I just hate having the canopy open at the start of the mission as I always forgot to close it before take off  :P and notice is open only once the canopy is lost and plane start behaving strangely..... resulting in mission abort and restart  ]banghead[ 
Logged

Epervier

  • 4.09 Guardian Angel !
  • SAS Team
  • member
  • Offline Offline
  • Posts: 9556
  • I'm French and Rebel_409! Nobody is perfect!
    • Some tinkering here

This is true for aircraft with the “destruction of open canopy on take-off/in-flight” management.
But if you look closely, few planes have it.
What's more, the “setOnGround” method is not added to the code if the player's aircraft does not have an openable canopy in cockpit view.  ;)
It has not been added for naval aircraft either, as this is already covered by the generic IL-2 code.
Logged
If your results do not live up to your expectations, tell yourself that the great oak was once an acorn too. - Lao Zi -

zeke2122

  • member
  • Offline Offline
  • Posts: 3
Logged

Esv_Pato

  • member
  • Offline Offline
  • Posts: 36
  • https://www.facebook.com/groups/476710667557897

Could it be done the other way around? When recording a game, the canopies and doors could not be opened. Things would be lost and other things gained
Logged
Pages: [1]   Go Up
 

Page created in 0.061 seconds with 27 queries.