Released ten seconds ago, going to try it out right now.
Edit:
This isnt a E2... Whats a EGP?
Code for all contraptions provided at end!
Clock:
Finished, but lacks some nice features
Features:
Easy scaling of size, and the ratio (see pictures). I love the scaling part of it.
Pictures:
right click on attachments-> view in new window
Radar:
The radar is now finished! Keep tuned, I will add updates to it for more targets. It shows accurately the bearing position of the target, and takes his distance into account.
Pictures:
-----
Code for clock:
Ok, get out the Time: ostime gate and a selection:time decoder, wire them up, then wire the E2 min, sec.. to decoder. Rest you have to figure out, or you don't deserve to have the E2.
Code for radar: wirelink the EGP, make a beacon sensor (or 1^3 cube from phx (the small one)) and an entity marker, wire marker to beacon sensor, and then the Cube input to ent markerCode:@name EGP clock by Unsmart v3 @inputs W:wirelink Min Hour Sec @outputs Ratio:vector2 Test Str:string @persist Mid @trigger #interval(500) if(first()) { W:egpClear() timer("draw",500) } if(clk("draw")) { #base #edit me RatioReal=vec2(1,1) RatioReal=clamp(RatioReal,vec2(0.1,0.1),vec2(1.2,1.2)) Size=220 Size=clamp(Size,10,220) Ratio=RatioReal*Size Mid=256 #dont edit me below #base 4 digits W:egpBox(12,Mid-5,Mid-Ratio:x()-5,10,10,255,255,255,255) W:egpBox(6,Mid-5,Mid+Ratio:x()-5,10,10,255,255,255,255) W:egpBox(3,Mid+Ratio:y()-5,Mid-5,10,10,255,255,255,255) W:egpBox(9,Mid-Ratio:y()-5,Mid-5,10,10,255,255,255,255) #other W:egpBox(1,Mid-sin(30*11)*Ratio:y()-5,Mid-cos(30*11)*Ratio:x()-5,10,10,0,255,255,255) W:egpBox(2,Mid-sin(30*10)*Ratio:y()-5,Mid-cos(30*10)*Ratio:x()-5,10,10,0,255,255,255) W:egpBox(11,Mid-sin(30*1)*Ratio:y()-5,Mid-cos(30*1)*Ratio:x()-5,10,10,0,255,255,255) W:egpBox(10,Mid-sin(30*2)*Ratio:y()-5,Mid-cos(30*2)*Ratio:x()-5,10,10,0,255,255,255) W:egpBox(4,Mid-sin(30*8)*Ratio:y()-5,Mid-cos(30*8)*Ratio:x()-5,10,10,0,255,255,255) W:egpBox(5,Mid-sin(30*7)*Ratio:y()-5,Mid-cos(30*7)*Ratio:x()-5,10,10,0,255,255,255) W:egpBox(8,Mid-sin(30*4)*Ratio:y()-5,Mid-cos(30*4)*Ratio:x()-5,10,10,0,255,255,255) W:egpBox(7,Mid-sin(30*5)*Ratio:y()-5,Mid-cos(30*5)*Ratio:x()-5,10,10,0,255,255,255) #render W:egpDraw() timer("hands",100)#max FPs=12 D: } #Hour++ #for server thats GMT+0 and youyr gmt+1 #Hour=Hour%24 if(clk("hands")) { #hands W:egpLine(20,Mid,Mid,Mid+1,Mid+1,255,255,255,255)#sec W:egpLine(21,Mid,Mid,Mid+1,Mid-1,0,255,255,255)#min W:egpLine(22,Mid,Mid,Mid-1,Mid-1,255,255,0,255)#hour #digital timed Str="" if((Hour+""):length()==1){Str+="0"+Hour+":"}else{Str+=""+Hour+":"} if((Min+""):length()==1){Str+="0"+Min+":"}else{Str+=""+Min+":"} if((Sec+""):length()==1){Str+="0"+Sec}else{Str+=""+Sec} W:egpText(23,Str,vec2(Mid-50,Mid+50),vec(255,0,0),255) #circle W:egpCircle(-1,Mid,Mid,100,100,255,255,255,255) W:egpDraw() } #clock is only 12 hours! if(Hour>12){Test=Hour-12}else{Test=Hour} W:egpPos2(20,Mid-cos((Sec+15)*(360/60))*Ratio:y(),Mid-sin((Sec+15)*(360/60))*Ratio:x()) W:egpPos2(21,Mid-cos((Min+15)*(360/60))*Ratio:y(),Mid-sin((Min+15)*(360/60))*Ratio:x()) W:egpPos2(22,Mid-cos((Test+3)*(360/12))*Ratio:y(),Mid-sin((Test+3)*(360/12))*Ratio:x()) Str="" if((Hour+""):length()==1){Str+="0"+Hour+":"}else{Str+=""+Hour+":"} if((Min+""):length()==1){Str+="0"+Min+":"}else{Str+=""+Min+":"} if((Sec+""):length()==1){Str+="0"+Sec}else{Str+=""+Sec} W:egpText(23,Str,vec2(Mid-50,Mid+50),vec(255,0,0),255) W:egpDraw()
-----Code:@name EGP radar by Unsmart @inputs W:wirelink Cube:entity @outputs @persist Ang MaxDist MaxPeople Arr:array @trigger interval(30)#runontick = bad for this, finetune for the EGP FPS convar! if(first()) { MaxDist=1000 MaxPeople=12 #W:egpClear() Ang=1 W:egpBox(1,0,0,512,512,255,0,0,255)#background W:egpCircle(2,256,256,512,512,13,66,13,255)#circle #inner circle*2 W:egpCircle(3,512/2,512/2,512/2,512/2,255,255,255,255)#white spliter W:egpCircle(4,512/2,512/2,512/2-10,512/2-10,13,66,13,255)#back to green #Lines W:egpLine(5,256,512,256,0,150,150,150,255)#up->down W:egpLine(6,0,256,512,256,150,150,150,255)#left->right #hands of sweeper W:egpLine(7,256,256,256,0,255,255,255,255) #pos info W:egpText(8,round(MaxDist/2)+"",vec2(256-80,256-50),vec(100,100,100),255) W:egpText(9,round(MaxDist)+"",vec2(256-200,256-50),vec(100,100,100),255) #render print("base drawn") timer("draw",100)#max FPS } if(clk("draw")) { for(I=10,MaxPeople+9) { W:egpCircle(I,-1,-1,10,10,0,255,255,255) # concmd("echo "+(I)+" created") } #cover circle W:egpCircle(50,-1,-1,15,15,255,0,0,255) print("addons drawn") timer("find",50)#init timer find } if(clk("find")) { findInSphere(entity():pos(),MaxDist) findClipToClass("player") #npc_* #player Arr=findToArray() timer("find",500)#next find if the max fps is set high, use findUpdateRate()+0.05 #timer("find",indUpdateRate()+0.05)#uncoment me if you want fast finds, if so, comment above for(I=1,Arr:count())#foreach { Ent=Arr[I,entity] Bear=Cube:bearing(Ent:pos()) #find mul Dist=clamp((Cube:pos()-Ent:pos()):length(),10,MaxDist) Mul=(256/MaxDist)*Dist #angle math RealBear= (Bear+180+(360+90))%360 RealBear= RealBear==0 ? -1 : RealBear W:egpPos(I+9,256-cos(RealBear)*Mul,256-sin(RealBear)*Mul) #concmd("echo "+(I+9)+" drawn") } for(I=Arr:count()+10,MaxPeople+9) { W:egpPos(I,-1,-1) #concmd("echo "+I+" removed") } } if(clk()&!clk("find")) { #update position, dont find new crap for(I=1,Arr:count())#foreach { Ent=Arr[I,entity] Bear=Cube:bearing(Ent:pos()) #find mul Dist=clamp((Cube:pos()-Ent:pos()):length(),10,MaxDist+10) Mul=(256/MaxDist)*Dist #angle math RealBear= (Bear+180+(360+90))%360 RealBear= RealBear==0 ? -1 : RealBear W:egpPos(I+9,256-cos(RealBear)*Mul,256-sin(RealBear)*Mul) #concmd("echo "+(I+9)+" updated") } } #hand circle Ang= Ang<359 ? Ang+1 : 1 W:egpPos2(7,256+cos(Ang)*256,256+sin(Ang)*256) #render W:egpDraw()
A clock my friend Zoombahh made, and yes, his clock is way cooler, here is comparison pic:
END note: I know you could do 9001 times better in GPU, but I want to show you, that its possible to do something useful in EGP.
Last edited by Unsmart; 03-14-2010 at 03:52 AM.
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
Released ten seconds ago, going to try it out right now.
Edit:
This isnt a E2... Whats a EGP?
Last edited by GawsherMcGee; 12-21-2009 at 12:57 PM.
Oh ffs, why cant people hit the search button before asking? click me
and thanks Azrael for explaining it.
--------------
THE RADAR WORKS NOW!!!!! (max 1 find for now, but it still works! and I figured it out without help)
Last edited by Unsmart; 12-22-2009 at 06:15 AM.
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
RADAR IS DONE! Support for 12 players, but with some brain you can figure out how to change it
Code:@name EGP radar by Unsmart @inputs W:wirelink Cube:entity @outputs RealBear Arr:array Ent:entity @persist Ang @trigger interval(30) if(first()) { #W:egpClear() Ang=1 W:egpBox(1,0,0,512,512,255,0,0,255)#background W:egpCircle(2,0,0,512,512,42,255,0,255)#circle #inner circle*2 W:egpCircle(3,256-300/2,256-300/2,300,300,255,255,255,255)#white spliter W:egpCircle(4,256-270/2,256-270/2,270,270,100,255,0,255)#back to green #Lines W:egpLine(5,256,512,256,0,150,150,150,255)#up->down W:egpLine(6,0,256,512,256,150,150,150,255)#left->right #hands of sweeper W:egpLine(7,256,256,256,0,255,255,255,255) #cover circles W:egpCircle(1337,50,50,10,10,255,0,0,255) #render W:egpDraw() timer("find",50) timer("draw",100) } if(clk("draw")) { for(I=10,22) { W:egpCircle(I,50,50,10,10,0,255,255,255) } } if(clk("find")) { findInSphere(entity():pos(),1000) findClipToClass("player") Arr=findToArray() timer("find",500) for(I=10,Arr:count()+10)#start at 10+ { Ent=Arr[I-10,entity] Bear=Cube:bearing(Ent:pos()) #angle math Dist=clamp((Cube:pos()-Ent:pos()):length(),10,500) Mul=clamp(Dist,10,500) RealBear= (Bear+180+(360+90))%360 RealBear= RealBear==0 ? -1 : RealBear W:egpPos(I,256-5-cos(RealBear)*Mul,256-5-sin(RealBear)*Mul) } for(I=Arr:count()+11,22) { W:egpPos(I,-1,-1) } #make sure to remove unused crap Spawned=Arr:count()#when i get GUI done, i will add garbage colector } #hand circle Ang= Ang<359 ? Ang+1 : 1 W:egpPos2(7,256+cos(Ang)*256,256+sin(Ang)*256) #angle math #Mul=clamp(Dist,10,500) # #RealBear= (Bear+180+(360+90))%360 #RealBear= RealBear==0 ? -1 : RealBear #W:egpPos(8,256-5-cos(RealBear)*Mul,256-5-sin(RealBear)*Mul) # W:egpDraw()
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
With the clock, find it interpretable. How do you know which is the hour, minute r second hand? I suggest you make each one successively shorter, and have their width shrink as well. This is because when they overlap you should be able to easily tell what's happening.
Unsmart these are awesome.
Every day i see better things coming from EGP.
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
hmm, For some reason the Radar is all messed up.. Draws the players and the rotating line ok, but the green circles for the background are only in the top left corner...
------------------------------------
aka "Nik of the Wired" in gmod.
yeah, I noticed, my server uses old version of EGP, in SP with newest version it fucked up, sorry about that, Ill remake it. Wonder what changed the behavior of the positioning.
Thanks for actually trying it
Code:@name EGP radar by Unsmart @inputs W:wirelink Cube:entity @outputs RealBear Arr:array Ent:entity Dist @persist Ang @trigger interval(30) if(first()) { #W:egpClear() Ang=1 W:egpBox(1,0,0,512,512,255,0,0,255)#background W:egpCircle(2,256,256,512,512,13,66,13,255)#circle #inner circle*2 W:egpCircle(3,512/2,512/2,300,300,255,255,255,255)#white spliter W:egpCircle(4,512/2,512/2,270,270,13,66,13,255)#back to green #Lines W:egpLine(5,256,512,256,0,150,150,150,255)#up->down W:egpLine(6,0,256,512,256,150,150,150,255)#left->right #hands of sweeper W:egpLine(7,256,256,256,0,255,255,255,255) #cover circles W:egpCircle(50,50,50,15,15,255,0,0,255) #render W:egpDraw() timer("find",50) timer("draw",100) } if(clk("draw")) { for(I=10,22) { W:egpCircle(I,50,50,10,10,0,255,255,255) } } if(clk("find")) { findInSphere(entity():pos(),1000) findClipToClass("player") Arr=findToArray() timer("find",500) for(I=10,Arr:count()+10)#start at 10+ { Ent=Arr[I-10,entity] Bear=Cube:bearing(Ent:pos()) #angle math Dist=clamp((Cube:pos()-Ent:pos()):length(),10,500) Mul=clamp(Dist,1,500) RealBear= (Bear+180+(360+90))%360 RealBear= RealBear==0 ? -1 : RealBear W:egpPos(I,256-cos(RealBear)*Mul,256-sin(RealBear)*Mul) } for(I=Arr:count()+11,22) { W:egpPos(I,50,50) } W:egpPos(50,50,50) #make sure to remove unused crap } #hand circle Ang= Ang<359 ? Ang+1 : 1 W:egpPos2(7,256+cos(Ang)*256,256+sin(Ang)*256) #angle math #Mul=clamp(Dist,10,500) # #RealBear= (Bear+180+(360+90))%360 #RealBear= RealBear==0 ? -1 : RealBear #W:egpPos(8,256-5-cos(RealBear)*Mul,256-5-sin(RealBear)*Mul) # W:egpDraw()
fixed, but I'm sure I screwed something up
Last edited by Unsmart; 12-23-2009 at 01:02 PM.
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
Bookmarks