Air to air kit

View previous topic View next topic Go down

Air to air kit

Post by Echo_Delta_Oscar on Tue Oct 25, 2011 6:47 am

This is the B-61A, equipped with a single AA guided missile, aimed specifically at the target.

Code:


Val
{
   RollE(default=0,min=-15,max=15,step=2)
   RollW(default=0,min=-15,max=15,step=2)
   PBar(default=0,min=-15,max=15,step=2)
   Pitch(default=0,min=-15,max=15)
   Yaw(default=0, min=-20, max=20, step=2)
   Rudd(default=0, min=-20, max=20, step=0)
   Ster(default=0, min=-20, max=20)
   Trim(default=0, min=-360, max=360, step=0)
   TailE(default=0, min=-50, max=50)
   TailW(default=0, min=-50, max=50)
   Throttle(default=0, min=0, max=99900, step=0)
   Engine1(default=0, min=0, max=100000, step=0)
   Chocke(default=0, min=0, max=100, step=0)
   Ign(default=0)
   Gear(default=0, min=0, max=1, step=0)
   Gear1(default=90, min=90, max=180)
   Gear2(default=0, min=-180, max=0)
   ALVL(default=1, min=0, max=1, step=0)
   BRK(default=0, min=0, max=500, step=500)
   ABR(default=0, min=0, max=25, step=1)
   Smoke(default=1, min=1, max=4)
   NCol(default=#000000)
   FCol(default=#808080)
   WCol1(default=#808080)
   Wcol2(default=#808080)
   Tcol(default=#808080)
   NColC(default=#000000)
   FColC(default=#ffffff)
   WCol1C(default=#ffffff)
   Wcol2C(default=#ffffff)
   TcolC(default=#ffffff)
   Infl(default=0)
   Arm(default=0, min=0, max=1)
   Mroll(default=0, min=-20, max=20)
   MPitch(default=0, min=-10, max=10)
   MYaw(default=0, min=-20, max=20)
   MJet(default=0, max=200000)
   Charge(default=0)

   
}

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

Body {
   Core(color=FcolC){   
      S:Frame(angle=160, option=1){S:Frame(option=1){S:Weight(angle=-160, option=1){


      N:Cowl(angle=-135, effect=#a000){}
      S:Cowl(angle=-90, effect=#ffff){
      E:Cowl(angle=90, effect=#a000){}
      W:Cowl(angle=90, effect=#a000){}
      S:Cowl(angle=-134, effect=#a000){}S:Cowl(angle=90, color=Fcol){}}
      E:Cowl(angle=-90, option=3, effect=#a000){}
      W:Cowl(angle=-90, option=4, effect=#a000){}

      S:TrimF(angle=90, option=1){

      E:Cowl(angle=120, color=Fcol){}
      W:Cowl(angle=120, color=Fcol){}
      E:Cowl(angle=-120, color=Fcol){}
      W:Cowl(angle=-120, color=Fcol){}
      N:Cowl(){
      E:Cowl(angle=120, color=Fcol){}
      W:Cowl(angle=120, color=Fcol){}
      E:Cowl(angle=-120, color=Fcol){}
      W:Cowl(angle=-120, color=Fcol){}
      N:Cowl(){
      E:Cowl(angle=120, color=Fcol){}
      W:Cowl(angle=120, color=Fcol){}
      E:Cowl(angle=-120, color=Fcol){}
      W:Cowl(angle=-120, color=Fcol){}
      N:Cowl(){
      E:Cowl(angle=120, option=3, color=Ncol){}
      W:Cowl(angle=120, option=4, color=Ncol){}
      E:Cowl(angle=-120, option=3, color=Ncol){}
      W:Cowl(angle=-120, option=4, color=Ncol){}
      N:Cowl(angle=140, option=5, color=Ncol){}
      N:Cowl(angle=-140, option=5, color=Ncol){}}}}
      S:Cowl(){
      E:Cowl(angle=120, color=Fcol){}
      W:Cowl(angle=120, color=Fcol){}
      E:Cowl(angle=-120, color=Fcol){}
      W:Cowl(angle=-120, color=Fcol){}
      S:Cowl(){
      E:Cowl(angle=120, color=Fcol){}
      W:Cowl(angle=120, color=Fcol){}
      E:Cowl(angle=-120, color=Fcol){}
      W:Cowl(angle=-120, color=Fcol){}
      S:Cowl(){
      E:Cowl(angle=120, color=Fcol){}
      W:Cowl(angle=120, color=Fcol){}
      E:Cowl(angle=-120, color=Fcol){}
      W:Cowl(angle=-120, color=Fcol){}}}}

      S:RudderF(angle=Gear1){S:TrimF(angle=Ster, option=1){N:Wheel(angle=180, effect=2){}}}}
      S:Weight(option=2){

      S:Cowl(angle=-90, option=1){S:Cowl(angle=120, color=Fcol){
      E:Cowl(angle=95, option=5, color=Fcol){}
      W:Cowl(angle=95, option=5, color=Fcol){}
      S:Cowl(color=Fcol){
      E:Cowl(angle=105, option=4, color=Fcol){}
      W:Cowl(angle=105, option=3, color=Fcol){}}}}

      E:Frame(angle=-10, option=1){E:TrimF(angle=-Pitch, option=1){W:Rudder(angle=-150, color=TcolC){E:Chip(color=TcolC){}W:Chip(color=TcolC){}}}}
      W:Frame(angle=-10, option=1){W:TrimF(angle=Pitch, option=1){E:Rudder(angle=150, color=TcolC){E:Chip(color=TcolC){}W:Chip(color=TcolC){}}}}
      S:Weight(option=3){
      S:Weight(name=Missile){N:Weight(option=2){
      N:RudderF(angle=10){N:Arm(power=Charge, option=200000){}}N:RudderF(angle=-10){N:Arm(power=Charge, option=200000){}}}
      E:Frame(name=MEW, option=1){}E:Trim(angle=MRoll){}E:Chip(angle=-30){}E:Chip(angle=30){}
      W:Frame(name=MWW, option=1){}W:Trim(angle=MRoll){}W:Chip(angle=-30){}W:Chip(angle=30){}
      S:Chip(option=1){E:Chip(){}W:Chip(){}
      S:Frame(angle=30, option=1){S:Jet(angle=-120, power=MJet, effect=4){}}
      S:Chip(angle=Mpitch){E:Chip(){}W:Chip(){}}}
      S:Trim(angle=90, option=1){N:Chip(){}E:Chip(){}W:Chip(){}S:Chip(angle=MYaw){E:Chip(){}W:Chip(){}}}}

      S:Frame(option=1){S:Frame(option=1){S:Chip(){
      E:Rudder(angle=15, color=Wcol1C){S:Chip(angle=ABR, color=Wcol1C){}S:Chip(angle=-ABR, color=Wcol1C){}
      E:Frame(angle=-90, option=1){W:TrimF(angle=-15, option=1){

      N:Cowl(angle=180, option=3, color=Fcol){}
      N:Cowl(option=5, color=Fcol){}

      W:Frame(angle=Gear2, option=1){W:Wheel(angle=180, brake=BRK, effect=2){}N:Frame(option=1){W:Wheel(angle=180, effect=2, brake=BRK){}}}
      N:TrimF(angle=90, option=1){N:Jet(angle=90, power=Engine1, effect=Smoke){

      N:Cowl(angle=-104, option=5, color=Fcol){}
      S:Cowl(angle=-104, option=5, color=Fcol){}
      E:Cowl(angle=-104, option=5, color=Fcol){}
      W:Cowl(angle=-104, option=5, color=Fcol){}
      N:Cowl(angle=90, color=Fcol){N:Cowl(angle=15, option=5, color=#000001){}}
      S:Cowl(angle=90, color=Fcol){S:Cowl(angle=15, option=5, color=#000001){}}
      E:Cowl(angle=90, color=Fcol){E:Cowl(angle=15, option=5, color=#000001){}}
      W:Cowl(angle=90, color=Fcol){W:Cowl(angle=15, option=5, color=#000001){}}}}}}

      E:Chip(color=Wcol1C){S:Chip(angle=ABR, color=Wcol1C){}S:Chip(angle=-ABR, color=Wcol1C){}
      E:Chip(color=Wcol1C){

      S:Cowl(color=Wcol1){}

      E:Frame(angle=-90, option=1){W:TrimF(angle=-15, option=1){

      N:Cowl(angle=180, option=3, color=Fcol){}
      N:Cowl(option=4, color=Fcol){}

      N:TrimF(angle=90, option=1){
      N:Jet(angle=90, power=Engine1, effect=Smoke){

      N:Cowl(angle=-104, option=5, color=Fcol){}
      S:Cowl(angle=-104, option=5, color=Fcol){}
      E:Cowl(angle=-104, option=5, color=Fcol){}
      W:Cowl(angle=-104, option=5, color=Fcol){}
      N:Cowl(angle=90, color=Fcol){N:Cowl(angle=15, option=5, color=#000001){}}
      S:Cowl(angle=90, color=Fcol){S:Cowl(angle=15, option=5, color=#000001){}}
      E:Cowl(angle=90, color=Fcol){E:Cowl(angle=15, option=5, color=#000001){}}
      W:Cowl(angle=90, color=Fcol){W:Cowl(angle=15, option=5, color=#000001){}}}}}}

      E:Chip(color=Wcol2C){

      S:Cowl(color=Wcol2){}

      E:Chip(color=WCol2C){S:Chip(angle=RollE, color=WCol2C){}}}}}}
      W:Rudder(angle=-15, color=Wcol1C){S:Chip(angle=ABR, color=Wcol1C){}S:Chip(angle=-ABR, color=Wcol1C){}
      W:Frame(angle=-90, option=1){E:TrimF(angle=15, option=1){

      N:Cowl(angle=180, option=4, color=Fcol){}
      N:Cowl(option=5, color=Fcol){}

      E:Frame(angle=Gear2, option=1){E:Wheel(angle=180, brake=BRK, effect=2){}N:Frame(option=1){E:Wheel(angle=180, brake=BRK, effect=2){}}}
      N:TrimF(angle=-90, option=1){N:Jet(angle=90, power=Engine1, effect=Smoke){

      N:Cowl(angle=-104, option=5, color=Fcol){}
      S:Cowl(angle=-104, option=5, color=Fcol){}
      E:Cowl(angle=-104, option=5, color=Fcol){}
      W:Cowl(angle=-104, option=5, color=Fcol){}
      N:Cowl(angle=90, color=Fcol){N:Cowl(angle=15, option=5, color=#000001){}}
      S:Cowl(angle=90, color=Fcol){S:Cowl(angle=15, option=5, color=#000001){}}
      E:Cowl(angle=90, color=Fcol){E:Cowl(angle=15, option=5, color=#000001){}}
      W:Cowl(angle=90, color=Fcol){W:Cowl(angle=15, option=5, color=#000001){}}}}}}

      W:Chip(color=Wcol1C){S:Chip(angle=ABR, color=Wcol1C){}S:Chip(angle=-ABR, color=Wcol1C){}
      W:Chip(color=Wcol1C){

      S:Cowl(color=Wcol1){}

      W:Frame(angle=-90, option=1){E:TrimF(angle=15, option=1){

      N:Cowl(angle=180, option=4, color=Fcol){}
      N:Cowl(option=3, color=Fcol){}

      N:TrimF(angle=-90, option=1){
      N:Jet(angle=90, power=Engine1, effect=Smoke){

      N:Cowl(angle=-104, option=5, color=Fcol){}
      S:Cowl(angle=-104, option=5, color=Fcol){}
      E:Cowl(angle=-104, option=5, color=Fcol){}
      W:Cowl(angle=-104, option=5, color=Fcol){}
      N:Cowl(angle=90, color=Fcol){N:Cowl(angle=15, option=5, color=#000001){}}
      S:Cowl(angle=90, color=Fcol){S:Cowl(angle=15, option=5, color=#000001){}}
      E:Cowl(angle=90, color=Fcol){E:Cowl(angle=15, option=5, color=#000001){}}
      W:Cowl(angle=90, color=Fcol){W:Cowl(angle=15, option=5, color=#000001){}}}}}}

      W:Chip(color=Wcol2C){

      S:Cowl(color=Wcol2){}

      W:Chip(color=Wcol2C){S:Chip(angle=RollW, color=Wcol2C){}}}}}}
      S:TrimF(angle=90, option=1){

      N:Cowl(){
      E:Cowl(angle=120, color=Fcol){}
      W:Cowl(angle=120, color=Fcol){}
      E:Cowl(angle=-120, color=Fcol){}
      W:Cowl(angle=-120, color=Fcol){}}
      E:Cowl(angle=120, color=Fcol){}
      W:Cowl(angle=120, color=Fcol){}
      E:Cowl(angle=-120, color=Fcol){}
      W:Cowl(angle=-120, color=Fcol){}
      S:Cowl(){
      E:Cowl(angle=120, option=4, color=Fcol){}
      W:Cowl(angle=120, option=3, color=Fcol){}
      E:Cowl(angle=-120, option=4, color=Fcol){}
      W:Cowl(angle=-120, option=3, color=Fcol){}
      S:Cowl(angle=140, option=5, color=Fcol){}
      S:Cowl(angle=-140, option=5, color=Fcol){}}

      W:RudderF(angle=-165){
      W:Frame(option=1){
      W:Frame(angle=90, option=1){E:Trim(angle=15, color=TcolC){}}
      W:Frame(angle=-90, option=1){E:Trim(angle=-15, color=TcolC){}}}
      W:Trim(angle=Yaw, color=TcolC){E:Chip(color=TcolC){}W:Chip(color=TcolC){}}}}}}}}}}}}
}

   Core(){
      N:Trim(angle=90){S:Chip(){
      E:Chip(){E:Chip(){E:Chip(){E:Chip(){}}}}
      W:Chip(){W:Chip(){W:Chip(){W:Chip(){}}}}
      S:Chip(){
      E:Chip(){E:Chip(){E:Chip(){E:Chip(){}}}}
      W:Chip(){W:Chip(){W:Chip(){W:Chip(){}}}}
      S:Chip(){
      E:Chip(){E:Chip(){E:Chip(){E:Chip(){}}}}
      W:Chip(){W:Chip(){W:Chip(){W:Chip(){}}}}}}}}
      E:Chip(){E:Chip(){E:Chip(){E:Chip(){}}}}
      W:Chip(){W:Chip(){W:Chip(){W:Chip(){}}}}
      S:Chip(){
      E:Chip(){E:Chip(){E:Chip(){E:Chip(){}}}}
      W:Chip(){W:Chip(){W:Chip(){W:Chip(){}}}}
      S:Chip(){
      E:Chip(){E:Chip(){E:Chip(){E:Chip(){}}}}
      W:Chip(){W:Chip(){W:Chip(){W:Chip(){}}}}}}
      S:Frame(name=Target){S:Jet(power=Infl, option=1){}}}
}

Script(){

   print 0,"Cleared to Proceed"
   print 1,"3P RULE!"
   print 2,"Power at ", (Throttle+Chocke)/1000,"%"
   print 3,"Speed: ", _VEL()*3600/1852," knots, ",_VEL()," m/s"
   print 4,"Mass: ",_WEIGHT()," kg, Fuel:",_FUEL()
   print 5,"Fuel LVL: ",_FUEL()/510000,"%"
   print 6,"Heading: ",_TODEG(_AY())

   print 9,"Route Home: ",90-_TODEG(_ATAN2(_Z(), _X()))
   print 10,"Distance Home: ", _LEN2(_Z(),_X()), " m"
   print 8,"Trim: ",Trim,", Rudd: ",Rudd
   print 13,"Target Bearing: ",-90+_TODEG(_EY(MIssile)-_ATAN(_Z(Target)-_Z(Missile), _X(Target)-_X(Missile)))," deg"

   print 15,"Missile Speed: ",_VEL(Missile)," m/s, ",_VEL(Missile)*3600/1852," kts"

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

   Ign=_MOD(Ign+_KEYDOWN(5),2)

   if Ign=(1){
   Chocke=100
   Engine1=(Throttle+Chocke)/(1+_ABS(_Y()-500)/1500+_VEL()/110)
   Jet1=Engine1}

   if Ign=(0){
   Chocke=0
   Jet1=0
   Engine1=0}

   if Chocke>0 & Throttle=(0){
   BRK=BRK+10}

   if _VEL()>(40){
   _BYE(Disp)}

   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+1
   Gear3=Gear3+2/3
   Ster=Yaw}

   if Gear=(1){
   Gear1=Gear1+2
   Gear2=Gear2-2
   Gear3=Gear3-2/3
   Ster=0
   BRK=BRK+1}

   if ALVL=(1){
   Yaw=Rudd
   Pitch=-Trim+_TODEG(_AX())
   RollE=-_TODEG(_AZ())-Yaw*2
   RollW=_TODEG(_AZ())+Yaw*2
   print 12,"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){
   Rudd=0
   print 12,"AUTO LEVEL OFF"}

   if Throttle>(0){
   Smoke=3}

   if Throttle>(8000){
   Smoke=1}

   if Throttle>(50000){
   Smoke=2}

   if Throttle>(85000){
   Smoke=4}

   if _KEY(6)>(0){
   _SPLIT(Missile)}

   if _KEY(6)>(0){
   Arm=Arm+1}

   Infl=(500-_Y(Target))*1500-_VEL(Target)*10000

   if Arm>(0){
   Mroll=_TODEG(_EZ(Missile))-MYaw/2
   MJet=(200-_VEL(Missile))*10000}

   if Arm>(0) & -90-_TODEG(_EY(Missile))-_TODEG(_ATAN2(_Z(Target)-_Z(Missile), _X(Target)-_X(Missile)))>(-180){
   MYaw=(-90-_TODEG(_EY(Missile))-_TODEG(_ATAN2(_Z(Target)-_Z(Missile), _X(Target)-_X(Missile))))*2}

   if Arm>(0) & -90-_TODEG(_EY(Missile))-_TODEG(_ATAN2(_Z(Target)-_Z(Missile), _X(Target)-_X(Missile)))<(-180){
   MYaw=(360-90-_TODEG(_EY(Missile))-_TODEG(_ATAN2(_Z(Target)-_Z(Missile), _X(Target)-_X(Missile))))*2}

   if Arm>(0) & _ABS(_Y(Missile)-_Y(Target))<(10){
   MPitch=_Y(Missile)-(_Y(Target)+3)+_TODEG(_AX(Missile))}

   if Arm>(0) & (_Y(Missile)-_Y(Target))>(10){
   MPitch=10+_TODEG(_AX(Missile))}

   if Arm>(0) & (_Y(Missile)-_Y(Target))<(-10){
   MPitch=-10+_TODEG(_AX(Missile))}

   if Arm>(0) & _LEN2(_Z(Target)-_Z(Missile),_X(Target)-_X(Missile))<(10){
   Charge=100000000}

   


}


Analog Control on pitch, roll and throttle;
A,D for Yaw and auto-rudder;
Up/Down arrow keys for Trim, when auto-pilot is selected;
G to toggle Auto Pilot;
X to start engines (if you want to avoid a zero-altitude loop, i suggest check throttle first);
C to release weapon;
F to deploy/retract landing gear;


Last edited by Echo_Delta_Oscar on Fri Oct 28, 2011 3:55 am; edited 1 time in total (Reason for editing : Detailed control map)
avatar
Echo_Delta_Oscar
Hover
Hover

Posts : 105
Join date : 2011-03-24

View user profile

Back to top Go down

Re: Air to air kit

Post by bwansy on Thu Oct 27, 2011 6:28 pm

That's pretty impressive for what you have achieved with script. Sometimes it would circle the target endlessly, but otherwise it works just fine. Autopilot works great, too, although I had to figure out all the controls myself.
4.5/5 Very Happy

_________________
A.K.A. Bernard

bwansy
Admin

Posts : 170
Join date : 2010-07-15

View user profile http://rigidchips.forum-motion.com

Back to top Go down

Re: Air to air kit

Post by Echo_Delta_Oscar on Fri Oct 28, 2011 3:56 am

Thanks, now I edited with all the controls -I hope so. Next step lua, then.
avatar
Echo_Delta_Oscar
Hover
Hover

Posts : 105
Join date : 2011-03-24

View user profile

Back to top Go down

Re: Air to air kit

Post by Warbird on Sat Nov 05, 2011 8:33 am

Really nice! But you should try to make the missile fly more stable to increase the hit rate of it and you might increase the power of the arms. I had a similiar problem on my harpoon missile. To solve the shakyness in flight i limited the steering systems speed to 1 (1 degree per frame) this required additional scripting but it was worth it.

Warbird
Tank
Tank

Posts : 60
Join date : 2010-10-27
Age : 23
Location : Germany

View user profile

Back to top Go down

Re: Air to air kit

Post by freek4ever on Fri Nov 25, 2011 1:51 pm

wtf affraid 3 core's amazing so great 15 of 10 Very Happy Very Happy
avatar
freek4ever
Tank
Tank

Posts : 97
Join date : 2011-08-26
Age : 20
Location : nederland holand

View user profile

Back to top Go down

Re: Air to air kit

Post by Sponsored content


Sponsored content


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