Advertisement
RA2lover

RigidChips ManualJet

Jun 7th, 2012
94
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 4.57 KB | None | 0 0
  1. // [RCD]
  2. Val{
  3. ARM(default=0, max=2500000, step=2500000)
  4. ARMH(default=0, max=12800000, step=12800000)
  5. ARMHA(default=180, min=-360, max=360)
  6. ARML(default=0, max=150000, step=150000)
  7. ARMLA(default=360, min=-360, max=360)
  8. ARMM(default=0, max=1600000, step=1600000)
  9. ARMMA(default=180, min=-360, max=360)
  10. COL1(default=16766249, max=16777215)
  11. COL2(default=40561, max=16777215)
  12. COLSLC(default=0, max=4)
  13. GUNSLC(default=0, max=3)
  14. JFWD(default=0, min=-1000000, max=1000000)
  15. JLR1(default=0, min=-1000000, max=1000000)
  16. JLR2(default=0, min=-1000000, max=1000000)
  17. JUP1(default=0, min=-1000000, max=1000000)
  18. JUP2(default=0, min=-1000000, max=1000000)
  19. TRIM(default=45, min=-99999999999999)
  20. }
  21. Key{
  22. }
  23. Body{
  24. Core(color=COL1){
  25. S:Jet(power=JUP1, color=COL1){
  26. S:Jet(power=JUP2, color=COL1){
  27. S:Weight(option=2.1, color=COL1){}
  28. }
  29. S:TrimF(angle=90, color=COL2){
  30. E:Jet(angle=180, power=JLR2, color=COL1){}
  31. }
  32. }
  33. S:TrimF(angle=90, color=COL2){
  34. E:Jet(angle=180, power=JLR1, color=COL1){}
  35. }
  36. S:Frame(angle=30, option=1){
  37. S:Jet(angle=-120, power=-JFWD, color=COL1){}
  38. }
  39. S:TrimF(angle=TRIM, color=COL1){
  40. S:Frame(color=COL1){
  41. W:Frame(color=COL1){
  42. W:Cowl(angle=180, color=COL2, effect=#0FFF){}
  43. N:Cowl(option=3, color=COL2, effect=#0FFF){}
  44. }
  45. E:Frame(color=COL1){
  46. N:Cowl(angle=180, color=COL2, effect=#0FFF){
  47. S:Cowl(option=3, color=COL2, effect=#0FFF){}
  48. }
  49. }
  50. }
  51. }
  52. N:Arm(angle=ARMLA, power=ARML, option=150000, color=COL1, name=AL){}
  53. N:Arm(angle=ARMMA, power=ARMM, option=1600000, color=COL2, name=AM){}
  54. N:Arm(angle=ARMHA, power=ARMH, option=12800000, name=AH){}
  55. }
  56. }
  57. Lua{selectedgun = 0 --==150k , 1=1.6m, 2 = 12.8m
  58. selectedskin = 4
  59.  
  60. function mpos()
  61. return {(_MX()/_WIDTH())*2 - 1,(_MY()/_HEIGHT())*2 -1}
  62. end
  63.  
  64. function rels2t(trig,str)
  65. if trig>0 then
  66. JUP1 = JUP1+ (mpos()[2]*-str)
  67. JUP2=JUP2-(mpos()[2]*-str)
  68. JLR1=JLR1+(mpos()[1]*str)
  69. JLR2=JLR2-(mpos()[1]*str)
  70. end
  71. end
  72.  
  73. function keysnap(n,increment)
  74. return _KEYDOWN(n)*increment
  75. end
  76.  
  77. function varcontrol(var,setpoint,step)
  78. --closed loop RC-like control
  79. if math.abs(var-setpoint)<step then var=setpoint
  80. elseif var>setpoint then var=var-step else var=var+step end
  81. return var
  82. end
  83.  
  84. function weaponcontrol(gun,fire,line,prefix)
  85. local text = ""
  86. ARMLA = varcontrol(ARMLA,180,12)
  87. ARMMA = varcontrol(ARMMA,181,12)
  88. ARMHA = varcontrol(ARMHA,179,12)
  89. if gun==0 then
  90. ARMLA = varcontrol(ARMLA, 360,24)
  91. text = "150K Cannon - "..string.format("%i",_E(AL)/1500).."% Loaded"
  92. if fire>0 and ARMLA==360 then ARML = 150000 end
  93. elseif gun==1 then
  94. ARMMA = varcontrol(ARMMA,360,24)
  95. text = "1.6M Light Capacitor Weapon - "..string.format("%i",_E(AM)/16000).."% Charged"
  96. if fire>0 and ARMMA == 360 then ARMM = 1600000 end
  97. elseif gun==2 then
  98. ARMHA = varcontrol(ARMHA,360,24)
  99. text = "12.8M Hi-Yield Capacitor Cannon - "..string.format("%i",_E(AH)/128000).."% Charged"
  100. if fire>0 and ARMHA==360 then ARMH = 12800000 end
  101. end
  102. out(line, prefix..text)
  103. end
  104.  
  105. function colorschemeselect(n,line,prefix)
  106. --selects color scheme and outputs it on the specified line
  107. local text = ""
  108. if n==1 then
  109. COL1=rgb(255,255,255) COL2=rgb(255,255,100)
  110. text = "US Air Force" end
  111.  
  112. if n==2 then
  113. COL2=rgb(255,0,0) COL1= rgb(255,200,0)
  114. text = "Soviets' Red Army"
  115. end
  116.  
  117. if n==3 then
  118. COL2=rgb(255,255,255) COL1 = rgb(255,0,0)
  119. text = "Imperial Japanese Air Force"
  120. end
  121.  
  122. if n==4 then
  123. COL1=rgb(100,100,100) COL2=rgb(200,200,0)
  124. text = "Wermacht's Luftwaffe" end
  125.  
  126. out(line,prefix..text)
  127. end -- COLORSCHEMESELECT
  128.  
  129. function sgn(n)
  130. if n < 0 then return -1 else return 1 end
  131. end
  132.  
  133. function rgb(r,g,b) --RGB->24BitColor
  134. return (math.floor((r)*65536))+(math.floor((g)*256))+(math.floor(b))
  135. end
  136.  
  137. function F2PWR(x,y,z,tx,ty)
  138. JUP1 = ((_YX()*x)+(_YY()*y)+(_YZ()*z)+(_XY()*0)+(_YY()*0))*3
  139. JUP2 = ((_YX()*x)+(_YY()*y)+(_YZ()*z)-(_XY()*0)-(_YY()*0))*3
  140. JLR1 = ((_XX()*x)+(_XY()*y)+(_XZ()*z)+(_YX()*0)+(_YX()*0))*3
  141. JLR2 = ((_XX()*x)+(_XY()*y)+(_XZ()*z)-(_YX()*0)-(_YX()*0))*3
  142. JFWD=((_ZX()*x)+(_ZY()*y)+(_ZZ()*z))*6
  143. end
  144.  
  145. function rollcorrect()
  146. TRIM=TRIM+(_AZ()*100)
  147. end
  148.  
  149. function main()
  150. selectedgun = selectedgun+ keysnap(14,1)
  151.  
  152. _ZOOM(60)
  153. rollcorrect()
  154. F2PWR(0,_WEIGHT()*9.81,0)
  155. rels2t(_ML(),10000)
  156. if selectedgun==3 then selectedgun=0 end
  157. --printings
  158. out(0,"Manual-Jet Flight control system")
  159. colorschemeselect(selectedskin,1,"Color Scheme = ")
  160. weaponcontrol(selectedgun,_MR(), 2, "Selected Weapon = ")
  161. out(10,rgb(255,0,0))
  162. out(11,_FPS())
  163. out(3,_QZ())
  164. end}
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement