Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #Current Ver: 1.6
- @name Scope HUD - DatAmazingCheese
- @inputs Button [Cam Pod EGP]:wirelink [Gun Base]:entity EndPos:vector GunReady AmmoCount
- @inputs RPM Gear
- @outputs Guide:vector Res:vector2
- @persist CompassColor:vector
- @trigger Active GunReady Mouse1
- @autoupdate
- #[
- ChangeLog
- -V1
- Basic scope nothing else hud
- -V1.1
- More reticles, ballistics etc
- -V1.2
- Missile Guidance, even more reticles
- -V1.3
- Compass, Ammo counter, fixed reticles
- -V1.4
- Dynamic res yay
- -V1.5
- Fixed dynamic scaling based on resolution, courtesy of Danny
- -V1.6
- Added EGP Extras Support
- #########################################################################################################################
- #Hello, this is a scope HUD for tanks made by DatAmazingCheese with the help of Tyunge for the outer part of the scope.
- #Please by all means give this to your friends, but do not claim it as your own. I will find you.
- #It's recommended you download EGP Extras and turn on "Extra Mode" in the options to have less of an impact on FPS
- # http://steamcommunity.com/sharedfiles/filedetails/?id=769791162 #
- ]#
- Active = Pod["Active",number]
- Mouse1 = Pod["Mouse1",number]
- if( first() #[| changed(EGP)]# | changed(Active)&Active){
- EGP:egpClear()
- ### Variables ##
- CompassSize = 140 ## The size of the compass ##
- CompassColor = vec(255,255,255) ## The color of the tank in the compass ##
- Debug = 0 ## For debugging resolution, you shouldn't need to touch this ##
- Extras = 1 ## Set this to 1 if you have EGP Extras installed ##
- CrosshairType = "german" ## Either 'russian' or 'german' this only works with EGP Extras installed & Extras set to 1 ##
- #DO NOT TOUCH UNDER
- #########################################################################################################################
- holoCreate(1)
- holoAlpha(1,0)
- holoCreate(2)
- holoAlpha(2,0)
- #EGP:egpDrawTopLeft(0)
- Res = egpScrSize(Pod["Entity",entity]:driver())
- #Res = vec2(1600,1200)
- ### Static Index EGP Elements
- if(Extras == 1)
- {
- EGP:egpBox(24,Res/2,Res/0.55)
- EGP:egpMaterial(24,"egpextras/textures/tank/overlays/sniperblack.png")
- EGP:egpBox(25,Res/2,vec2(1024,1024)/1.05)
- EGP:egpMaterial(25,"egpextras/textures/tank/reticles/"+ CrosshairType + "crosshair01.png")
- }
- else
- {
- EGP:egpBox(1,Res/2,vec2(10000,3)) #Line Horiz
- EGP:egpColor(1,vec(0,0,0))
- EGP:egpBox(2,Res/2,vec2(3,10000)) #Line Vert
- EGP:egpColor(2,vec(0,0,0))
- }
- EGP:egp3DTracker(3,vec(0,0,0)) #Reticle tracker
- EGP:egpParent(3,holoEntity(1))
- EGP:egpCircleOutline(4,vec2(0,0),vec2(7,7)) #Reticle dot
- EGP:egpColor(4,vec(0,200,0))
- EGP:egpParent(4,3)
- EGP:egp3DTracker(5,vec(0,0,0)) #Ballistics tracker
- EGP:egpParent(5,holoEntity(2))
- EGP:egpCircleOutline(6,vec2(0,0),vec2(5,5)) #Ballistics dot
- EGP:egpColor(6,vec(200,0,0))
- EGP:egpParent(6,5)
- EGP:egpCircleOutline(7,Res/2,vec2(15,15))
- EGP:egpColor(7,vec(0,200,0))
- EGP:egpCircleOutline(8,Res/2,vec2(14,14))
- EGP:egpColor(8,vec(0,200,0))
- if(Debug==1)
- {
- EGP:egpBoxOutline(900,Res/2,Res)
- }
- ### Variable Index EGP Elements
- if(Extras == 0)
- {
- for (I=50,100)
- {
- I++
- Sin = sin((360 / 50) * I) * (Res:y())
- Cos = cos((360 / 50) * I) * (Res:y())
- EGP:egpBox(I, Res/2 + vec2(Sin, Cos), vec2(Res:y()+100, Res:y()+100))
- EGP:egpAngle(I, (((I / 50) * 360)))
- EGP:egpColor(I, vec4(0, 0, 0, 0))
- }
- }
- rangerFilter(Gun)
- rangerFilter(entity():getConstraints())
- rangerPersist(1)
- ###COMPASS###
- CCPos = vec2((CompassSize+50),Res:y()-(CompassSize+50))
- #Compass Dummy
- EGP:egpBox(16,CCPos,vec2(0,0))
- EGP:egpAlpha(16,0)
- #Compass Circle
- EGP:egpCircle(17,vec2(0,0),vec2(CompassSize,CompassSize))
- EGP:egpColor(17,vec(60,60,60))
- EGP:egpAlpha(17,200)
- EGP:egpParent(17,16)
- #Hull Dummy
- EGP:egpCircle(18,CCPos,vec2(0,0))
- EGP:egpAlpha(18,0)
- #Hull
- TDR = array(vec2(35,-55),vec2(35,55),vec2(-35,55),vec2(-35,-55),vec2(0,-65))
- EGP:egpPolyOutline(19,TDR)
- EGP:egpColor(19,CompassColor)
- EGP:egpSize(19,2)
- EGP:egpParent(19,18)
- #Turret Dummy
- EGP:egpCircle(20,CCPos,vec2(0,0))
- EGP:egpAlpha(20,0)
- #Turret
- EGP:egpTriangleOutline(21,vec2(0,-50),vec2(30,25),vec2(-30,25))
- EGP:egpColor(21,CompassColor)
- EGP:egpSize(21,2)
- EGP:egpParent(21,20)
- ###Ammo###
- #Ammo Circle
- EGP:egpCircle(22,CCPos+vec2(CompassSize+60,CompassSize-60),vec2(60,60))
- EGP:egpColor(22, vec4(60, 220, 60, 60))
- EGP:egpAngle(22, 90)
- EGP:egpSize(22, 360)
- #Ammo Counter
- EGP:egpText(23 ,"0" ,CCPos+vec2(CompassSize+60,CompassSize-60))
- EGP:egpSize(23,70)
- EGP:egpAlign(23,1,1)
- }
- elseif(Active)
- {
- #3DTracker Pos
- holoPos(1,rangerOffset(9999999999,Gun:pos()+Gun:forward()*100,Gun:forward()):position())
- holoPos(2,EndPos)
- #Color of crosshair based on gun ready
- EGP:egpColor(7,vec(255*!GunReady,200*GunReady,0))
- EGP:egpColor(8,vec(255*!GunReady,200*GunReady,0))
- EGP:egpColor(22,vec(255*!GunReady,200*GunReady,0))
- #Missile Guidance Pos
- Guide = Cam["Trace",ranger]:pos()
- #Scope
- if(Button)
- {
- EGP:egpAlpha(1,255) EGP:egpAlpha(2,255) EGP:egpAlpha(7,0) EGP:egpAlpha(8,0) EGP:egpAlpha(24,255) EGP:egpAlpha(25,255)
- for(I=50,100)
- {
- EGP:egpAlpha(I,255)
- }
- }
- if(Button == 0)
- {
- EGP:egpAlpha(1,0) EGP:egpAlpha(2,0) EGP:egpAlpha(7,255) EGP:egpAlpha(8,255) EGP:egpAlpha(24,0) EGP:egpAlpha(25,0)
- for(I=50,100)
- {
- EGP:egpAlpha(I,0)
- }
- }
- #Changing Angles
- EGP:egpAngle(16,-Cam["CamAng",angle]:yaw()+90)
- EGP:egpAngle(18,(Base:angles():yaw()-90)+EGP:egpAngle(16))
- EGP:egpAngle(20,(Gun:angles():yaw()-90)+EGP:egpAngle(16))
- #AmmoCount
- if(changed(AmmoCount))
- {
- EGP:egpSetText(23,""+AmmoCount)
- }
- #Endpos Disable
- if(EndPos == vec(0,0,0))
- {
- EGP:egpAlpha(6,0)
- }
- }
- interval(100)
- if(last()){
- EGP:egpClear()
- }
- if(dupefinished()|duped()){
- reset()
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement