Have you even checked if your code works? you dint persist radius, so I assume it will fail. I don't get what your trying to do/make/explain i this tut.
This tutorial builds upon my previous tutorial on basic holograms, it's also oriented towards applying them to some common use and including some examples.
Alright, Lets begin.Code:@name Zero's Holo Hud runOnTick(1) E=entity() O=owner() if(first()) { Radius=300 holoCreate(20) holoModel(20,"hqcylinder") holoScale(20,vec(0.25,0.25,1)) holoCreate(21) holoModel(21,"hqcylinder") holoScale(21,vec(0.25,0.25,0.5)) holoCreate(22) holoModel(22,"hqcylinder") holoScale(22,vec(0.25,0.25,0.5)) holoCreate(23) holoModel(23,"hqcylinder") holoScale(23,vec(0.05,0.05,0.1)) holoCreate(24) holoModel(24,"hqcylinder") holoScale(24,vec(0.05,0.05,0.1)) holoCreate(25) holoModel(25,"hqtorus") holoScale(25,vec(0.1,0.1,0.1)) } #Defines if Grav Gun can grab if(O:aimEntity()&O:aimEntity():mass()<250&!O:aimEntity():isFrozen()) { C1=vec(155,0,0) if(O:aimEntity():isPlayer()|O:aimEntity():isNPC()) { CX=vec(155,0,0) C1=vec(0,155,0) } } else{C1=vec(0,155,0)} #Health meter logic T=O:shootPos()+O:eye()*8 Hp=O:health()*2.55 HpE=O:aimEntity():health()*2.55 C2=vec(255-HpE,HpE,0) C3=vec(255-Hp,Hp,0) #Grav gun bar holoPos(20,T+O:up()*3) holoAng(20,angnorm(O:eye():toAngle())+ang(0,0,90)) holoColor(20,C1,160) #Owner HP holoPos(21,T+O:right()*5) holoAng(21,angnorm(O:eye():toAngle())) holoColor(21,C3,240) #Enemy HP holoPos(22,T+O:right()*-5) holoAng(22,angnorm(O:eye():toAngle())) holoColor(22,C2,HpE) #Crosshair 1 holoPos(23,T) holoAng(23,angnorm(O:eye():toAngle())+ang(0,0,90)) holoColor(23,vec(0,0,255),200) #Crosshair 2 holoPos(24,T) holoAng(24,angnorm(O:eye():toAngle())) holoColor(24,vec(0,0,255),200) #Locked on Ring holoPos(25,T) holoAng(25,angnorm(O:eye():toAngle())+ang(90,0,0)) holoColor(25,CX,HpE) #Comment all this if in public server. The E2 will shutdown from ops overload otherwise #This section will place a holo around props within a certain radius of it. findByClass("prop_physics") findExcludeEntity(O) R=findToArray() for(I=1,R:count()) { if(O:pos():distance(R[I,entity]:pos())<Radius) { holoCreate(I) holoParent(I,R[I,entity]) } else{holoDelete(I)} holoPos(I,R[I,entity]:pos()) holoScaleUnits(I,R[I,entity]:boxSize()) holoAng(I,R[I,entity]:angles()) holoColor(I,vec(0,0,155),190) }
There's a reason my holos start off at 20+. The loops creates all the holos below 20.
I'm going to go over all the technical parts of this holo and im going to assume my old tutorial was read.
This code basically says. If i look at a prop that the grav gun can grab(not 250g+ or frozen), turn the indicator holo red. If i look at a Person or an NPC make the target ring red and leave the indicator holo green.Code:#Defines if Grav Gun can grab if(O:aimEntity()&O:aimEntity():mass()<250&!O:aimEntity():isFrozen()) { C1=vec(155,0,0) if(O:aimEntity():isPlayer()|O:aimEntity():isNPC()) { CX=vec(155,0,0) C1=vec(0,155,0) } } else{C1=vec(0,155,0)}
This portion of the code will show the owner's Hp through a color coded bar as well as any players/npc's you look at.Code:#Health meter logic T=O:shootPos()+O:eye()*8 Hp=O:health()*2.55 HpE=O:aimEntity():health()*2.55 C2=vec(255-HpE,HpE,0) C3=vec(255-Hp,Hp,0)
This line is very important. it is how the hologram keeps its angle oriented in the same direction when you look aroound.Code:holoAng(index,angnorm(O:eye():toAngle()))
This is an unoptimized for loop i made for the fun of it. The concept of this is to create holograms around the props nearby and just have some fun with it. Since i didnt have the time to fully optimize the code 100% the chip will shutdown if too many props are spawned. to solve the shutdown comment everything below the warning i gave.Code:#Comment all this if in public server. The E2 will shutdown from ops overload otherwise #This section will place a holo around props within a certain radius of it. findByClass("prop_physics") findExcludeEntity(O) R=findToArray() for(I=1,R:count()) { I=clamp(I,0,19) if(O:pos():distance(R[I,entity]:pos())<Radius) { holoCreate(I) holoParent(I,R[I,entity]) } else{holoDelete(I)} holoPos(I,R[I,entity]:pos()) holoScaleUnits(I,R[I,entity]:boxSize()) holoAng(I,R[I,entity]:angles()) holoColor(I,vec(0,0,155),190) }
If anyone needs clarifications let me know and i will try and help. Also throw out some requests and i will try to see if i can help with it.
if you liked it too =D
Gimp > Photoshop
Have you even checked if your code works? you dint persist radius, so I assume it will fail. I don't get what your trying to do/make/explain i this tut.
New server IP: 89.238.160.17:27018
Hologram contraptions 1 Holo contraptions 2 EGP stuff Holo minigun Holo javelin rocket launcher
Unsmart: I doubt the intelligence of some people.
Drunkie: Nobody could have said that any better than Unsmart.
Unsmart: Solece, I totally did your mom yesterday
Solece: Who hasnt
Divran: there are more retarded people than there are clever people in this world
Yea it works. i test it by placing props in a line and standing at the end of that line. only the ones in range were selected (though it'd be nice if findInSphere() worked)
Last edited by Zeroedge9; 12-13-2009 at 09:43 AM.
Gimp > Photoshop
pretty nice tutorial, really builds from your last one. Needed a few more explanations though, i wouldn't have understood if i didnt know this already.
Working on military pack.
Remember
amateurs build the ark....
Professionals build the titanic
Can you give me examples on what i should clarify?
Gimp > Photoshop
Bookmarks