AR-40A Drosophila Melanogaster

View previous topic View next topic Go down

AR-40A Drosophila Melanogaster

Post by Echo_Delta_Oscar on Thu Sep 29, 2011 10:17 am

This plane is the second smallest I've ever created, and it is the first I gave analog control. Il is designed to be operated via a 2 axis (pitch and yaw) plus throttle joystick, while yaw control is still on the A and D keys on the keyboard.
F to retract/deploy landing gears, G to toggle autopilot, E for wheel brakes.



Code:

Val
{
   RollE(default=0,min=-15,max=15,step=3)
   RollW(default=0,min=-15,max=15,step=3)
   PBar(default=0,min=-15,max=15,step=3)
   Pitch(default=0,min=-15,max=15)
   Yaw(default=0, min=-10, max=10, step=1)
   Ster(default=90, min=70, max=180)
   Rudd(default=0, min=-10, max=10, step=0)
   Trim(default=0, min=-360, max=360, step=0)
   Throttle(default=0, min=0, max=40000, step=0)
   Engine(default=0, min=0, max=40000, step=0)
   Jet(default=0, min=0, max=100000)
   Jetang(default=-130, min=-130, max=-120, step=0)
   Gear(default=0, min=0, max=1, step=0)
   Gear1(default=90, min=90, max=180)
   Gear2(default=90, min=90, max=180)
   ALVL(default=0, min=0, max=1, step=0)
   BRK(default=0, min=0, max=200, step=200)
   Smoke(default=1, min=1, max=4)
   Efficiency(default=0)

   
}

Key
{
   7:Yaw(step=-2)
   9:Yaw(step=2)
   16:BRK(step=10), ABR(step=15)
   
   
   
   
   
}

Body {
   Core(color=#405000){ N:Cowl(angle=-140, option=5, effect=#a000){}
      E:Cowl(angle=-120, option=3, effect=#a000){}
      W:Cowl(angle=-120, option=4, effect=#a000){}
      S:Cowl(color=#304000){}

      N:Frame(angle=-150, option=1){N:Jet(angle=Jetang, power=Jet, effect=smoke){}}
      S:Frame(option=1){

      E:Cowl(angle=-120, color=#304000){}
      W:Cowl(angle=-120, color=#304000){}
      S:Cowl(color=#304000){}

      N:TrimF(angle=Ster, option=1){N:Wheel(angle=180, brake=Gear){}}
      E:Chip(color=#405000){E:Wheel(angle=Gear2, brake=BRK){}
      E:Trim(angle=RollE, color=#000000){}}
      W:Chip(color=#405000){W:Wheel(angle=Gear2, brake=BRK){}
      W:trim(angle=-RollW, color=#000000){}}
      S:Trim(angle=90, color=#405000){E:Trim(angle=Yaw, color=#405000){}}
      S:Frame(option=1){

      E:Cowl(angle=-120, color=#304000){}
      W:Cowl(angle=-120, color=#304000){}

      E:Trim(angle=Pitch, color=#405000){}
      W:Trim(angle=-Pitch, color=#405000){}}}
}}

Script(){

   print 0,"Cleared to Proceed"
   print 1,"CAUTION! ANALOG CONTROL! Mass: ",_WEIGHT()," kg"
   print 2,"Power at ", Throttle/400,"%, Efficiency: ",Efficiency,"%"
   print 3,"Speed: ", _VEL()*3600/1852," knots, ",_VEL()," m/s"
   print 5,"Max Speed: 130 kts, without ordnance"
   print 6," Fuel:",_FUEL(),", Fuel LVL: ",_FUEL()/120000,"%"
   print 7,"Heading: ",_TODEG(_AY())

   print 9,"Trim: ",Trim,", Rudder: ",Rudd

   RollE=_ANALOG(0)/200*3
   RollW=-_ANALOG(0)/200*3
   PBar=_ANALOG(1)/200*3
   Throttle=(_ANALOG(2)+1000)*20

   Engine=Throttle-_VEL()*90-_Y()*40
   Jet=Engine

   if Throttle=(0){
   Efficiency=0}

   if Throttle>(0){
   Efficiency=Engine/Throttle*100}

   if Throttle>(0) & Engine<(200){
   Jet=200}

   ALVL=_MOD(ALVL+_KEYDOWN(13),2)

   if ALVL=(0){
   Pitch=Pbar
   Trim=_TODEG(_AX())}

   Gear=_MOD(Gear+_KEYDOWN(12),2)
   if Gear=(0){
   Gear1=Gear1-1
   Gear2=Gear2-2
   Jetang=Jetang-1
   Ster=Gear1+2*Yaw}

   if Gear=(1){
   Gear1=Gear1+1
   Gear2=Gear2+1
   Jetang=Jetang+2
   Ster=Gear1
   BRK=BRK+1}

   if ALVL=(1){
   Yaw=Rudd
   Pitch=-Trim+_TODEG(_AX())
   RollE=-_TODEG(_AZ())-Yaw*4
   RollW=_TODEG(_AZ())+Yaw*4
   print 11,"AUTO LEVEL ON"}

   if ALVL=(1) & _KEY(9)>0{
   Rudd=Rudd+1/4}

   if ALVL=(1) & _KEY(7)>0{
   Rudd=Rudd-1/4}

   if ALVL=(1) & _KEY(0)>0{
   Trim=Trim-1/2}

   if ALVL=(1) & _KEY(1)>0{
   Trim=Trim+1/2}

   if ALVL=(0){
   print 11,"AUTO LEVEL OFF"}

   if _KEY(5)>(0){
   _SPLIT(Tank1)}

   if Throttle>(0){
   Smoke=1}

   if Throttle>(14000){
   Smoke=2}

   if Throttle>(30000){
   Smoke=3}

   if Throttle>(34000){
   Smoke=4}

   if _KEY(6)>(0){
   _BYE(Tank)}

}
avatar
Echo_Delta_Oscar
Hover
Hover

Posts : 105
Join date : 2011-03-24

View user profile

Back to top Go down

Re: AR-40A Drosophila Melanogaster

Post by Thorero on Sun Oct 02, 2011 9:31 pm

Brilliant little plane!

Thorero
Admin

Posts : 23
Join date : 2010-07-16
Location : USA

View user profile

Back to top Go down

View previous topic View next topic Back to top


 
Permissions in this forum:
You cannot reply to topics in this forum