Advertisement
Guest User

Untitled

a guest
Jan 21st, 2018
63
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 6.93 KB | None | 0 0
  1. #Current Ver: 1.6
  2. @name Scope HUD - DatAmazingCheese
  3. @inputs Button [Cam Pod EGP]:wirelink [Gun Base]:entity EndPos:vector GunReady AmmoCount
  4. @inputs RPM Gear
  5. @outputs Guide:vector Res:vector2
  6. @persist CompassColor:vector
  7. @trigger Active GunReady Mouse1
  8. @autoupdate
  9. #[
  10.  
  11. ChangeLog
  12.  
  13. -V1
  14. Basic scope nothing else hud
  15.  
  16. -V1.1
  17. More reticles, ballistics etc
  18.  
  19. -V1.2
  20. Missile Guidance, even more reticles
  21.  
  22. -V1.3
  23. Compass, Ammo counter, fixed reticles
  24.  
  25. -V1.4
  26. Dynamic res yay
  27.  
  28. -V1.5
  29. Fixed dynamic scaling based on resolution, courtesy of Danny
  30.  
  31. -V1.6
  32. Added EGP Extras Support
  33.  
  34.  
  35. #########################################################################################################################
  36.  
  37. #Hello, this is a scope HUD for tanks made by DatAmazingCheese with the help of Tyunge for the outer part of the scope.
  38. #Please by all means give this to your friends, but do not claim it as your own. I will find you.
  39.  
  40. #It's recommended you download EGP Extras and turn on "Extra Mode" in the options to have less of an impact on FPS
  41.  
  42. # http://steamcommunity.com/sharedfiles/filedetails/?id=769791162 #
  43.  
  44. ]#
  45.  
  46. Active = Pod["Active",number]
  47. Mouse1 = Pod["Mouse1",number]
  48.  
  49. if( first() #[| changed(EGP)]# | changed(Active)&Active){
  50.  
  51.  
  52. EGP:egpClear()
  53.  
  54. ### Variables ##
  55.  
  56. CompassSize = 140 ## The size of the compass ##
  57.  
  58. CompassColor = vec(255,255,255) ## The color of the tank in the compass ##
  59.  
  60. Debug = 0 ## For debugging resolution, you shouldn't need to touch this ##
  61.  
  62. Extras = 1 ## Set this to 1 if you have EGP Extras installed ##
  63.  
  64. CrosshairType = "german" ## Either 'russian' or 'german' this only works with EGP Extras installed & Extras set to 1 ##
  65.  
  66.  
  67. #DO NOT TOUCH UNDER
  68.  
  69. #########################################################################################################################
  70.  
  71. holoCreate(1)
  72. holoAlpha(1,0)
  73. holoCreate(2)
  74. holoAlpha(2,0)
  75.  
  76. #EGP:egpDrawTopLeft(0)
  77.  
  78. Res = egpScrSize(Pod["Entity",entity]:driver())
  79. #Res = vec2(1600,1200)
  80.  
  81. ### Static Index EGP Elements
  82.  
  83. if(Extras == 1)
  84. {
  85.  
  86. EGP:egpBox(24,Res/2,Res/0.55)
  87. EGP:egpMaterial(24,"egpextras/textures/tank/overlays/sniperblack.png")
  88.  
  89. EGP:egpBox(25,Res/2,vec2(1024,1024)/1.05)
  90. EGP:egpMaterial(25,"egpextras/textures/tank/reticles/"+ CrosshairType + "crosshair01.png")
  91.  
  92. }
  93. else
  94. {
  95.  
  96. EGP:egpBox(1,Res/2,vec2(10000,3)) #Line Horiz
  97. EGP:egpColor(1,vec(0,0,0))
  98.  
  99. EGP:egpBox(2,Res/2,vec2(3,10000)) #Line Vert
  100. EGP:egpColor(2,vec(0,0,0))
  101.  
  102. }
  103.  
  104. EGP:egp3DTracker(3,vec(0,0,0)) #Reticle tracker
  105. EGP:egpParent(3,holoEntity(1))
  106.  
  107. EGP:egpCircleOutline(4,vec2(0,0),vec2(7,7)) #Reticle dot
  108. EGP:egpColor(4,vec(0,200,0))
  109. EGP:egpParent(4,3)
  110.  
  111. EGP:egp3DTracker(5,vec(0,0,0)) #Ballistics tracker
  112. EGP:egpParent(5,holoEntity(2))
  113.  
  114. EGP:egpCircleOutline(6,vec2(0,0),vec2(5,5)) #Ballistics dot
  115. EGP:egpColor(6,vec(200,0,0))
  116. EGP:egpParent(6,5)
  117.  
  118. EGP:egpCircleOutline(7,Res/2,vec2(15,15))
  119. EGP:egpColor(7,vec(0,200,0))
  120.  
  121. EGP:egpCircleOutline(8,Res/2,vec2(14,14))
  122. EGP:egpColor(8,vec(0,200,0))
  123.  
  124. if(Debug==1)
  125. {
  126. EGP:egpBoxOutline(900,Res/2,Res)
  127. }
  128.  
  129. ### Variable Index EGP Elements
  130. if(Extras == 0)
  131. {
  132. for (I=50,100)
  133. {
  134. I++
  135. Sin = sin((360 / 50) * I) * (Res:y())
  136. Cos = cos((360 / 50) * I) * (Res:y())
  137.  
  138. EGP:egpBox(I, Res/2 + vec2(Sin, Cos), vec2(Res:y()+100, Res:y()+100))
  139. EGP:egpAngle(I, (((I / 50) * 360)))
  140. EGP:egpColor(I, vec4(0, 0, 0, 0))
  141. }
  142. }
  143.  
  144. rangerFilter(Gun)
  145. rangerFilter(entity():getConstraints())
  146. rangerPersist(1)
  147.  
  148.  
  149. ###COMPASS###
  150.  
  151. CCPos = vec2((CompassSize+50),Res:y()-(CompassSize+50))
  152.  
  153. #Compass Dummy
  154.  
  155. EGP:egpBox(16,CCPos,vec2(0,0))
  156. EGP:egpAlpha(16,0)
  157.  
  158. #Compass Circle
  159.  
  160. EGP:egpCircle(17,vec2(0,0),vec2(CompassSize,CompassSize))
  161. EGP:egpColor(17,vec(60,60,60))
  162. EGP:egpAlpha(17,200)
  163. EGP:egpParent(17,16)
  164.  
  165. #Hull Dummy
  166.  
  167. EGP:egpCircle(18,CCPos,vec2(0,0))
  168. EGP:egpAlpha(18,0)
  169.  
  170. #Hull
  171.  
  172. TDR = array(vec2(35,-55),vec2(35,55),vec2(-35,55),vec2(-35,-55),vec2(0,-65))
  173. EGP:egpPolyOutline(19,TDR)
  174. EGP:egpColor(19,CompassColor)
  175. EGP:egpSize(19,2)
  176. EGP:egpParent(19,18)
  177.  
  178. #Turret Dummy
  179.  
  180. EGP:egpCircle(20,CCPos,vec2(0,0))
  181. EGP:egpAlpha(20,0)
  182.  
  183. #Turret
  184.  
  185. EGP:egpTriangleOutline(21,vec2(0,-50),vec2(30,25),vec2(-30,25))
  186. EGP:egpColor(21,CompassColor)
  187. EGP:egpSize(21,2)
  188. EGP:egpParent(21,20)
  189.  
  190. ###Ammo###
  191.  
  192. #Ammo Circle
  193.  
  194. EGP:egpCircle(22,CCPos+vec2(CompassSize+60,CompassSize-60),vec2(60,60))
  195. EGP:egpColor(22, vec4(60, 220, 60, 60))
  196. EGP:egpAngle(22, 90)
  197. EGP:egpSize(22, 360)
  198.  
  199. #Ammo Counter
  200.  
  201. EGP:egpText(23 ,"0" ,CCPos+vec2(CompassSize+60,CompassSize-60))
  202. EGP:egpSize(23,70)
  203. EGP:egpAlign(23,1,1)
  204. }
  205. elseif(Active)
  206. {
  207.  
  208. #3DTracker Pos
  209.  
  210. holoPos(1,rangerOffset(9999999999,Gun:pos()+Gun:forward()*100,Gun:forward()):position())
  211.  
  212. holoPos(2,EndPos)
  213.  
  214. #Color of crosshair based on gun ready
  215.  
  216. EGP:egpColor(7,vec(255*!GunReady,200*GunReady,0))
  217. EGP:egpColor(8,vec(255*!GunReady,200*GunReady,0))
  218. EGP:egpColor(22,vec(255*!GunReady,200*GunReady,0))
  219.  
  220.  
  221. #Missile Guidance Pos
  222.  
  223. Guide = Cam["Trace",ranger]:pos()
  224.  
  225. #Scope
  226.  
  227. if(Button)
  228. {
  229. EGP:egpAlpha(1,255) EGP:egpAlpha(2,255) EGP:egpAlpha(7,0) EGP:egpAlpha(8,0) EGP:egpAlpha(24,255) EGP:egpAlpha(25,255)
  230. for(I=50,100)
  231. {
  232. EGP:egpAlpha(I,255)
  233. }
  234. }
  235.  
  236.  
  237.  
  238. if(Button == 0)
  239. {
  240. EGP:egpAlpha(1,0) EGP:egpAlpha(2,0) EGP:egpAlpha(7,255) EGP:egpAlpha(8,255) EGP:egpAlpha(24,0) EGP:egpAlpha(25,0)
  241. for(I=50,100)
  242. {
  243. EGP:egpAlpha(I,0)
  244. }
  245. }
  246.  
  247. #Changing Angles
  248.  
  249. EGP:egpAngle(16,-Cam["CamAng",angle]:yaw()+90)
  250. EGP:egpAngle(18,(Base:angles():yaw()-90)+EGP:egpAngle(16))
  251. EGP:egpAngle(20,(Gun:angles():yaw()-90)+EGP:egpAngle(16))
  252.  
  253. #AmmoCount
  254. if(changed(AmmoCount))
  255. {
  256. EGP:egpSetText(23,""+AmmoCount)
  257. }
  258.  
  259. #Endpos Disable
  260. if(EndPos == vec(0,0,0))
  261. {
  262. EGP:egpAlpha(6,0)
  263. }
  264.  
  265.  
  266. }
  267.  
  268. interval(100)
  269. if(last()){
  270. EGP:egpClear()
  271. }
  272. if(dupefinished()|duped()){
  273. reset()
  274. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement