Advertisement
Urumasi

UrumasiCam

Aug 6th, 2017
80
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 29.15 KB | None | 0 0
  1. @name UrumasiCam
  2. @persist Colormode SSAOon SSAORC SSAONoS SSAOSR Textured PixelSize TRes Loaded Tex:table S:wirelink Screen:entity SP:vector Box:vector Res Scanning Distance T Dist ShadowR ShadowS DeltaT LightP:vector Result:vector Sample
  3. @persist K Sl Open O:entity Max Buffer:table Canvas:vector2 MID HLoaded Start Pause Rec MinT MaxT Times:array
  4. @persist Glass:vector ShadowDist GlassTransparency
  5. @inputs DigitalScreen:wirelink
  6.  
  7. #[
  8.  
  9. Created by Urumasi
  10. http://steamcommunity.com/id/urumasi/
  11.  
  12. How to use:
  13. Place this chip onto a digital screen. If the E2 does not do anything, wire the digital screen wirelink to the E2 and replace the E2.
  14.  
  15. ]#
  16.  
  17. if(first()){
  18. #ifdef entity:wirelink()
  19. S = entity():isConstrainedTo():wirelink()
  20. #else
  21. if(!->DigitalScreen){
  22. runOnFile(0)
  23. runOnHTTP(0)
  24. exit()
  25. }
  26. S = DigitalScreen
  27. #endif
  28. runOnTick(1)
  29. runOnHTTP(1)
  30. Times = array(0,0,0)
  31. Canvas = vec2(144, 515)
  32. O = owner()
  33. function wirelink:initScreen(Res){
  34. This[1048574]=0
  35. This[1048569]=3
  36. This[1048575]=1
  37. This[1048572]=This[1048573]=Res
  38. }
  39. function vector clampV(CV:vector, N1, N2){
  40. return vec(clamp(CV:x(), N1, N2), clamp(CV:y(), N1, N2), clamp(CV:z(), N1, N2))
  41. }
  42. function number vector:vAng(V:vector){
  43. return acos(This:dot(V)/(This:length()*V:length()))
  44. }
  45. function vector array:avgV(){
  46. Out = vec()
  47. foreach(K, V:vector=This){
  48. Out+=V/This:count()
  49. }
  50. return Out
  51. }
  52. function vector signV(SV:vector){
  53. return vec(abs(SV:x())>0.05?sign(SV:x()) :1, abs(SV:y())>0.05?sign(SV:y()) :1, abs(SV:z())>0.05?sign(SV:z()) :1)
  54. }
  55. function vector vector:mul(MV:vector){
  56. return vec(This:x()*MV:x(), This:y()*MV:y(), This:z()*MV:z())
  57. }
  58. function entity:obj(ID, Size:vector, Dir:vector, M:string, Push, C:vector){
  59. holoCreate(ID, vec(), vec(1), This:angles(), C, M)
  60. HS = This:aabbSize():mul(Size)
  61. holoScaleUnits(ID, HS)
  62. holoPos(ID, This:toWorld((This:aabbSize()/2+(Push*HS/2)):mul(Dir)))
  63. holoParent(ID, This)
  64. holoDisableShading(ID, 1)
  65. }
  66. function entity:objMenu(ID, Size:vector2, Pos:vector2, M:string, C:vector){
  67. RPos = vec((Pos:y()+Size:y()/2)/Canvas:y(), (Pos:x()+Size:x()/2)*Max/Canvas:x()+1-Max, 0.9)
  68. RSize = vec(Size:y()/Canvas:y(), Size:x()*Max/Canvas:x(), 0.1)
  69. holoCreate(ID, vec(), vec(1), holoEntity(9):angles(), C, M)
  70. HS = This:aabbSize():mul(RSize)
  71. holoScaleUnits(ID, HS)
  72. holoPos(ID, This:toWorld(This:aabbSize():mul(RPos)-This:aabbSize()/2))
  73. holoParent(ID, 9)
  74. holoDisableShading(ID, 1)
  75. }
  76. function entity:slide(N){
  77. holoPos(1, This:toWorld(vec(0,N*This:aabbSize():y(),0))-This:pos()+holoEntity(1):pos())
  78. holoPos(5, This:toWorld(vec(0,N*This:aabbSize():y(),0))-This:pos()+holoEntity(5):pos())
  79. holoPos(6, This:toWorld(vec(0,N*This:aabbSize():y(),0))-This:pos()+holoEntity(6):pos())
  80. holoPos(9, This:toWorld(vec(0,N*This:aabbSize():y(),0))-This:pos()+holoEntity(9):pos())
  81. Sl += N
  82. }
  83. function number lookingAt(I, R){
  84. return (O:shootPos()+O:eye()*O:shootPos():distance(holoEntity(I):pos())):distance(holoEntity(I):pos())<R
  85. }
  86. function ranger cRanger(RDistance, RPosition:vector, RDirection:vector){
  87. Ro = rangerOffset(RDistance, RPosition, RDirection)
  88. ShadowDist += Ro:pos():distance(RPosition)
  89. if(Ro:matType()=="glass"){
  90. ShadowDist += 2
  91. Glass = clampV(Glass-vec(GlassTransparency)+(GlassTransparency*Ro:entity():getColor()/255), 0, 1)
  92. Ro = cRanger(RDistance-Ro:distance(), Ro:pos()+RDirection*2, RDirection)
  93. }
  94. return Ro
  95. }
  96. GlassTransparency = 0.3
  97. MinT = 0.1
  98. MaxT = 5
  99. Colormode = 1
  100. SSAOon = 0
  101. SSAORC = 100
  102. Textured = 0
  103. PixelSize = 0.25
  104. SSAONoS = 12
  105. SSAOSR = 7.5
  106. TRes = 64
  107. Sample = 2
  108. Res = 64
  109. ShadowR = 500
  110. ShadowS = 150
  111. S:initScreen(Res)
  112. Screen = S:entity()
  113. Box = Screen:boxSize()
  114. Dist = 300
  115. Screen:setMaterial("models/shiny")
  116. Screen:setColor(vec(0))
  117. for(I=1, 4){
  118. holoCreate(I+300)
  119. holoScale(I+300, vec(0.3))
  120. }
  121. rangerPersist(1)
  122. rangerFilter(players())
  123. rangerFilter(Screen)
  124. httpRequest("https://dl.dropboxusercontent.com/s/1y699eveu5raw27/all.txt")
  125. Max = Canvas:x()/Canvas:y()
  126. Screen:obj(1, vec(1,0.05,0.82), vec(0,1,0), "cube", 1, vec(200))
  127. Screen:obj(2, vec(1,0.05,0.82), vec(0,-1,0), "cube", 1, vec(200))
  128. Screen:obj(3, vec(0.05,1,0.82), vec(1,0,0), "cube", 1, vec(200))
  129. Screen:obj(4, vec(0.05,1,0.82), vec(-1,0,0), "cube", 1, vec(200))
  130. Screen:obj(5, vec(0.1,0.1,0.82), vec(1,1,0), "hq_cylinder", 0, vec(200))
  131. Screen:obj(6, vec(0.1,0.1,0.82), vec(-1,1,0), "hq_cylinder", 0, vec(200))
  132. Screen:obj(7, vec(0.1,0.1,0.82), vec(1,-1,0), "hq_cylinder", 0, vec(200))
  133. Screen:obj(8, vec(0.1,0.1,0.82), vec(-1,-1,0), "hq_cylinder", 0, vec(200))
  134. Screen:obj(9, vec(1.1,1,0.82), vec(), "cube", 0, vec(200))
  135. Screen:obj(201, vec(1,0.05,1), vec(0,1.01,-0.125), "cube", 1, vec())
  136. Screen:obj(202, vec(1,0.05,1), vec(0,-1.01,-0.125), "cube", 1, vec())
  137. Screen:obj(203, vec(0.05,1,1), vec(1.01,0,-0.125), "cube", 1, vec())
  138. Screen:obj(204, vec(0.05,1,1), vec(-1.01,0,-0.125), "cube", 1, vec())
  139. Screen:obj(205, vec(0.1,0.1,1), vec(1.01,1.01,-0.26), "hq_cylinder", 0, vec())
  140. Screen:obj(206, vec(0.1,0.1,1), vec(-1.01,1.01,-0.26), "hq_cylinder", 0, vec())
  141. Screen:obj(207, vec(0.1,0.1,1), vec(1.01,-1.01,-0.26), "hq_cylinder", 0, vec())
  142. Screen:obj(208, vec(0.1,0.1,1), vec(-1.01,-1.01,-0.26), "hq_cylinder", 0, vec())
  143. Screen:obj(209, vec(1.05,1.05,1), vec(0,0,-0.4), "cube", 0, vec(0))
  144. Screen:obj(210, vec(1.11,1.01,1), vec(0,0,-0.4), "cube", 0, vec(0))
  145. holoParent(201, 1)
  146. holoParent(205, 5)
  147. holoParent(206, 6)
  148. holoParent(210, 9)
  149. Buffer:pushArray(array(vec2(8,37), vec2(29,0), "cube", vec()))
  150. Buffer:pushArray(array(vec2(16,8), vec2(37,0), "cube", vec()))
  151. Buffer:pushArray(array(vec2(16,8), vec2(37,16), "cube", vec()))
  152. Buffer:pushArray(array(vec2(8,8), vec2(50,8), "cube", vec()))
  153. Buffer:pushArray(array(vec2(8,13), vec2(50,24), "cube", vec()))
  154. Buffer:pushArray(array(vec2(8,37), vec2(61,0), "cube", vec()))
  155. Buffer:pushArray(array(vec2(16,8), vec2(69,0), "cube", vec()))
  156. Buffer:pushArray(array(vec2(16,8), vec2(69,14), "cube", vec()))
  157. Buffer:pushArray(array(vec2(16,8), vec2(69,29), "cube", vec()))
  158. Buffer:pushArray(array(vec2(24,8), vec2(88,0), "cube", vec()))
  159. Buffer:pushArray(array(vec2(24,8), vec2(88,14), "cube", vec()))
  160. Buffer:pushArray(array(vec2(24,8), vec2(88,29), "cube", vec()))
  161. Buffer:pushArray(array(vec2(8,7), vec2(88,8), "cube", vec()))
  162. Buffer:pushArray(array(vec2(8,7), vec2(104,22), "cube", vec()))
  163. Buffer:pushArray(array(vec2(19,3), vec2(0,57), "cube", vec()))
  164. Buffer:pushArray(array(vec2(19,3), vec2(125,57), "cube", vec()))
  165. Buffer:pushArray(array(vec2(3,19), vec2(133,49), "cube", vec()))
  166. Buffer:pushArray(array(vec2(26,26), vec2(33,97), "hq_rcube", vec(255,0,0))) #27
  167. Buffer:pushArray(array(vec2(26,26), vec2(60,97), "hq_rcube", vec(0,200,0)))
  168. Buffer:pushArray(array(vec2(26,26), vec2(87,97), "hq_rcube", vec(255,0,0)))
  169. Buffer:pushArray(array(vec2(140,4), vec2(0,126), "cube", vec()))
  170. Buffer:pushArray(array(vec2(13,4), vec2(0,132), "cube", vec()))
  171. Buffer:pushArray(array(vec2(13,4), vec2(0,140), "cube", vec()))
  172. Buffer:pushArray(array(vec2(13,4), vec2(0,148), "cube", vec()))
  173. Buffer:pushArray(array(vec2(4,4), vec2(0,136), "cube", vec()))
  174. Buffer:pushArray(array(vec2(4,4), vec2(9,144), "cube", vec()))
  175. Buffer:pushArray(array(vec2(13,4), vec2(14,132), "cube", vec()))
  176. Buffer:pushArray(array(vec2(13,4), vec2(14,140), "cube", vec()))
  177. Buffer:pushArray(array(vec2(13,4), vec2(14,148), "cube", vec()))
  178. Buffer:pushArray(array(vec2(4,4), vec2(14,136), "cube", vec()))
  179. Buffer:pushArray(array(vec2(4,4), vec2(23,144), "cube", vec()))
  180. Buffer:pushArray(array(vec2(4,20), vec2(28,132), "cube", vec()))
  181. Buffer:pushArray(array(vec2(4,20), vec2(37,132), "cube", vec()))
  182. Buffer:pushArray(array(vec2(5,4), vec2(32,132), "cube", vec()))
  183. Buffer:pushArray(array(vec2(5,4), vec2(32,141), "cube", vec()))
  184. Buffer:pushArray(array(vec2(4,20), vec2(42,132), "cube", vec()))
  185. Buffer:pushArray(array(vec2(4,20), vec2(51,132), "cube", vec()))
  186. Buffer:pushArray(array(vec2(5,4), vec2(46,132), "cube", vec()))
  187. Buffer:pushArray(array(vec2(5,4), vec2(46,148), "cube", vec()))
  188. Buffer:pushArray(array(vec2(20,20), vec2(97,132), "hq_cylinder", vec(100)))
  189. Buffer:pushArray(array(vec2(20,20), vec2(120,132), "hq_cylinder", vec(100)))
  190. Buffer:pushArray(array(vec2(24,20), vec2(107,132), "cube", vec(100)))
  191. Buffer:pushArray(array(vec2(18,18), vec2(98,133), "hq_cylinder", vec(200))) #52 # 98 - 121 !!!
  192. Buffer:pushArray(array(vec2(140,4), vec2(0,154), "cube", vec()))
  193. Buffer:pushArray(array(vec2(4,20), vec2(0,160), "cube", vec()))
  194. Buffer:pushArray(array(vec2(4,20), vec2(12,160), "cube", vec()))
  195. Buffer:pushArray(array(vec2(2,6), vec2(4,162), "cube", vec()))
  196. Buffer:pushArray(array(vec2(6,6), vec2(5,164), "cube", vec()))
  197. Buffer:pushArray(array(vec2(2,6), vec2(10,162), "cube", vec()))
  198. Buffer:pushArray(array(vec2(4,20), vec2(17,160), "cube", vec()))
  199. Buffer:pushArray(array(vec2(4,20), vec2(26,160), "cube", vec()))
  200. Buffer:pushArray(array(vec2(5,4), vec2(21,160), "cube", vec()))
  201. Buffer:pushArray(array(vec2(5,4), vec2(21,169), "cube", vec()))
  202. Buffer:pushArray(array(vec2(13,4), vec2(31,160), "cube", vec()))
  203. Buffer:pushArray(array(vec2(4,16), vec2(35,164), "cube", vec()))
  204. Buffer:pushArray(array(vec2(20,20), vec2(97,160), "hq_cylinder", vec(100)))
  205. Buffer:pushArray(array(vec2(20,20), vec2(120,160), "hq_cylinder", vec(100)))
  206. Buffer:pushArray(array(vec2(24,20), vec2(107,160), "cube", vec(100)))
  207. Buffer:pushArray(array(vec2(18,18), vec2(98,161), "hq_cylinder", vec(200))) #68
  208. Buffer:pushArray(array(vec2(14,14), vec2(0,191), "hq_cylinder", vec(150)))
  209. Buffer:pushArray(array(vec2(14,14), vec2(127,191), "hq_cylinder", vec(150)))
  210. Buffer:pushArray(array(vec2(131,2), vec2(6,197), "cube", vec(230)))
  211. Buffer:pushArray(array(vec2(8,8), vec2(46,194), "hq_cylinder", vec())) #72
  212. Buffer:pushArray(array(vec2(37,37), vec2(11,219), "cube", vec()))
  213. Buffer:pushArray(array(vec2(37,37), vec2(54,219), "cube", vec(0,200,0)))
  214. Buffer:pushArray(array(vec2(37,37), vec2(97,219), "cube", vec()))
  215. Buffer:pushArray(array(vec2(33,33), vec2(13,221), "models/holograms/right_prism.mdl", vec(255))) #76
  216. Buffer:pushArray(array(vec2(33,33), vec2(56,221), "models/holograms/right_prism.mdl", vec(255)))
  217. Buffer:pushArray(array(vec2(33,33), vec2(99,221), "models/holograms/right_prism.mdl", vec(255)))
  218. Buffer:pushArray(array(vec2(33,33), vec2(13,221), "models/holograms/right_prism.mdl", vec(255))) #79
  219. Buffer:pushArray(array(vec2(33,33), vec2(56,221), "models/holograms/right_prism.mdl", vec(255)))
  220. Buffer:pushArray(array(vec2(33,33), vec2(99,221), "models/holograms/right_prism.mdl", vec(255)))
  221. Buffer:pushArray(array(vec2(140,4), vec2(0,258), "cube", vec()))
  222. Buffer:pushArray(array(vec2(140,4), vec2(0,458), "cube", vec()))
  223. Buffer:pushArray(array(vec2(24,24), vec2(22,478), "hq_rcube", vec()))
  224. Buffer:pushArray(array(vec2(44,32), vec2(12,483), "hq_rcube", vec()))
  225. Buffer:pushArray(array(vec2(22,22), vec2(23,488), "hq_tube", vec(200))) #86
  226. Buffer:pushArray(array(vec2(4,4), vec2(49,486), "hq_cylinder", vec(200)))
  227. Buffer:pushArray(array(vec2(36,26), vec2(95,489), "hq_rcube", vec()))
  228. Buffer:pushArray(array(vec2(22,22), vec2(91,470), "hq_cylinder", vec()))
  229. Buffer:pushArray(array(vec2(20,20), vec2(113,472), "hq_cylinder", vec()))
  230. Buffer:pushArray(array(vec2(10,20), vec2(84,491), "cube", vec())) #91
  231. Buffer:pushArray(array(vec2(32,32), vec2(32,42), "hq_rcube", vec(0,200,0)))
  232. Buffer:pushArray(array(vec2(32,32), vec2(57,42), "hq_rcube", vec(0,200,0)))
  233. Buffer:pushArray(array(vec2(32,32), vec2(82,42), "hq_rcube", vec(0,200,0))) #94
  234. Buffer:pushArray(array(vec2(24,3), vec2(60,84), "cube", vec()))
  235. Buffer:pushArray(array(vec2(24,3), vec2(60,84), "cube", vec()))
  236. Buffer:pushArray(array(vec2(45,45), vec2(89,470), "cube", vec())) #97
  237. Buffer:pushArray(array(vec2(45,45), vec2(12,470), "prism", vec()))
  238. Buffer:pushArray(array(vec2(15,45), vec2(12,470), "cube", vec()))
  239. Buffer:pushArray(array(vec2(15,45), vec2(42,470), "cube", vec()))
  240. Buffer:pushArray(array(vec2(30), vec2(0,425), "hq_rcube", vec(0,200,0))) #101
  241. Buffer:pushArray(array(vec2(30), vec2(31,425), "hq_rcube", vec(0,200,0)))
  242. Buffer:pushArray(array(vec2(30), vec2(56,425), "hq_rcube", vec(0,200,0)))
  243. Buffer:pushArray(array(vec2(30), vec2(87,425), "hq_rcube", vec(0,200,0)))
  244. Buffer:pushArray(array(vec2(30), vec2(112,425), "hq_rcube", vec(0,200,0)))
  245. function table:addT(Ta:table){
  246. for(I=1, Ta:count()){
  247. This:pushArray(Ta[I, array])
  248. }
  249. }
  250. }else{
  251. if(!Loaded & httpClk()){
  252. Tex = vonDecodeTable(httpData())
  253. Loaded = 1
  254. }
  255. if(SP!=Screen:pos()){
  256. Dist = 1e10
  257. R = rangerOffset(Dist, Screen:toWorld(vec(Box:x(), Box:y(), 0)/2), -Screen:up())
  258. holoPos(301, R:position())
  259. D1 = R:distance()
  260. R = rangerOffset(Dist, Screen:toWorld(vec(-Box:x(), Box:y(), 0)/2), -Screen:up())
  261. holoPos(302, R:position())
  262. D2 = R:distance()
  263. R = rangerOffset(Dist, Screen:toWorld(vec(Box:x(), -Box:y(), 0)/2), -Screen:up())
  264. holoPos(303, R:position())
  265. D3 = R:distance()
  266. R = rangerOffset(Dist, Screen:toWorld(vec(-Box:x(), -Box:y(), 0)/2), -Screen:up())
  267. holoPos(304, R:position())
  268. D4 = R:distance()
  269. SP = Screen:pos()
  270. R = rangerOffset(Dist, SP, -Screen:up())
  271. LightP = R:position()+vec(200,200,100)
  272. }
  273. if(HLoaded & Loaded & T<Res^2 & Start & !Pause){
  274. while(perf(90) & T<Res^2){
  275. PX = T%Res
  276. PY = floor(T/Res)
  277. ResA = array()
  278. for(I=1, Sample^2){
  279. Glass = vec(1)
  280. ShadowDist = 0
  281. RPos = Screen:toWorld(vec((PY+((I-1)%Sample)/Sample)*Box:y()/Res-Box:y()/2, (PX+floor((I-1)/Sample)/Sample)*Box:x()/Res-Box:x()/2, 0))
  282. R = cRanger(Dist, RPos, -Screen:up())
  283. Dot = clamp(!R:hitWorld()? R:hitNormal():dot(vec(1,1,0.5)) : 1, 0, 1)
  284. HN = R:hitWorld()? R:hitNormal() :R:entity():toLocalAxis(R:hitNormal())
  285. if(Colormode==0 | Colormode==1){
  286. PC = R:hitWorld()? vec(1) :R:entity():getColor()/255
  287. }else{
  288. LPos = R:hitWorld()?R:pos() :R:entity():toLocal(R:pos())
  289. if(abs(HN:z())>0.5){
  290. PC = hsv2rgb(((sin(LPos:x()*10)*cos(LPos:y()*10)+1)*180+ShadowDist*10)%360, 1, 1)/255
  291. }elseif(abs(HN:x())>0.5){
  292. PC = hsv2rgb(((sin(LPos:z()*10)*cos(LPos:y()*10)+1)*180+ShadowDist*10)%360, 1, 1)/255
  293. }elseif(abs(HN:y())>0.5){
  294. PC = hsv2rgb(((sin(LPos:x()*10)*cos(LPos:z()*10)+1)*180+ShadowDist*10)%360, 1, 1)/255
  295. }
  296. }
  297. Color = (Dot*PC):mul(Colormode!=2?Glass :vec(1))
  298. Shadow = 1
  299. if(R:hit()){
  300. ShadowDist = 0
  301. R2 = cRanger(ShadowR, R:position(), vec(1,1,0.5))
  302. if(R2:hit()){
  303. Shadow = clamp(ShadowDist/ShadowS+0.3, 0, 1)
  304. }
  305. }
  306. Shine = 5*clamp(10-abs(R:hitNormal():vAng(-Screen:up())-R:hitNormal():vAng(R:position()-LightP)), 0, 10)/255
  307. TC = vec(1)
  308. HP = R:hitWorld()? R:position() :R:entity():toLocal(R:position())
  309. N2 = (signV(HN)-HN)
  310. TP = N2:mul(HP):rotate(HN:toAngle()+ang(90,0,0))
  311. if(Textured & Colormode!=2){
  312. MT = R:matType()
  313. if(abs(HN:z())>0.5){
  314. TC = Tex[MT, table][floor((HP:x()/PixelSize)%TRes)+1, array]:vector(floor((HP:y()/PixelSize)%TRes)+1)/255
  315. }elseif(abs(HN:x())>0.5){
  316. TC = Tex[MT, table][floor((HP:z()/PixelSize)%TRes)+1, array]:vector(floor((HP:y()/PixelSize)%TRes)+1)/255
  317. }elseif(abs(HN:y())>0.5){
  318. TC = Tex[MT, table][floor((HP:z()/PixelSize)%TRes)+1, array]:vector(floor((HP:x()/PixelSize)%TRes)+1)/255
  319. }
  320. }
  321. SSAO = 0
  322. if(SSAOon){
  323. for(SI=1, SSAONoS){
  324. RA = random(0,360)
  325. SR = cRanger(Dist, RPos+Screen:toWorld(vec(cos(RA), sin(RA), 0)*sqrt(random(0,1))*SSAOSR)-Screen:pos(), -Screen:up())
  326. SSAO += SR:distance()<R:distance() & abs(R:distance()-SR:distance())<SSAORC
  327. }
  328. SSAO = ((SSAONoS-SSAO)/SSAONoS)+0.4
  329. }else{
  330. SSAO = 1
  331. }
  332. ResultC = clampV(SSAO*TC*Color*Shadow+vec(Shine), 0, 1)
  333. if(Colormode==0){
  334. ResultC = vec(ResultC:x()*0.2126+ResultC:y()*0.7152+ResultC:z()*0.0722)
  335. }
  336. ResA:pushVector(ResultC*255)
  337. }
  338. Result = ResA:avgV()
  339. S[T] = rgb2digi(clampV(Result, 0, 255), 3)
  340. T++
  341. DeltaT++
  342. }
  343. if(changed(time())){
  344. Time = (Res^2-T)/DeltaT
  345. Times:pushNumber(Time)
  346. Times:removeNumber(1)
  347. RTime = Times:average()
  348. Ht = floor(RTime/3600)
  349. Mt = floor(RTime/60)%60
  350. St = floor(RTime%60)
  351. holoMaterial(101, "models/cheeze/buttons2/"+(Ht%10))
  352. holoMaterial(102, "models/cheeze/buttons2/"+(floor(Mt/10)%10))
  353. holoMaterial(103, "models/cheeze/buttons2/"+(Mt%10))
  354. holoMaterial(104, "models/cheeze/buttons2/"+(floor(St/10)%10))
  355. holoMaterial(105, "models/cheeze/buttons2/"+(St%10))
  356. DeltaT=0
  357. rangerFilter(players())
  358. }
  359. if(T==Res^2){
  360. if(Rec){
  361. T = 0
  362. }else{
  363. for(I=1, 5){
  364. holoMaterial(100+I, "models/cheeze/buttons2/0")
  365. }
  366. Start=T=Pause=Rec = 0
  367. for(I=1, 8){
  368. holoAlpha(83+I, 255)
  369. }
  370. for(I=1, 4){
  371. holoAlpha(I+96, 0)
  372. }
  373. }
  374. }
  375. }
  376. }
  377. while(Buffer:count() & holoCanCreate() & perf(90)){
  378. Val = Buffer:removeArray(1)
  379. Screen:objMenu(10+MID, Val:vector2(1), Val:vector2(2), Val:string(3), Val:vector(4))
  380. MID++
  381. }
  382. if(Buffer:count()==0 & !HLoaded){
  383. HLoaded = 1
  384. holoMaterial(27, "models/cheeze/buttons2/1")
  385. holoMaterial(28, "models/cheeze/buttons2/2")
  386. holoMaterial(29, "models/cheeze/buttons2/3")
  387. holoPos(52, holoEntity(52):toWorld(vec(0,0,0.08)))
  388. holoPos(68, holoEntity(68):toWorld(vec(0,0,0.08)))
  389. holoPos(72, holoEntity(72):toWorld(vec(0,0,0.08)))
  390. holoPos(69, holoEntity(69):toWorld(vec(0,0,0.08)))
  391. holoPos(70, holoEntity(70):toWorld(vec(0,0,0.08)))
  392. AB = Screen:aabbSize()
  393. holoAng(76, holoEntity(76):toWorld(ang(180,180,90)))
  394. holoScaleUnits(76, vec(33/Canvas:y(), 0.2, 33*Max/Canvas:x()):mul(vec(AB:x(), AB:z(), AB:y())))
  395. holoPos(76, holoEntity(76):toWorld(vec(0,0.05,0)))
  396. holoMaterial(76, "vgui/bg-lines")
  397. holoAng(77, holoEntity(77):toWorld(ang(180,180,90)))
  398. holoScaleUnits(77, vec(33/Canvas:y(), 0.2, 33*Max/Canvas:x()):mul(vec(AB:x(), AB:z(), AB:y())))
  399. holoPos(77, holoEntity(77):toWorld(vec(0,0.05,0)))
  400. holoMaterial(77, "editor/axis_helper")
  401. holoAng(78, holoEntity(78):toWorld(ang(180,180,90)))
  402. holoScaleUnits(78, vec(33/Canvas:y(), 0.2, 33*Max/Canvas:x()):mul(vec(AB:x(), AB:z(), AB:y())))
  403. holoPos(78, holoEntity(78):toWorld(vec(0,0.05,0)))
  404. holoMaterial(78, "effects/flashlight/tech")
  405.  
  406. holoAng(79, holoEntity(79):toWorld(ang(180,0,90)))
  407. holoScaleUnits(79, vec(33/Canvas:y(), 0.2, 33*Max/Canvas:x()):mul(vec(AB:x(), AB:z(), AB:y())))
  408. holoPos(79, holoEntity(79):toWorld(vec(0,0.05,0)))
  409. holoAng(80, holoEntity(80):toWorld(ang(180,0,90)))
  410. holoScaleUnits(80, vec(33/Canvas:y(), 0.2, 33*Max/Canvas:x()):mul(vec(AB:x(), AB:z(), AB:y())))
  411. holoPos(80, holoEntity(80):toWorld(vec(0,0.05,0)))
  412. holoAng(81, holoEntity(81):toWorld(ang(180,0,90)))
  413. holoScaleUnits(81, vec(33/Canvas:y(), 0.2, 33*Max/Canvas:x()):mul(vec(AB:x(), AB:z(), AB:y())))
  414. holoPos(81, holoEntity(81):toWorld(vec(0,0.05,0)))
  415.  
  416. holoPos(86, holoEntity(86):toWorld(vec(0,0,0.08)))
  417. holoPos(87, holoEntity(87):toWorld(vec(0,0,0.08)))
  418.  
  419. holoClipEnabled(91, 1, 1)
  420. holoClip(91, 1, vec(-10/Canvas:y(), -5*Max/Canvas:x(), 0):mul(AB), vec(1,-0.5,0), 0)
  421. holoClipEnabled(91, 2, 1)
  422. holoClip(91, 2, vec(10/Canvas:y(), -5*Max/Canvas:x(), 0):mul(AB), vec(-1,-0.5,0), 0)
  423.  
  424. holoAng(95, holoEntity(95):toWorld(ang(0,45,0)))
  425. holoAng(96, holoEntity(96):toWorld(ang(0,-45,0)))
  426.  
  427. holoMaterial(92, "models/cheeze/buttons2/"+(floor(Res/100)%10))
  428. holoMaterial(93, "models/cheeze/buttons2/"+(floor(Res/10)%10))
  429. holoMaterial(94, "models/cheeze/buttons2/"+(Res%10))
  430.  
  431. holoAlpha(97, 0)
  432. holoAlpha(98, 0)
  433. holoAlpha(99, 0)
  434. holoAlpha(100, 0)
  435. holoAng(98, holoEntity(98):toWorld(ang(180,180,90)))
  436. holoScaleUnits(98, vec(45/Canvas:y(), 0.2, 45*Max/Canvas:x()):mul(vec(AB:x(), AB:z(), AB:y())))
  437.  
  438. holoPos(72, holoEntity(69):toWorld(vec(0,127*((PixelSize-MinT)/(MaxT-MinT))*Max/Canvas:x(),0):mul(AB)))
  439.  
  440. for(I=1, 5){
  441. holoMaterial(100+I, "models/cheeze/buttons2/0")
  442. }
  443. }
  444. K = O:keyUse()
  445. if(O:shootPos():distance(Screen:pos())<500 & $K==1 & O:aimEntity()==Screen & !O:keyAttack1() & HLoaded){
  446. Open = !Open
  447. Screen:soundPlay(1, 1, "doors/doormove2.wav")
  448. soundPitch(1, 255)
  449. exit()
  450. }
  451. if(Open & Sl<Max+0.05){
  452. Screen:slide(0.02)
  453. }
  454. if(!Open & Sl>0.01){
  455. Screen:slide(-0.02)
  456. }
  457. Open = Open
  458. if(Open){
  459. if(lookingAt(24, 3)){
  460. holoColor(24, vec(100))
  461. if($K==1 & Res>1 & !Start){
  462. holoEntity(24):soundPlay(1, 0.5, "buttons/button22.wav")
  463. soundPitch(1, 255)
  464. Res /= 2
  465. holoMaterial(92, "models/cheeze/buttons2/"+(floor(Res/100)%10))
  466. holoMaterial(93, "models/cheeze/buttons2/"+(floor(Res/10)%10))
  467. holoMaterial(94, "models/cheeze/buttons2/"+(Res%10))
  468. S:initScreen(Res)
  469. }
  470. }else{
  471. holoColor(24, vec())
  472. }
  473. if(lookingAt(25, 3)){
  474. holoColor(25, vec(100))
  475. holoColor(26, vec(100))
  476. if($K==1 & Res<512 & !Start){
  477. holoEntity(25):soundPlay(1, 0.5, "buttons/button22.wav")
  478. soundPitch(1, 255)
  479. Res *= 2
  480. holoMaterial(92, "models/cheeze/buttons2/"+(floor(Res/100)%10))
  481. holoMaterial(93, "models/cheeze/buttons2/"+(floor(Res/10)%10))
  482. holoMaterial(94, "models/cheeze/buttons2/"+(Res%10))
  483. S:initScreen(Res)
  484. }
  485. }else{
  486. holoColor(25, vec())
  487. holoColor(26, vec())
  488. }
  489. if(lookingAt(84, 5) & !Start){
  490. holoColor(84, vec(100))
  491. holoColor(85, vec(100))
  492. if($K==1){
  493. holoEntity(84):soundPlay(1, 0.5, "buttons/button22.wav")
  494. soundPitch(1, 255)
  495. Start = 1
  496. for(I=1, 8){
  497. holoAlpha(83+I, 0)
  498. }
  499. holoAlpha(97, 255)
  500. holoAlpha(99, 255)
  501. holoAlpha(100, 255)
  502. exit()
  503. }
  504. }else{
  505. holoColor(84, vec())
  506. holoColor(85, vec())
  507. }
  508. if(lookingAt(88, 5) & !Start){
  509. holoColor(88, vec(100))
  510. holoColor(89, vec(100))
  511. holoColor(90, vec(100))
  512. holoColor(91, vec(100))
  513. if($K==1){
  514. holoEntity(88):soundPlay(1, 0.5, "buttons/button22.wav")
  515. soundPitch(1, 255)
  516. Start=Rec = 1
  517. for(I=1, 8){
  518. holoAlpha(83+I, 0)
  519. }
  520. holoAlpha(97, 255)
  521. holoAlpha(99, 255)
  522. holoAlpha(100, 255)
  523. exit()
  524. }
  525. }else{
  526. holoColor(88, vec())
  527. holoColor(89, vec())
  528. holoColor(90, vec())
  529. holoColor(91, vec())
  530. }
  531. if(lookingAt(84, 5) & Start & !Pause){
  532. holoColor(99, vec(100))
  533. holoColor(100, vec(100))
  534. if($K==1){
  535. holoEntity(99):soundPlay(1, 0.5, "buttons/button22.wav")
  536. soundPitch(1, 255)
  537. Pause = 1
  538. holoAlpha(99, 0)
  539. holoAlpha(100, 0)
  540. holoAlpha(98, 255)
  541. exit()
  542. }
  543. }else{
  544. holoColor(99, vec())
  545. holoColor(100, vec())
  546. }
  547. if(lookingAt(84, 5) & Start & Pause){
  548. holoColor(98, vec(100))
  549. if($K==1){
  550. holoEntity(98):soundPlay(1, 0.5, "buttons/button22.wav")
  551. soundPitch(1, 255)
  552. Pause = 0
  553. holoAlpha(99, 255)
  554. holoAlpha(100, 255)
  555. holoAlpha(98, 0)
  556. exit()
  557. }
  558. }else{
  559. holoColor(98, vec())
  560. }
  561. if(lookingAt(97, 5) & Start){
  562. holoColor(97, vec(100))
  563. if($K==1){
  564. holoEntity(97):soundPlay(1, 0.5, "buttons/button22.wav")
  565. soundPitch(1, 255)
  566. for(I=1, 5){
  567. holoMaterial(100+I, "models/cheeze/buttons2/0")
  568. }
  569. Start=T=Pause=Rec = 0
  570. for(I=1, 8){
  571. holoAlpha(83+I, 255)
  572. }
  573. for(I=1, 4){
  574. holoAlpha(I+96, 0)
  575. }
  576. }
  577. }else{
  578. holoColor(97, vec())
  579. }
  580. if($K==1 & !Start){
  581. if(lookingAt(27, 2.5)){
  582. holoEntity(27):soundPlay(1, 0.5, "buttons/button22.wav")
  583. soundPitch(1, 255)
  584. Sample = 1
  585. holoColor(27, vec(0,200,0))
  586. holoColor(28, vec(255,0,0))
  587. holoColor(29, vec(255,0,0))
  588. }elseif(lookingAt(28, 2.5)){
  589. holoEntity(28):soundPlay(1, 0.5, "buttons/button22.wav")
  590. soundPitch(1, 255)
  591. Sample = 2
  592. holoColor(27, vec(255,0,0))
  593. holoColor(28, vec(0,200,0))
  594. holoColor(29, vec(255,0,0))
  595. }elseif(lookingAt(29, 2.5)){
  596. holoEntity(29):soundPlay(1, 0.5, "buttons/button10.wav")
  597. print("x3 sample is unavailable as it reaches tick quota, to enable this, uncomment lines 599-602")
  598. #[
  599. Sample = 3
  600. holoColor(27, vec(255,0,0))
  601. holoColor(28, vec(255,0,0))
  602. holoColor(29, vec(0,200,0))
  603. ]#
  604. }elseif(lookingAt(51, 3)){
  605. holoEntity(51):soundPlay(1, 0.5, "buttons/button22.wav")
  606. soundPitch(1, 255)
  607. if(SSAOon){
  608. holoPos(52, holoEntity(52):toWorld(vec(0,-23*Max/Canvas:x(),0):mul(Screen:aabbSize())))
  609. holoColor(49, vec(100))
  610. holoColor(50, vec(100))
  611. holoColor(51, vec(100))
  612. }else{
  613. holoPos(52, holoEntity(52):toWorld(vec(0,23*Max/Canvas:x(),0):mul(Screen:aabbSize())))
  614. holoColor(49, vec(0,200,0))
  615. holoColor(50, vec(0,200,0))
  616. holoColor(51, vec(0,200,0))
  617. }
  618. SSAOon = !SSAOon
  619. }elseif(lookingAt(67, 3)){
  620. holoEntity(67):soundPlay(1, 0.5, "buttons/button22.wav")
  621. soundPitch(1, 255)
  622. if(Textured){
  623. holoPos(68, holoEntity(68):toWorld(vec(0,-23*Max/Canvas:x(),0):mul(Screen:aabbSize())))
  624. holoColor(65, vec(100))
  625. holoColor(66, vec(100))
  626. holoColor(67, vec(100))
  627. }else{
  628. holoPos(68, holoEntity(68):toWorld(vec(0,23*Max/Canvas:x(),0):mul(Screen:aabbSize())))
  629. holoColor(65, vec(0,200,0))
  630. holoColor(66, vec(0,200,0))
  631. holoColor(67, vec(0,200,0))
  632. }
  633. Textured = !Textured
  634. }elseif(lookingAt(73, 3)){
  635. holoEntity(73):soundPlay(1, 0.5, "buttons/button22.wav")
  636. soundPitch(1, 255)
  637. Colormode = 0
  638. holoColor(73, vec(0,200,0))
  639. holoColor(74, vec())
  640. holoColor(75, vec())
  641. }elseif(lookingAt(74, 3)){
  642. holoEntity(74):soundPlay(1, 0.5, "buttons/button22.wav")
  643. soundPitch(1, 255)
  644. Colormode = 1
  645. holoColor(73, vec())
  646. holoColor(74, vec(0,200,0))
  647. holoColor(75, vec())
  648. }elseif(lookingAt(75, 3)){
  649. holoEntity(75):soundPlay(1, 0.5, "buttons/button22.wav")
  650. soundPitch(1, 255)
  651. Colormode = 2
  652. holoColor(73, vec())
  653. holoColor(74, vec())
  654. holoColor(75, vec(0,200,0))
  655. }
  656. }
  657. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement