Advertisement
DatAmazingCheese

Simple Gauges

Nov 1st, 2016
205
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.60 KB | None | 0 0
  1. @name Simple Gauges
  2. @inputs Engine:entity
  3. @outputs
  4. @persist I
  5. @trigger none
  6.  
  7. if( first() | duped() | dupefinished() )
  8. {
  9. ###########################################################################
  10.  
  11. ## Welcome to Simple Gauges! Just wire Engine and parent this chip to your gate. ##
  12. ## This chip is made by DatAmazingCheese, feel free to give out but don't say it's yours :> ##
  13.  
  14. GaugeColor = vec(255,255,255)
  15.  
  16. NeedleColor = vec(200,0,0)
  17.  
  18. Mode = "kph" ## Either "kph" or "mph" ##
  19.  
  20. ###########################################################################
  21.  
  22. ## Gauges
  23.  
  24. holoCreate(1) # Speedometer
  25. holoModel(1,"models/sprops/trans/misc/gauge_1.mdl")
  26. holoColor(1,GaugeColor)
  27. holoSkin(1,1)
  28. holoPos(1,entity():toWorld(vec(0,3,0)))
  29. holoAng(1,entity():toWorld(ang(0,0,0)))
  30. holoParent(1,entity())
  31.  
  32. holoCreate(2) # Tachometer
  33. holoModel(2,"models/sprops/trans/misc/gauge_1.mdl")
  34. holoColor(2,GaugeColor)
  35. holoSkin(2,0)
  36. holoPos(2,entity():toWorld(vec(0,-3,0)))
  37. holoAng(2,entity():toWorld(ang(0,0,0)))
  38. holoParent(2,entity())
  39.  
  40. ## Needle Dummies
  41.  
  42. holoCreate(3)
  43. holoModel(3,"")
  44. holoColor(3,NeedleColor)
  45. holoSkin(3,0)
  46. holoScale(3,vec(0.1,0.05,0.05))
  47. holoPos(3,entity():toWorld(vec(0,3,0)))
  48. holoAng(3,entity():toWorld(ang(0,0,0)))
  49. holoParent(3,entity())
  50.  
  51. holoCreate(4)
  52. holoModel(4,"")
  53. holoColor(4,NeedleColor)
  54. holoSkin(4,0)
  55. holoScale(4,vec(0.1,0.05,0.05))
  56. holoPos(4,entity():toWorld(vec(0,-3,0)))
  57. holoAng(4,entity():toWorld(ang(0,0,0)))
  58. holoParent(4,entity())
  59.  
  60. ## Needles
  61.  
  62. holoCreate(5)
  63. holoModel(5,"models/holograms/prism.mdl")
  64. holoColor(5,NeedleColor)
  65. holoSkin(5,0)
  66. holoScale(5,vec(0.03,0.03,0.18))
  67. holoPos(5,entity():toWorld(vec(0.35,3,1.3)))
  68. holoAng(5,entity():toWorld(ang(0,90,0)))
  69. holoParent(5,3)
  70.  
  71. holoCreate(6)
  72. holoModel(6,"models/holograms/prism.mdl")
  73. holoColor(6,NeedleColor)
  74. holoSkin(6,0)
  75. holoScale(6,vec(0.03,0.03,0.18))
  76. holoPos(6,entity():toWorld(vec(0.35,-3,1.3)))
  77. holoAng(6,entity():toWorld(ang(0,90,0)))
  78. holoParent(6,4)
  79.  
  80. }
  81.  
  82. interval(100)
  83.  
  84. if( Mode == "kph" )
  85. {
  86. Speed = floor(entity():vel():length() / 10.9)
  87. }
  88. else
  89. {
  90. Speed = floor(entity():vel():length() / 17.6)
  91. }
  92.  
  93. RPM = Engine:acfRPM()
  94.  
  95. holoAng(3,Engine:vel():length():toWorld(ang(0,0,180-RPM/28.3)))
  96.  
  97. holoAng(4,Engine:vel():length():toWorld(ang(0,0,180-Speed/0.565)))
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement