TotalCraft

View previous topic View next topic Go down

TotalCraft

Post by Echo_Delta_Oscar on Fri May 18, 2012 12:21 pm

I crafted this veichle last august, but so far I couldn't improve it anymore:
there are some issues:
-No cowling (it could be nice to have some, although it is not a priority)
-Plane-to-Submarine transition is quite problematic
-In Car mode the veichle randomly alternates over and understeering

I'll probably get back to it, but I may leave it here as a concept.

Code:


Val{
   WRetrF(default=90, min=0, max=90, step=0)
   WRetrR(default=90, min=90, max=180, step=0)
   Clear(default=0, min=0, max=20, step=0)
   Wingle(default=0, min=-90, max=0, step=0)
   Wingle4(default=0, min=-90, max=0, step=0)
   Wingle2(default=180, min=0, max=180, step=0)
   Wingle3(default=0, min=0, max=180, step=0)
   Wingle6(default=180, min=0, max=180, step=0)
   Wingle5(default=0, min=0, max=45, step=0)
   Jangle(default=0, min=0, max=90, step=0)
   Pretr(default=-180, min=-180, max=-90, step=0)
   NProp(default=0, min=0, max=45, step=0)
   Prangle(default=0, min=0, max=180, step=0)
   Steer(default=0, min=-30, max=30, step=5)
   SteerR(default=0, min=-15, max=15)
   Rudd(default=0, min=-20, max=20, step=0)
   Trim(default=0, min=-20, max=45, step=0)
   Yaw(default=0, min=-20, max=20, step=5)
   PBar(default=0, min=-25, max=25, step=5)
   Pitch(default=0, min=-25, max=25, step=5)
   SpoilE(default=-180, min=-180, max=-155, step=5)
   SpoilW(default=-180, min=-180, max=-155, step=5)
   SpoilE1(default=-180, min=-180, max=-155, step=5)
   SpoilW1(default=-180, min=-180, max=-155, step=5)      
   Mode(default=0, min=0, max=2, step=0)
   Gear(default=0, min=0, max=1, step=0)
   Flout(default=0, min=-2500, max=5000, step=2500)
   Throttle(default=0, min=0, max=75000, step=0)
   Machine(default=0, min=-10000, max=75000, step=0)
   BRK(default=0, min=0, max=120, step=120)
   ALVL(default=0, min=0, max=1)
}

Key{

   16:BRK(step=10)
   0:PBar(step=-2)
   1:PBar(step=2)
   2:SpoilW(step=2), SpoilW1(step=2)
   3:SpoilE(step=2), SpoilE1(step=2)

}

Body {
   Core(){   E:Frame(option=1){E:RudderF(angle=Steer, option=1){W:Wheel(angle=WRetrF, power=-Flout, brake=BRK, effect=2){}}}
      W:Frame(option=1){W:RudderF(angle=Steer, option=1){E:Wheel(angle=WRetrF, power=Flout, brake=BRK, effect=2){}}}
      S:Weight(option=3){
      E:Frame(angle=Wingle3, option=1){W:Trim(angle=Pitch){W:Chip(){}}}
      W:Frame(angle=Wingle3, option=1){E:Trim(angle=-Pitch){E:Chip(){}}}
      E:Frame(option=1){E:RudderF(angle=Steer, option=1){W:Wheel(angle=WRetrF, power=-Flout, brake=BRK, effect=2){}}}
      W:Frame(option=1){W:RudderF(angle=Steer, option=1){E:Wheel(angle=WRetrF, power=Flout, brake=BRK, effect=2){}}}
      S:Weight(option=3){
      S:Rudder(angle=Wingle){S:Chip(){S:Chip(){E:Chip(angle=SpoilE1){}
      S:Rudder(angle=-Wingle6){S:Chip(){S:Chip(){E:Chip(angle=SpoilE){}}}}}}}
      S:Rudder(angle=-Wingle){S:Chip(){S:Chip(){WE:Chip(angle=SpoilW1){}
      S:Rudder(angle=Wingle6){S:Chip(){S:Chip(){W:Chip(angle=SpoilW){}}}}}}}
      S:Frame(option=1){N:Jet(angle=Jangle, power=Throttle){}S:Frame(option=1){
      E:Frame(option=1){E:Wheel(angle=WRetrR, power=Flout, brake=BRK, effect=2){}}
      W:Frame(option=1){W:Wheel(angle=WRetrR, power=-Flout, brake=BRK, effect=2){}}
      S:Frame(option=1){
      E:Frame(angle=Wingle3, option=1){W:Trim(angle=-Pitch){W:Chip(){}}}
      W:Frame(angle=Wingle3, option=1){E:Trim(angle=Pitch){E:Chip(){}}}
      E:Frame(angle=-Wingle4, option=1){W:Trim(angle=Yaw){W:Chip(){}E:Chip(angle=-Wingle5){}}}
      W:Frame(angle=-Wingle4, option=1){E:Trim(angle=Yaw){E:Chip(){}W:Chip(angle=-Wingle5){}}}
      S:RLW(angle=PRetr, power=Machine, effect=4){
      N:Frame(angle=Prangle, option=1){S:Trim(angle=-NProp){}}S:Frame(angle=Prangle, option=1){N:Trim(angle=-NProp){}}}
      S:RLW(angle=PRetr, power=-Machine, effect=4){
      N:Frame(angle=Prangle, option=1){S:Trim(angle=NProp){}}S:Frame(angle=Prangle, option=1){N:Trim(angle=NProp){}}}
      }}}}}
}
}

Script{
   print 0,"HAIL THE TOTAL CRAFT!"
   print 1,"Mass: ",_WEIGHT()," kg"

   print 8,"W/S for throttle, E for brakes"
   print 9,"A/D to steer"
   print 10,"Arrow keys for pitch and roll"
   print 11,"G to toggle Auto Level"
   print 12,"C for car mode"
   print 13,"V for plane mode"
   print 14,"B for boat mode"

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

   if _KEYDOWN(10)>(0){
   Mode=2}

   if _KEYDOWN(11)>(0){
   Mode=1}

   if _KEYDOWN(6)>(0){
   Mode=0}

   if _KEY(9)>(0) & Mode=0{
   Steer=Steer+2}

   if _KEY(7)>(0) & Mode=0{
   Steer=Steer-2}

   if _KEY(9)>(0) & Mode=2{
   Yaw=Yaw+2}

   if _KEY(7)>(0) & Mode=2{
   Yaw=Yaw-2}

   if _KEY(15)>(0) & Mode=0{
   Flout=Flout+200}

   if _KEY(8)>(0) & Mode=0{
   Flout=Flout-200}

   if _KEY(15)>(0) & Mode=1{
   Machine=Machine+750}

   if _KEY(8)>(0) & Mode=1{
   Machine=Machine-750}

   if _KEY(15)>(0) & Mode=2{
   Throttle=Throttle+7500}

   if _KEY(8)>(0) & Mode=2{
   Throttle=Throttle-7500}

   if Mode=0{
   print 3,"CAR MODE"
   print 4,"Speed: ",_VEL()*3600/1000," km/h, ",_VEL()*3600/1609," mph"
   Throttle=0
   Machine=0
   Steer2=Steer/2
   Clear=Clear-1
   wingle=Wingle+1
   wingle4=Wingle4+1
   Wingle2=Wingle2+2
   Wingle3=Wingle3-2
   Wingle6=Wingle6+2
   Wingle5=Wingle5-1/2
   Jangle=Jangle-1
   WRetrF=WretrF+1
   WRetrR=WretrR-1
   Pretr=Pretr-1
   NProp=NProp-1
   Prop=Prop-1
   Prangle=Prangle-1
   print 2,"Power: ",Flout/52," %"}

   if Mode=1{
   print 3,"SUB MODE"
   print 4,"Speed: ",_VEL()*3600/1852," kts"
   print 5,"Depth: ",_ABS(_Y()*3048/1000)," feet"
   Flout=0
   Throttle=0
   Engine=Machine
   Jangle=Jangle-1
   Clear=Clear-1
   SpoilE=-180
   SpoilW=-180
   wingle=Wingle-1
   wingle4=Wingle4-1
   Wingle2=Wingle2+2
   Wingle3=Wingle3+2
   Wingle6=Wingle6+2
   Wingle5=Wingle5-1/2
   WRetrF=WRetrF-1
   WRetrR=WRetrR+1
   NProp=NProp+1
   Prangle=Prangle+1
   Pretr=Pretr+1
   print 2,"Power: ",Machine/750," %"}

   if Mode=2 & Gear=(1){
   Clear=Clear-1
   WRetrF=WretrF-1
   WRetrR=WretrR+1
   Pretr=Pretr-1}

   if Mode=2{
   print 3,"PLANE MODE"
   print 4,"Speed: ",_VEL()*3600/1852," kts"
   print 5,"Altitude: ",_ABS(_Y()*3048/1000)," feet"
   Machine=0
   Flout=0
   wingle=Wingle-1
   wingle4=Wingle4-1
   Wingle2=Wingle2-2
   Wingle3=Wingle3+2
   Wingle6=Wingle6-2
   Wingle5=Wingle5+1/2
   Prangle=Prangle-1
   Jangle=Jangle+1
   NProp=NProp-1
   Engine=Throttle
   Pretr=Pretr-1
   print 2,"Power: ",Engine/750," %"}

   if Mode=2 & Gear=(0){
   Steer=Yaw
   Clear=Clear+1
   WRetrF=WretrF+1
   WRetrR=WretrR-1}

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

   if ALVL=(1){
   Yaw=Rudd
   Pitch=Trim-_TODEG(_AX())
   SpoilW=-180-_TODEG(_AZ())-Yaw
   SpoilE=-180+_TODEG(_AZ())+Yaw
   SpoilW1=-180-_TODEG(_AZ())-Yaw
   SpoilE1=-180+_TODEG(_AZ())+Yaw
   print 6,"AUTO LEVEL ON"
   print 7,"Trim: ",Trim," Rudd: ",Rudd}

   if ALVL=(1) & Mode=(1){
   SpoilW=-180
   SpoilE=-180}

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

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

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

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


}

avatar
Echo_Delta_Oscar
Hover
Hover

Posts : 105
Join date : 2011-03-24

View user profile

Back to top Go down

Re: TotalCraft

Post by Xcermide1X on Sat May 19, 2012 5:49 am

EPIC

Xcermide1X
Car
Car

Posts : 11
Join date : 2012-05-17

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