Making your first Vehicle

[[Media:Example.ogg]]

// [RCD] Val { AILERON(default=0, min=-20, max=20, step=5) BRAKE(default=0, max=5000, step=5000) CARWHEEL(default=0, min=-180, max=0) CARWHEELBACK(default=70, min=-180, max=70) CARWHEELFRONT(default=110, min=110, max=360) CARWING(default=30, max=30) ELEVATOR(default=0, min=-30, max=30, step=5) ENZINE(default=0, min=-5000) HANDLE(default=0, min=-20, max=20, step=2) JET(default=0, max=250000) JETANGLE(default=180, min=120, max=180) JETSTAND(default=180, min=150, max=180) LIMITER(default=300) MAINWING(default=0, max=70) MAINWING2(default=180, max=180) RUDDER(default=0, min=-20, max=20, step=5) SCREW(default=0, max=150000) SCREWANGLE(default=180, min=-10, max=180) SCREWBLAKE(default=0, max=5000) SCREWPROPELLER(default=0, max=45) SCREWPROPELLERANGLE(default=0, max=100) SCREWSTAND(default=0, max=90) SHIPRUDDER(default=0, min=-20, max=20, step=2) SHIPRUDDERANGLE(default=180, max=180) SPOILER(default=0, max=30, step=5) VERTICAL_STABILIZER(default=-180, min=-180, max=-90) WEIGHT(default=0, max=90) WINGL(default=30, min=-30, max=45) WINGR(default=30, min=-30, max=45) } Key { } Body { Core { N:Weight { N:Chip(angle=CARWING) { N:Weight(angle=-CARWING, option=2) { E:Trim(angle=-WINGR) { } W:Trim(angle=WINGL) { } } }  W:Trim(angle=WINGL) { } E:Trim(angle=-WINGR) { } E:Frame(angle=CARWHEEL, option=1) { E:RudderF(angle=HANDLE, option=1, damper=1) { W:Wheel(angle=CARWHEELFRONT, power=-ENZINE, brake=BRAKE, option=1, effect=5) { } } }  W:Frame(angle=CARWHEEL, option=1) { W:RudderF(angle=HANDLE, option=1, damper=1) { E:Wheel(angle=CARWHEELFRONT, power=ENZINE, brake=BRAKE, option=1, effect=5) { } } }  S:Rudder(angle=MAINWING) { S:Chip { S:Chip(angle=-MAINWING2) { S:Trim(angle=AILERON) { S:Chip { } }   }   }  }  S:Rudder(angle=-MAINWING) { S:Chip { S:Chip(angle=-MAINWING2) { S:Trim(angle=AILERON) { S:Chip { } }   }   }  } } N:Trim(angle=90) { S:Chip { S:Chip(angle=-HANDLE) { } S:Chip(angle=SHIPRUDDER) { E:Chip(angle=SHIPRUDDERANGLE) { } E:Chip(angle=-SHIPRUDDERANGLE) { } }  N:Chip(angle=SHIPRUDDER) { E:Chip(angle=-SHIPRUDDERANGLE) { } E:Chip(angle=SHIPRUDDERANGLE) { } } } } S:Chip(angle=SPOILER) { } S:Chip(angle=-SPOILER) { } S:Frame(angle=SCREWSTAND, option=1) { S:Wheel(angle=SCREWANGLE, power=SCREW, brake=SCREWBLAKE) { W:Frame(angle=SCREWPROPELLERANGLE, option=1) { E:Trim(angle=SCREWPROPELLER) { } }  N:Frame(angle=SCREWPROPELLERANGLE, option=1) { S:Trim(angle=SCREWPROPELLER) { } }  E:Frame(angle=SCREWPROPELLERANGLE, option=1) { W:Trim(angle=SCREWPROPELLER) { } }  S:Frame(angle=SCREWPROPELLERANGLE, option=1) { N:Trim(angle=SCREWPROPELLER) { } } }  S:Wheel(angle=SCREWANGLE, power=-SCREW, brake=SCREWBLAKE) { W:Frame(angle=SCREWPROPELLERANGLE, option=1) { E:Trim(angle=-SCREWPROPELLER) { } }  N:Frame(angle=SCREWPROPELLERANGLE, option=1) { S:Trim(angle=-SCREWPROPELLER) { } }  E:Frame(angle=SCREWPROPELLERANGLE, option=1) { W:Trim(angle=-SCREWPROPELLER) { } }  S:Frame(angle=SCREWPROPELLERANGLE, option=1) { N:Trim(angle=-SCREWPROPELLER) { } } }  N:TrimF(angle=WEIGHT, option=1) { S:Weight { } } } S:Chip { S:Chip(angle=-CARWING) { S:Chip(angle=CARWING) { W:Frame(option=1) { W:Chip(angle=VERTICAL_STABILIZER) { W:Trim(angle=RUDDER) { } }   }    E:Frame(option=1) { E:Chip(angle=VERTICAL_STABILIZER) { E:Trim(angle=RUDDER) { } }   }    E:Trim(angle=ELEVATOR) { } W:Trim(angle=-ELEVATOR) { } S:Frame(angle=-JETSTAND, option=1) { S:Jet(angle=-JETANGLE, power=-JET, effect=4) { } }  }  }  W:Trim(angle=WINGL) { } E:Trim(angle=-WINGR) { } W:Frame(angle=CARWHEEL, option=1, damper=1) { W:Wheel(angle=CARWHEELBACK, power=-ENZINE, brake=BRAKE, option=2, effect=5) { } } E:Frame(angle=CARWHEEL, option=1, damper=1) { E:Wheel(angle=CARWHEELBACK, power=ENZINE, brake=BRAKE, option=2, effect=5) { } } } } } Lua { MODE="CAR" GEAR="DOWN" function main if _KEYDOWN(8)==1 then if MODE=="CAR" then MODE="PLANE" elseif MODE=="PLANE" then MODE="SHIP" elseif MODE=="SHIP" then MODE="CAR" end elseif _KEYDOWN(15)==1 then if MODE=="CAR" then MODE="SHIP" elseif MODE=="SHIP" then MODE="PLANE" elseif MODE=="PLANE" then MODE="CAR" end end out(0,"MODE   ",MODE) out(1,"SPEED  ",_VZ(0)*-3.75,"km/h") --CAR-- if MODE=="CAR" then CARWING=CARWING+1 CARWHEELFRONT=CARWHEELFRONT-8 CARWHEELBACK=CARWHEELBACK+8 CARWHEEL=CARWHEEL+8 ELEVATOR=ELEVATOR-1 if WINGL&gt;30 then WINGL=WINGL-5 elseif WINGL&lt;30 then WINGL=WINGL+1 end if WINGR&gt;30 then WINGR=WINGR-5 elseif WINGR&lt;30 then WINGR=WINGR+1 end if _VZ(0)*-3.75&lt;LIMITER then if _KEYDOWN(0)==1 or _KEYUP(11)==1 then ENZINE=5000 end ENZINE=ENZINE+_KEY(0)*math.abs(_VZ(0))*10-_KEY(1)*5000 if _KEY(0)+_KEY(1)==0 then ENZINE=0 end elseif _KEY(0)==0 then ENZINE=ENZINE-_KEY(1)*5000 if _KEYDOWN(0)==1 or _KEYUP(11)==1 then ENZINE=5000 end if _KEY(0)+_KEY(1)==0 then ENZINE=0 end end HANDLE=HANDLE-(_KEY(2)-_KEY(3))*5/(_VZ(0)/-5) WINGL=WINGL+_KEY(2)*6 WINGR=WINGR+_KEY(3)*6 BRAKE=BRAKE+_KEY(11)*(50+_VZ(0)/5) LIMITER=LIMITER-(_KEYDOWN(4)-_KEYDOWN(5))*50 out(2,"LIMITER ",LIMITER+40,"km/h") else ENZINE=0 CARWING=CARWING-1 if CARWHEELFRONT&lt;270 then CARWHEELFRONT=CARWHEELFRONT+8 end -- if CARWHEELBACK&gt;-90 then CARWHEELBACK=CARWHEELBACK-8 -- end CARWHEEL=CARWHEEL-8 end ---PLANE-- if MODE=="PLANE" then if WINGL&lt;0 then WINGL=WINGL+1 end if WINGR&lt;0 then WINGR=WINGR+1 end if WINGL&gt;0 then WINGL=WINGL-1 end if WINGR&gt;0 then WINGR=WINGR-1 end MAINWING=MAINWING+3 MAINWING2=MAINWING2-8 VERTICAL_STABILIZER=VERTICAL_STABILIZER+5 JETSTAND=JETSTAND-3 JETANGLE=JETANGLE-2 ELEVATOR=ELEVATOR+(_KEY(0)-_KEY(1))*5 AILERON=AILERON+(_KEY(2)-_KEY(3))*5 RUDDER=RUDDER-(_KEY(7)-_KEY(9))*5 JET=JET+(_KEY(4)-_KEY(5))*5000 SPOILER=SPOILER+_KEY(11)*2 BRAKE=BRAKE+_KEY(11)*(5+_VZ(0)/50) if _KEYDOWN(13)==1 then if GEAR=="DOWN" then GEAR="UP" elseif GEAR=="UP" then GEAR="DOWN" end end if GEAR=="DOWN" then if CARWHEELFRONT&gt;270 then CARWHEELFRONT=CARWHEELFRONT-8 end --  if CARWHEELBACK&lt;-90 then --  CARWHEELBACK=CARWHEELBACK+8 --  end HANDLE=HANDLE+(_KEY(7)-_KEY(9))*5 elseif GEAR=="UP" then CARWHEELFRONT=CARWHEELFRONT+8 --  CARWHEELBACK=CARWHEELBACK-8 BRAKE=BRAKE+50 end if _KEY(0)+_KEY(1)+_KEY(2)+_KEY(3)+_KEY(7)+_KEY(9)==0 then RUDDER=_WY(0)*-5 end out(2,"GEAR   ",GEAR) else MAINWING=MAINWING-3 MAINWING2=MAINWING2+8 VERTICAL_STABILIZER=VERTICAL_STABILIZER-5 JETSTAND=JETSTAND+3 JETANGLE=JETANGLE+2 JET=0 GEAR="DOWN" end ---SHIP-- if MODE=="SHIP" then if WINGL&gt;-20 then WINGL=WINGL-1 end if WINGR&gt;-20 then WINGR=WINGR-1 end if WINGL&lt;-20 then WINGL=WINGL+5 end if WINGR&lt;-20 then WINGR=WINGR+5 end WEIGHT=WEIGHT+5 ELEVATOR=ELEVATOR+1 CARWHEELFRONT=CARWHEELFRONT+8 -- CARWHEELBACK=CARWHEELBACK-8 SCREWSTAND=SCREWSTAND+5 SCREWANGLE=SCREWANGLE-10 SCREWBLAKE=0 SCREWPROPELLERANGLE=SCREWPROPELLERANGLE+4 SCREWPROPELLER=SCREWPROPELLER+3 SHIPRUDDERANGLE=SHIPRUDDERANGLE-10 SCREW=SCREW+(_KEY(0)-_KEY(1))*10000 SHIPRUDDER=SHIPRUDDER+(_KEY(2)-_KEY(3))*2 WINGL=WINGL-_KEY(3)*10 WINGR=WINGR-_KEY(2)*10 else SCREW=0 SCREWSTAND=SCREWSTAND-5 SCREWANGLE=SCREWANGLE+10 SCREWBLAKE=SCREWBLAKE+500 SCREWPROPELLERANGLE=SCREWPROPELLERANGLE-3 SCREWPROPELLER=SCREWPROPELLER-4 SHIPRUDDERANGLE=SHIPRUDDERANGLE+10 WEIGHT=WEIGHT-5 end end}

//í“¬—pƒoƒM[•— //ª«FƒAƒNƒZƒ‹EƒoƒbƒNA©¨Fƒnƒ“ƒhƒ‹¶‰E //‚`FƒuƒŒ[ƒL//‚yFƒgƒŠƒK[A‚wFƒKƒ“ƒZƒbƒgƒAƒbƒv

Val { Brake(default=0,min=0,max=80,step=80) HBrake(default=0,min=0,max=100,step=100) HandleL(default=84,min=54,max=114,step=5) HandleR(default=84,min=54,max=114,step=5) Engine(default=0,min=-5000,max=2500,step=2500) trig1(max=50000) trig2(max=50000) trig3(max=50000) trig4(max=50000) trig5(max=50000) trig6(max=50000) trig7(max=50000) trig8(max=50000)

rot(default=0,min=0,max=1500,step=1500) rotb(default=50,min=0,max=50,step=5) stand(default=180,min=45,max=180,step=5) stand2(default=180,min=0,max=180,step=5) top(default=-40,min=-40,max=170,step=5) top2(default=-20,min=-180,max=-20,step=5) gun(default=0,min=0,max=3,step=0) gunp1(default=1,min=-1,max=1,step=0) gunp2(default=1,min=-1,max=1,step=0) gunp3(default=1,min=-1,max=1,step=0) gunp4(default=1,min=-1,max=1,step=0) gunp5(default=1,min=-1,max=1,step=0) gunp6(default=1,min=-1,max=1,step=0) gunp7(default=1,min=-1,max=1,step=0) gunp8(default=1,min=-1,max=1,step=0) gunyang(default=180,min=170,max=240,step=0)

} Key { 0:Engine(step=-500) 1:Engine(step=500) 2:HandleR(step=-5),HandleL(step=5) 3:HandleR(step=5),HandleL(step=-5) 4:Rot(step=500),rotb(step=-50) 7:Brake(step=30),HBrake(step=20) 8:HBrake(step=20) 6:gunyang(step=0.5) 9:gunyang(step=-0.5)}

Body { Core{ N:Chip{

//BodyCowl N:Cowl(angle=-45,color=#617C26){ N:Cowl(angle=-115,color=#617C26){ N:Cowl(angle=-15,color=#617C26){ E:Cowl(angle=-89,color=#617C26){ } W:Cowl(angle=-89,color=#617C26){ } N:Cowl(angle=30,color=#0080FF){ E:Cowl(angle=-60,option=4,color=#0080FF){} W:Cowl(angle=-60,option=3,color=#0080FF){} }}}}//BodyCowlEnd

//FrontSus N:Frame(angle=-90,option=1){ E:Rudderf(angle=45,spring=0.09,damper=0.5){ E:Rudderf(angle=-45){ E:Wheel(angle=-HandleR,power=Engine,brake=Brake,option=1,effect=3){} }} W:Rudderf(angle=-45,spring=0.09,damper=0.5){ W:Rudderf(angle=45){ W:Wheel(angle=-HandleL,power=-Engine,brake=Brake,option=1,effect=3){} }} } } S:Chip{ E:Cowl(angle=-8,Color=#505050){ E:Cowl(angle=-82,Color=#617c26){ N:Cowl(angle=-45,Color=#617c26){} E:Cowl(angle=-82,Color=#617c26){ N:Cowl(angle=-8,option=3,Color=#617c26){} }  }   N:Cowl(angle=-8,option=4,Color=#505050){} } W:Cowl(angle=-8,Color=#505050){ W:Cowl(angle=-82,Color=#617c26){ N:Cowl(angle=-45,Color=#617c26){} W:Cowl(angle=-82,Color=#617c26){ N:Cowl(angle=-8,option=4,Color=#617c26){} }  }   N:Cowl(angle=-8,option=3,Color=#505050){} } S:Chip{ E:Cowl(angle=-8,Color=#505050){ E:Cowl(angle=-82,Color=#617c26){ S:Cowl(angle=-45,Color=#617c26){} E:Cowl(angle=-82,Color=#617c26){ S:Cowl(angle=-8,option=4,Color=#617c26){} }  }   S:Cowl(angle=-8,option=3,Color=#505050){} } W:Cowl(angle=-8,Color=#505050){ W:Cowl(angle=-82,Color=#617c26){ S:Cowl(angle=-45,Color=#617c26){} W:Cowl(angle=-82,Color=#617c26){ S:Cowl(angle=-8,option=3,Color=#617c26){} }  }   S:Cowl(angle=-8,option=4,Color=#505050){} }//FrontSusEnd

//Gun W:Frame(angle=-Stand){W:Frame(angle=Stand2){W:Frame(angle=-stand){N:Rudderf(angle=-gunyang){ N:Wheel(angle=90,power=rot,break=rotb,color=#474766){ N:Arm(angle=90,power=trig1,option=50000,color=#474766,name=gun1){} S:Arm(angle=90,power=trig2,option=50000,color=#474766,name=gun2){} W:Arm(angle=90,power=trig3,option=50000,color=#474766,name=gun3){} E:Arm(angle=90,power=trig4,option=50000,color=#474766,name=gun4){} } }}}}  E:Frame(angle=-Stand){E:Frame(angle=Stand2){E:Frame(angle=-stand){N:Rudderf(angle=gunyang){ N:Wheel(angle=90,power=-rot,break=rotb,color=#474766){ N:Arm(angle=90,power=trig5,option=50000,color=#474766,name=gun5){} S:Arm(angle=90,power=trig6,option=50000,color=#474766,name=gun6){} W:Arm(angle=90,power=trig7,option=50000,color=#474766,name=gun7){} E:Arm(angle=90,power=trig8,option=50000,color=#474766,name=gun8){} } }}}}//GunEnd

//RearSus S:Chip{ S:Frame(angle=-90){ E:Rudderf(angle=-45,spring=0.09,damper=0.5){ E:Rudderf(angle=45){ E:Wheel(angle=90,power=-Engine,brake=HBrake,option=1,effect=5){} }} W:Rudderf(angle=45,spring=0.09,damper=0.5){ W:Rudderf(angle=-45){ W:Wheel(angle=90,power=Engine,brake=HBrake,option=1,effect=5){} }} }//RearSusEnd

//RearCowl S:frame(angle=-105){ S:Cowl(angle=-25,color=#0080FF){ E:Cowl(angle=-70,option=3,color=#0080FF){} W:Cowl(angle=-70,option=4,color=#0080FF){} S:Cowl(angle=top,color=#000000){ S:Cowl(angle=top2,color=#000000){ }}}} S:frame{ E:Frame(angle=-120){ E:frame(angle=120){ N:frame(angle=-15){ N:cowl(angle=-160,color=#617C26){ E:Cowl(angle=-90,color=#617C26){} N:Cowl(color=#617C26){ E:Cowl(angle=-90,option=3,color=#617C26){} N:Cowl(angle=-135,color=#617C26){ }}}}}  E:frame(angle=-60){ N:frame(angle=15){ N:cowl(angle=160,color=#617C26){ E:Cowl(angle=90,color=#617C26){} N:Cowl(color=#617C26){ E:Cowl(angle=90,option=3,color=#617C26){} N:Cowl(angle=135,color=#617C26){ }}}}} } } //RearCowlEnd }}} }}

Script { Trig1=0 Trig2=0 Trig3=0 Trig4=0 Trig5=0 Trig6=0 Trig7=0 Trig8=0 if gun=2 & _KEY(4) & _RZ(gun1,0) &gt; 0 & gunp1 = -1 {gunp1=-gunp1 Trig1=50000} if gun=2 & _KEY(4) & _RZ(gun2,0) &gt; 0 & gunp2 = -1 {gunp2=-gunp2 Trig2=50000} if gun=2 & _KEY(4) & _RZ(gun3,0) &gt; 0 & gunp3 = -1 {gunp3=-gunp3 Trig3=50000}if gun=2 & _KEY(4) & _RZ(gun4,0) &gt; 0 & gunp4 = -1 {gunp4=-gunp4 Trig4=50000}

if gun=2 & _KEY(4) & _RZ(gun5,0) &lt; 0 & gunp5 = -1 {gunp5=-gunp5 Trig5=50000} if gun=2 & _KEY(4) & _RZ(gun6,0) &lt; 0 & gunp6 = -1 {gunp6=-gunp6 Trig6=50000} if gun=2 & _KEY(4) & _RZ(gun7,0) &lt; 0 & gunp7 = -1 {gunp7=-gunp7 Trig7=50000}if gun=2 & _KEY(4) & _RZ(gun8,0) &lt; 0 & gunp8 = -1 {gunp8=-gunp8 Trig8=50000}

if _RZ(gun1,0) &lt; 0 & gunp1 = 1{gunp1=-gunp1} if _RZ(gun2,0) &lt; 0 & gunp2 = 1{gunp2=-gunp1} if _RZ(gun3,0) &lt; 0 & gunp3 = 1{gunp3=-gunp1}if _RZ(gun4,0) &lt; 0 & gunp4 = 1{gunp4=-gunp1}

if _RZ(gun5,0) &gt; 0 & gunp5 = 1{gunp5=-gunp1} if _RZ(gun6,0) &gt; 0 & gunp6 = 1{gunp6=-gunp1} if _RZ(gun7,0) &gt; 0 & gunp7 = 1{gunp7=-gunp1}if _RZ(gun8,0) &gt; 0 & gunp8 = 1{gunp8=-gunp1}

if gun=2 {stand=stand-5 stand2=stand2-10 top=top+20 top2=top2-20}

if _key(5)=1 {goto gun1:} if gun=1 {gun=2} if gun=3 {gun=0} label gun1

if _key(5)=0 {goto gun2:} if gun=0 {gun=1} if gun=2 {gun=3} label gun2 }