Special Aircraft Service

Please login or register.

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

Author Topic: New Auto Pilot?  (Read 4603 times)

0 Members and 2 Guests are viewing this topic.

Roger Smith

  • "Cast in the name of God, ye not guilty" -Big O Boot up message
  • member
  • Offline Offline
  • Posts: 946
  • HgZ? He's just another Jason Beck
New Auto Pilot?
« on: April 09, 2012, 08:03:00 PM »

I want an autopilot that keeps the plane straight and level, not follow waypoints. is that possible?
Logged

benitomuso

  • SAS Team
  • member
  • Offline Offline
  • Posts: 2587
  • P.A.L.
Re: New Auto Pilot?
« Reply #1 on: April 09, 2012, 08:11:34 PM »

Yes,
             it's quite possible. Just extending the Level Stabilizer that some planes have implemented. I can try to make it one of these days.

  Regards,
                        Pablo
Logged

Killer Ghost

  • Jet Member
  • member
  • Offline Offline
  • Posts: 309
  • Oorah
Re: New Auto Pilot?
« Reply #2 on: April 09, 2012, 08:24:30 PM »

The problem with the level stab is that my plane will still sideslip, maybe because of the propeller. But more aircraft need it, it helps out with bombing and long missions so much.
Logged

Verhängnis

  • Unofficial Heinkel Fan
  • Modder
  • member
  • Offline Offline
  • Posts: 1494
Re: New Auto Pilot?
« Reply #3 on: April 09, 2012, 08:31:03 PM »

I believe there is a tutorial over at Freemodding on implementing level stabilizers into the classfile.
Logged

Roger Smith

  • "Cast in the name of God, ye not guilty" -Big O Boot up message
  • member
  • Offline Offline
  • Posts: 946
  • HgZ? He's just another Jason Beck
Re: New Auto Pilot?
« Reply #4 on: April 09, 2012, 09:10:38 PM »

I believe there is a tutorial over at Freemodding on implementing level stabilizers into the classfile.

I now have found it but how do I work with this thing? where is it supposed to go?

Code: [Select]
// Decompiled by DJ v3.10.10.93 Copyright 2007 Atanas Neshkov Date: 23/04/2011 11:00:14 a.m.
// Home Page: http://members.fortunecity.com/neshkov/dj.html http://www.neshkov.com/dj.html - Check often for new version!
// Decompiler options: packimports(3)
// Source File Name: P_36AT.java

package com.maddox.il2.objects.air;

import com.maddox.JGP.Vector3d;
import com.maddox.il2.engine.Config;
import com.maddox.il2.engine.HierMesh;
import com.maddox.il2.fm.*;
import com.maddox.il2.game.Main3D;
import com.maddox.il2.objects.Wreckage;
import com.maddox.util.HashMapInt;
import java.util.ArrayList;

import java.io.IOException;
import com.maddox.rts.*;

// Referenced classes of package com.maddox.il2.objects.air:
// P_36, PaintSchemeFMPar01, PaintSchemeFMPar06, TypeStormovik,
// Aircraft, Cockpit, NetAircraft

public class P_36AT extends P_36
implements TypeStormovik, TypeBomber
{

public P_36AT()
{
kangle = 0.0F;
}

public void moveCockpitDoor(float f1)
{
resetYPRmodifier();
hierMesh().chunkSetAngles("Blister1_D0", 0.0F, Aircraft.cvt(f1, 0.01F, 0.99F, 0.0F, 120F), 0.0F);
if(Config.isUSE_RENDER())
{
if(Main3D.cur3D().cockpits != null && Main3D.cur3D().cockpits[0] != null)
Main3D.cur3D().cockpits[0].onDoorMoved(f1);
setDoorSnd(f1);
}
}

public void update(float f1)
{
for(int i = 1; i < 12; i++)
hierMesh().chunkSetAngles("Water" + i + "_D0", 0.0F, -10F * kangle, 0.0F);

kangle = 0.95F * kangle + 0.05F * FM.EI.engines[0].getControlRadiator();
super.update(f1);
if((double)FM.CT.getCockpitDoor() > 0.20000000000000001D && bHasBlister && FM.getSpeedKMH() > fMaxKMHSpeedForOpenCanopy && hierMesh().chunkFindCheck("Blister1_D0") != -1)
{
hierMesh().hideSubTrees("Blister1_D0");
Wreckage wreckage = new Wreckage(this, hierMesh().chunkFind("Blister1_D0"));
wreckage.collide(false);
Vector3d vector3d = new Vector3d();
vector3d.set(FM.Vwld);
wreckage.setSpeed(vector3d);
bHasBlister = false;
FM.CT.bHasCockpitDoorControl = false;
FM.setGCenter(-0.3F);
}
}


private static float f;
public boolean bHasBlister;
private float fMaxKMHSpeedForOpenCanopy;
private float kangle;



public boolean typeBomberToggleAutomation() {
return false;
}

public void typeBomberAdjDistanceReset() {
/* empty */
}

public void typeBomberAdjDistancePlus() {
/* empty */
}

public void typeBomberAdjDistanceMinus() {
/* empty */
}

public void typeBomberAdjSideslipReset() {
/* empty */
}

public void typeBomberAdjSideslipPlus() {
/* empty */
}

public void typeBomberAdjSideslipMinus() {
/* empty */
}

public void typeBomberAdjAltitudeReset() {
/* empty */
}

public void typeBomberAdjAltitudePlus() {
/* empty */
}

public void typeBomberAdjAltitudeMinus() {
/* empty */
}

public void typeBomberAdjSpeedReset() {
/* empty */
}

public void typeBomberAdjSpeedPlus() {
/* empty */
}

public void typeBomberAdjSpeedMinus() {
/* empty */
}

public void typeBomberUpdate(float f) {
/* empty */
}

public void typeBomberReplicateToNet(NetMsgGuaranted netmsgguaranted)
throws IOException {
/* empty */
}

public void typeBomberReplicateFromNet(NetMsgInput netmsginput)
throws IOException {
/* empty */
}



static
{
Class class1 = com.maddox.il2.objects.air.P_36AT.class;
new NetAircraft.SPAWN(class1);
Property.set(class1, "iconFar_shortClassName", "P-36AT");
Property.set(class1, "meshName", "3DO/Plane/P-36AT(Multi1)/hier.him");
Property.set(class1, "PaintScheme", new PaintSchemeFMPar01());
Property.set(class1, "meshName_us", "3DO/Plane/P-36AT(USA)/hier.him");
Property.set(class1, "PaintScheme_us", new PaintSchemeFMPar06());
Property.set(class1, "yearService", 1939F);
Property.set(class1, "yearExpired", 1950.5F);
Property.set(class1, "FlightModel", "FlightModels/P-36AT.fmd:P36AT_FM");
Property.set(class1, "cockpitClass", new Class[] {
com.maddox.il2.objects.air.CockpitP_36X.class
});
Aircraft.weaponTriggersRegister(class1, new int[] {
0, 0, 0, 0, 0, 0, 3, 9, 0, 0
});
Aircraft.weaponHooksRegister(class1, new String[] {
"_MGUN01", "_MGUN02", "_MGUN03", "_MGUN04", "_MGUN05", "_MGUN06", "_ExternalBomb01", "_ExternalBomb02", "_ExternalDev01", "_ExternalDev02"
});
try
{
ArrayList arraylist = new ArrayList();
Property.set(class1, "weaponsList", arraylist);
HashMapInt hashmapint = new HashMapInt();
Property.set(class1, "weaponsMap", hashmapint);
byte byte0 = 10;
Aircraft._WeaponSlot a_lweaponslot[] = new Aircraft._WeaponSlot[byte0];
String s = "default";
a_lweaponslot = new Aircraft._WeaponSlot[byte0];
a_lweaponslot[0] = new Aircraft._WeaponSlot(0, "MGunBrowning303k", 500);
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;
arraylist.add(s);
hashmapint.put(Finger.Int(s), a_lweaponslot);
s = "1XU.S.250lbBomb";
a_lweaponslot = new Aircraft._WeaponSlot[byte0];
a_lweaponslot[0] = new Aircraft._WeaponSlot(0, "MGunBrowning303k", 500);
a_lweaponslot[1] = null;
a_lweaponslot[2] = null;
a_lweaponslot[3] = null;
a_lweaponslot[4] = null;
a_lweaponslot[5] = null;
a_lweaponslot[6] = new Aircraft._WeaponSlot(3, "BombGun250lbs", 1);
a_lweaponslot[7] = null;
a_lweaponslot[8] = new Aircraft._WeaponSlot(3, "PylonP39PLN1", 1);
a_lweaponslot[9] = null;
arraylist.add(s);
hashmapint.put(Finger.Int(s), a_lweaponslot);
s = "Drop Tank";
a_lweaponslot = new Aircraft._WeaponSlot[byte0];
a_lweaponslot[0] = new Aircraft._WeaponSlot(0, "MGunBrowning303k", 500);
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] = new Aircraft._WeaponSlot(3, "PylonP39PLN1", 1);
a_lweaponslot[9] = new Aircraft._WeaponSlot(3, "FuelTankGun_Tank75gal", 1);
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;
arraylist.add(s);
hashmapint.put(Finger.Int(s), a_lweaponslot);
}
catch(Exception exception) { }
}
}
Logged

Verhängnis

  • Unofficial Heinkel Fan
  • Modder
  • member
  • Offline Offline
  • Posts: 1494
Re: New Auto Pilot?
« Reply #5 on: April 09, 2012, 09:13:13 PM »

Well the classfile, assuming you've compiled it, is hashed and placed anywhere in the MODS>MyLevelStabiliserMod/
Logged

Roger Smith

  • "Cast in the name of God, ye not guilty" -Big O Boot up message
  • member
  • Offline Offline
  • Posts: 946
  • HgZ? He's just another Jason Beck
Re: New Auto Pilot?
« Reply #6 on: April 09, 2012, 09:44:32 PM »

Well the classfile, assuming you've compiled it, is hashed and placed anywhere in the MODS>MyLevelStabiliserMod/

I have no idea
Logged

Wildchild

  • member
  • Offline Offline
  • Posts: 993
  • Bf 109 Killer
    • This is my professional racing page. Please check it out!
Re: New Auto Pilot?
« Reply #7 on: April 09, 2012, 09:50:57 PM »

The problem with the level stab is that my plane will still sideslip, maybe because of the propeller. But more aircraft need it, it helps out with bombing and long missions so much.

Trimming your rudder helps ;)
Logged

Verhängnis

  • Unofficial Heinkel Fan
  • Modder
  • member
  • Offline Offline
  • Posts: 1494
Re: New Auto Pilot?
« Reply #8 on: April 09, 2012, 10:21:55 PM »

Well the classfile, assuming you've compiled it, is hashed and placed anywhere in the MODS>MyLevelStabiliserMod/

I have no idea

Well it would help if you actually read the tutorials. ::)
Logged

smg13

  • member
  • Offline Offline
  • Posts: 56
Re: New Auto Pilot?
« Reply #9 on: April 10, 2012, 01:10:33 AM »

I don't exactly remember which mod I have that gives me a level autopilot... I think it is this one:

@edit: Dead link removed

I'll check tomorrow and see which one is it... it works really well, only needs a little bit of trim for rudder.
Logged

Roger Smith

  • "Cast in the name of God, ye not guilty" -Big O Boot up message
  • member
  • Offline Offline
  • Posts: 946
  • HgZ? He's just another Jason Beck
Re: New Auto Pilot?
« Reply #10 on: April 10, 2012, 06:05:16 AM »

Well the classfile, assuming you've compiled it, is hashed and placed anywhere in the MODS>MyLevelStabiliserMod/

I have no idea

Well it would help if you actually read the tutorials. ::)

I did, it just pretty much read "here's a bunch of numbers, so here it is"

I don't exactly remember which mod I have that gives me a level autopilot... I think it is this one:

@edit: Dead link removed

I'll check tomorrow and see which one is it... it works really well, only needs a little bit of trim for rudder.

I saw that too but Megaupload is FUBAR
Logged

Verhängnis

  • Unofficial Heinkel Fan
  • Modder
  • member
  • Offline Offline
  • Posts: 1494
Re: New Auto Pilot?
« Reply #11 on: April 10, 2012, 07:00:41 AM »

I'm sure you could PM the authors of the latest hotkey classfile for the source code and then you could just add your code in.
Logged
Pages: [1] 2   Go Up
 

Page created in 0.053 seconds with 25 queries.