Advertisement
DatAmazingCheese

Simple Shift Light

Jan 1st, 2017
360
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 4.43 KB | None | 0 0
  1. @name Simple Shift Light
  2. @inputs Engine:entity
  3. @persist Q
  4.  
  5. interval(100)
  6.  
  7. if(first()|dupefinished())
  8. {
  9.  
  10.  
  11. Scale = 1
  12.  
  13. Invert = 1
  14.  
  15. #############################################################################################
  16. #[
  17.  
  18. Created by DatAmazingCheese
  19.  
  20. Distribute if you want to. Don't claim as your own.
  21.  
  22. The first light will turn green when you enter your engines powerband, the other 2 green lights
  23. will turn green at 3rds until you reach your powerband.
  24.  
  25. Once you reach your engines max powerband the yellow light will turn on. This is the best time
  26. to shift gears.
  27.  
  28. When you are near or at your redline, the red light will flash.
  29.  
  30. When there are no lights on, it is best to downshift to stay in powerband!
  31.  
  32. ]#
  33. #############################################################################################
  34.  
  35. I = 1
  36.  
  37. entity():setAlpha(0)
  38.  
  39. holoCreate(I) #Base
  40. holoParent(I, entity())
  41. holoColor(I, vec(255, 255, 255))
  42. holoAlpha(I, 255)
  43. holoScale(I, vec(1, 1, 1)*Scale)
  44. holoPos(I, entity():toWorld(vec(1.4, 0, 0)*Scale))
  45. holoAng(I, entity():toWorld(ang(-90, 0, 0)))
  46. holoMaterial(I, "")
  47. holoModel(I, "models/wingf0x/hdmisocket.mdl")
  48. holoSkin(I, 0)
  49. I++
  50.  
  51. holoCreate(I) #Light 1
  52. holoParent(I, entity())
  53. holoAlpha(I, 255)
  54. #holoColor(I,vec(0, 255, 63))
  55. holoScale(I, vec(0.075, 0.075, 0.075)*Scale)
  56. holoPos(I, entity():toWorld(vec(1.3999, (abs(-2)-abs(-2*2)*Invert)*-((abs(-2)+2)/(abs(-2)*2))+(abs(-2)-abs(-2*2)*Invert)*((abs(-2)-2)/(abs(-2)*2)), 0.5)*Scale))
  57. holoAng(I, entity():toWorld(ang(0, 0, 0)))
  58. holoMaterial(I, "")
  59. holoModel(I, "models/holograms/icosphere3.mdl")
  60. holoSkin(I, 0)
  61. I++
  62.  
  63. holoCreate(I) #Light 2
  64. holoParent(I, entity())
  65. holoAlpha(I, 255)
  66. #holoColor(I,vec(0, 255, 63))
  67. holoScale(I, vec(0.075, 0.075, 0.075)*Scale)
  68. holoPos(I, entity():toWorld(vec(1.3999, (abs(-1)-abs(-1*2)*Invert)*-((abs(-1)+1)/(abs(-1)*2))+(abs(-1)-abs(-1*2)*Invert)*((abs(-1)-1)/(abs(-1)*2)), 0.5)*Scale))
  69. holoAng(I, entity():toWorld(ang(0, 0, 0)))
  70. holoMaterial(I, "")
  71. holoModel(I, "models/holograms/icosphere3.mdl")
  72. holoSkin(I, 0)
  73. I++
  74.  
  75. holoCreate(I) #Light 3
  76. holoParent(I, entity())
  77. holoAlpha(I, 255)
  78. #holoColor(I,vec(0, 255, 63))
  79. holoScale(I, vec(0.075, 0.075, 0.075)*Scale)
  80. holoPos(I, entity():toWorld(vec(1.4, 0, 0.5)*Scale))
  81. holoAng(I, entity():toWorld(ang(0, 0, 0)))
  82. holoMaterial(I, "")
  83. holoModel(I, "models/holograms/icosphere3.mdl")
  84. holoSkin(I, 0)
  85. I++
  86.  
  87. holoCreate(I) #Light 4
  88. holoParent(I, entity())
  89. holoAlpha(I, 255)
  90. #holoColor(I,vec(255, 191, 0))
  91. holoScale(I, vec(0.075, 0.075, 0.075)*Scale)
  92. holoPos(I, entity():toWorld(vec(1.4, abs(1)-abs(1*2)*Invert, 0.5)*Scale))
  93. holoAng(I, entity():toWorld(ang(0, 0, 0)))
  94. holoMaterial(I, "")
  95. holoModel(I, "models/holograms/icosphere3.mdl")
  96. holoSkin(I, 0)
  97. I++
  98.  
  99. holoCreate(I) #Light 5
  100. holoParent(I, entity())
  101. holoAlpha(I, 255)
  102. #holoColor(I,vec(255, 0, 0))
  103. holoScale(I, vec(0.075, 0.075, 0.075)*Scale)
  104. holoPos(I, entity():toWorld(vec(1.4, abs(2)-abs(2*2)*Invert, 0.5)*Scale))
  105. holoAng(I, entity():toWorld(ang(0, 0, 0)))
  106. holoMaterial(I, "")
  107. holoModel(I, "models/holograms/icosphere3.mdl")
  108. holoSkin(I, 0)
  109. I++
  110.  
  111. }
  112.  
  113. ### First Green Light
  114.  
  115. if(Engine:acfRPM()>(Engine:acfPowerbandMin()))
  116. {
  117. holoDisableShading(2,1)
  118. holoColor(2,vec(0, 255, 63))
  119. }else{
  120. holoDisableShading(2,0)
  121. holoColor(2,vec(60, 60, 60))
  122. }
  123.  
  124. ### Second Green Light
  125.  
  126. if(Engine:acfRPM()>(Engine:acfPowerbandMax()-Engine:acfPowerbandMin())*1.9)
  127. {
  128. holoDisableShading(3,1)
  129. holoColor(3,vec(0, 255, 63))
  130. }else{
  131. holoDisableShading(3,0)
  132. holoColor(3,vec(60, 60, 60))
  133. }
  134.  
  135. ### Third Green Light
  136.  
  137. if(Engine:acfRPM()>(Engine:acfPowerbandMax()-Engine:acfPowerbandMin())*2.3)
  138. {
  139. holoDisableShading(4,1)
  140. holoColor(4,vec(0, 255, 63))
  141. }else{
  142. holoDisableShading(4,0)
  143. holoColor(4,vec(60, 60, 60))
  144. }
  145.  
  146. ### Shift Light
  147.  
  148. if(Engine:acfRPM()>(Engine:acfPowerbandMax()))
  149. {
  150. holoDisableShading(5,1)
  151. holoColor(5,vec(255, 191, 0))
  152. }else{
  153. holoDisableShading(5,0)
  154. holoColor(5,vec(60, 60, 60))
  155. }
  156.  
  157. ### Redline Light
  158.  
  159. timer("redline",100)
  160.  
  161. if(clk("redline"))
  162. {
  163. Q++
  164. }
  165.  
  166. if(Engine:acfRPM()>(Engine:acfRedline()/1.17))
  167. {
  168. if(Q>1){Q=0}
  169. holoColor(6,vec(255, 0, 0))
  170. }else{
  171. holoDisableShading(6,0)
  172. holoColor(6,vec(60, 60, 60))
  173. }
  174.  
  175. holoDisableShading(6,Q)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement