Advertisement
Guest User

Untitled

a guest
Mar 18th, 2018
99
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 8.18 KB | None | 0 0
  1. #Current Ver: 1.6
  2. @name DAC Scope HUD
  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 = 0 ## Set this to 1 if you have EGP Extras installed ##
  63.  
  64. CrosshairType = "russian" ## 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 + "crosshair.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. ###Speed / RPM / Gear###
  149.  
  150. #Gear
  151.  
  152. EGP:egpText(9,"GEAR",vec2(50,50))
  153. EGP:egpSize(9,40)
  154. EGP:egpFont(9,"")
  155.  
  156. #Gear Number
  157.  
  158. EGP:egpText(10 ,""+Gear,vec2(250,50))
  159. EGP:egpSize(10, 40)
  160. EGP:egpAlign(10,2,0)
  161. EGP:egpFont(10,"")
  162.  
  163. #RPM
  164.  
  165. EGP:egpText(11,"RPM",vec2(50,80))
  166. EGP:egpSize(11,40)
  167. EGP:egpFont(11,"")
  168.  
  169. #RPM Number
  170.  
  171. EGP:egpText(12,""+RPM ,vec2(240,80))
  172. EGP:egpSize(12,40)
  173. EGP:egpAlign(12,1,0)
  174. EGP:egpFont(12,"")
  175.  
  176.  
  177. #Speed
  178.  
  179. EGP:egpText(13,"SPD",vec2(50,110))
  180. EGP:egpSize(13,40)
  181. EGP:egpFont(13,"")
  182.  
  183. #Speed Number
  184.  
  185. EGP:egpText(14 ,"123" ,vec2(250,110))
  186. EGP:egpSize(14, 40)
  187. EGP:egpAlign(14,2,0)
  188. EGP:egpFont(14,"")
  189.  
  190. #Speed KMH
  191.  
  192. EGP:egpText(15,"km/h" ,vec2(255,118))
  193. EGP:egpSize(15,30)
  194. EGP:egpFont(15,"")
  195.  
  196. ###COMPASS###
  197.  
  198. CCPos = vec2((CompassSize+50),Res:y()-(CompassSize+50))
  199.  
  200. #Compass Dummy
  201.  
  202. EGP:egpBox(16,CCPos,vec2(0,0))
  203. EGP:egpAlpha(16,0)
  204.  
  205. #Compass Circle
  206.  
  207. EGP:egpCircle(17,vec2(0,0),vec2(CompassSize,CompassSize))
  208. EGP:egpColor(17,vec(60,60,60))
  209. EGP:egpAlpha(17,200)
  210. EGP:egpParent(17,16)
  211.  
  212. #Hull Dummy
  213.  
  214. EGP:egpCircle(18,CCPos,vec2(0,0))
  215. EGP:egpAlpha(18,0)
  216.  
  217. #Hull
  218.  
  219. TDR = array(vec2(35,-55),vec2(35,55),vec2(-35,55),vec2(-35,-55),vec2(0,-65))
  220. EGP:egpPolyOutline(19,TDR)
  221. EGP:egpColor(19,CompassColor)
  222. EGP:egpSize(19,2)
  223. EGP:egpParent(19,18)
  224.  
  225. #Turret Dummy
  226.  
  227. EGP:egpCircle(20,CCPos,vec2(0,0))
  228. EGP:egpAlpha(20,0)
  229.  
  230. #Turret
  231.  
  232. EGP:egpTriangleOutline(21,vec2(0,-50),vec2(30,25),vec2(-30,25))
  233. EGP:egpColor(21,CompassColor)
  234. EGP:egpSize(21,2)
  235. EGP:egpParent(21,20)
  236.  
  237. ###Ammo###
  238.  
  239. #Ammo Circle
  240.  
  241. EGP:egpCircle(22,CCPos+vec2(CompassSize+60,CompassSize-60),vec2(60,60))
  242. EGP:egpColor(22, vec4(60, 220, 60, 60))
  243. EGP:egpAngle(22, 90)
  244. EGP:egpSize(22, 360)
  245.  
  246. #Ammo Counter
  247.  
  248. EGP:egpText(23 ,"0" ,CCPos+vec2(CompassSize+60,CompassSize-60))
  249. EGP:egpSize(23,70)
  250. EGP:egpAlign(23,1,1)
  251. }
  252. elseif(Active)
  253. {
  254.  
  255. #3DTracker Pos
  256.  
  257. holoPos(1,rangerOffset(9999999999,Gun:pos()+Gun:forward()*100,Gun:forward()):position())
  258.  
  259. holoPos(2,EndPos)
  260.  
  261. #Color of crosshair based on gun ready
  262.  
  263. EGP:egpColor(7,vec(255*!GunReady,200*GunReady,0))
  264. EGP:egpColor(8,vec(255*!GunReady,200*GunReady,0))
  265. EGP:egpColor(22,vec(255*!GunReady,200*GunReady,0))
  266.  
  267.  
  268. #Missile Guidance Pos
  269.  
  270. Guide = Cam["Trace",ranger]:pos()
  271.  
  272. #Scope
  273.  
  274. if(Button)
  275. {
  276. EGP:egpAlpha(1,255) EGP:egpAlpha(2,255) EGP:egpAlpha(7,0) EGP:egpAlpha(8,0) EGP:egpAlpha(24,255) EGP:egpAlpha(25,255)
  277. for(I=50,100)
  278. {
  279. EGP:egpAlpha(I,255)
  280. }
  281. }
  282.  
  283.  
  284.  
  285. if(Button == 0)
  286. {
  287. EGP:egpAlpha(1,0) EGP:egpAlpha(2,0) EGP:egpAlpha(7,255) EGP:egpAlpha(8,255) EGP:egpAlpha(24,0) EGP:egpAlpha(25,0)
  288. for(I=50,100)
  289. {
  290. EGP:egpAlpha(I,0)
  291. }
  292. }
  293.  
  294. #Changing Text
  295.  
  296. if(changed(Gear)){EGP:egpSetText(10,""+floor(Gear))}
  297. EGP:egpSetText(12,""+int(RPM/100)*100)
  298. KPH = floor(Base:vel():length() / 10.9)
  299. EGP:egpSetText(14,""+KPH)
  300.  
  301. #Changing Angles
  302.  
  303. EGP:egpAngle(16,-Cam["CamAng",angle]:yaw()+90)
  304. EGP:egpAngle(18,(Base:angles():yaw()-90)+EGP:egpAngle(16))
  305. EGP:egpAngle(20,(Gun:angles():yaw()-90)+EGP:egpAngle(16))
  306.  
  307. #AmmoCount
  308. if(changed(AmmoCount))
  309. {
  310. EGP:egpSetText(23,""+AmmoCount)
  311. }
  312.  
  313. #Endpos Disable
  314. if(EndPos == vec(0,0,0))
  315. {
  316. EGP:egpAlpha(6,0)
  317. }
  318.  
  319.  
  320. }
  321.  
  322. interval(100)
  323. if(last()){
  324. EGP:egpClear()
  325. }
  326. if(dupefinished()|duped()){
  327. reset()
  328. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement