Advertisement
CheezusCrust

Untitled

Jun 13th, 2017
197
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 9.08 KB | None | 0 0
  1. @name TITUS Spikes
  2. @inputs Toggle Base:entity
  3. @outputs SwingAng ArmExtend SpikeExtend Deploy Stage Lock
  4. @persist Scale Mirror E:entity
  5. @trigger none
  6.  
  7. if(first()|dupefinished()) {
  8. soundPurge()
  9. E = entity()
  10. Mirror = -1 #1 or -1
  11. Scale = 1
  12.  
  13. State = 0
  14.  
  15. #Holder - half cylinders
  16. for(I=1,2) {
  17. holoCreate(I)
  18. holoParent(I,E)
  19. holoModel(I,"models/sprops/geometry/hdisc_12.mdl")
  20. holoScale(I,vec(0.5,0.95,0.5)*Scale)
  21. holoAng(I,E:toWorld(ang(0,90,90)))
  22. }
  23.  
  24. holoPos(1,E:toWorld(vec(0,0,5.35)*Scale))
  25. holoPos(2,E:toWorld(vec(0,0,-5.35)*Scale))
  26.  
  27. #Holder - back plate
  28. holoCreate(3)
  29. holoParent(3,E)
  30. holoScale(3,vec(0.1,0.5,1.125)*Scale)
  31. holoPos(3,E:toWorld(vec(-2,0,0)*Scale))
  32. holoAng(3,E:angles())
  33.  
  34. #Cylinder - point of rotation
  35. holoCreate(4)
  36. holoParent(4,E)
  37. holoModel(4,"models/sprops/cylinders/size_2/cylinder_3x12.mdl")
  38. holoScale(4,vec(0.75,0.75,1.2)*Scale)
  39. holoAng(4,E:toWorld(ang(0,0,0))) #MOVEABLE
  40. holoPos(4,E:toWorld(vec(0.25,0,0)*Scale))
  41.  
  42. #Small cube connecting to cylinder
  43. holoCreate(5)
  44. holoParent(5,4)
  45. holoModel(5,"models/sprops/cuboids/height06/size_2/cube_12x12x6.mdl")
  46. holoScale(5,vec(0.25,0.625,0.9)*Scale)
  47. holoPos(5,E:toWorld(vec(1.1,0,0)*Scale))
  48. holoAng(5,E:toWorld(ang(0,0,90)))
  49.  
  50. #Primary arm
  51. holoCreate(6)
  52. holoParent(6,4)
  53. holoModel(6,"models/sprops/cuboids/height06/size_2/cube_12x12x6.mdl")
  54. holoScale(6,vec(2.5,0.875,0.9)*Scale)
  55. holoPos(6,E:toWorld(vec(16.75,0,-1.5)*Scale))
  56. holoAng(6,E:toWorld(ang(0,0,90)))
  57.  
  58. #Secondary arm
  59. holoCreate(7)
  60. holoParent(7,4)
  61. holoModel(7,"models/sprops/cuboids/height06/size_2/cube_12x12x6.mdl")
  62. holoScale(7,vec(2.5,0.875,0.9)*0.9*Scale)
  63. holoPos(7,holoEntity(6):toWorld(vec(3.2,0,0)*Scale)) #MOVEABLE
  64. holoAng(7,E:toWorld(ang(0,0,90)))
  65.  
  66. #Spike connection to secondary arm 1
  67. holoCreate(8)
  68. holoParent(8,7)
  69. holoModel(8,"models/sprops/rectangles_thin/size_0/rect_1_5x12x1_5.mdl")
  70. holoScale(8,vec(0.785,0.75,0.75)*Scale)
  71. holoPos(8,E:toWorld(vec(32.9,2.9,-1.5)*Scale))
  72. holoAng(8,E:toWorld(ang(90,0,0)))
  73.  
  74. #Spike connection to secondary arm 2
  75. holoCreate(9)
  76. holoParent(9,7)
  77. holoModel(9,"models/sprops/rectangles_thin/size_0/rect_1_5x12x1_5.mdl")
  78. holoScale(9,vec(0.785,0.75,0.75)*Scale)
  79. holoPos(9,E:toWorld(vec(32.9,-2.9,-1.5)*Scale))
  80. holoAng(9,E:toWorld(ang(90,0,0)))
  81.  
  82. #Spike - rotation axis cyl
  83. holoCreate(16)
  84. holoParent(16,7)
  85. holoModel(16,"models/sprops/cylinders/size_2/cylinder_3x6.mdl")
  86. holoScale(16,vec(0.75,0.75,1.25)*Scale)
  87. holoPos(16,E:toWorld(vec(36.5,0,-1.5)*Scale))
  88. holoAng(16,holoEntity(7):toWorld(ang(0,0,0))) #MOVEABLE
  89.  
  90. #Spike - main cylinder
  91. holoCreate(10)
  92. holoParent(10,16)
  93. holoModel(10,"models/sprops/cylinders/size_3/cylinder_6x12.mdl")
  94. holoScale(10,vec(0.75,0.75,1.1)*Scale)
  95. holoPos(10,E:toWorld(vec(36.5,0,-3.25)*Scale))
  96. holoAng(10,E:toWorld(ang(0,0,0)))
  97.  
  98. #Spike - cap
  99. holoCreate(11)
  100. holoParent(11,16)
  101. holoModel(11,"models/sprops/cylinders/size_4/cylinder_9x3.mdl")
  102. holoScale(11,vec(0.6,0.6,0.4)*Scale)
  103. holoPos(11,E:toWorld(vec(36.5,0,3.5)*Scale))
  104. holoAng(11,E:toWorld(ang(0,0,0)))
  105.  
  106. #Spike - side tri 1
  107. holoCreate(12)
  108. holoParent(12,7)
  109. holoModel(12,"models/sprops/triangles_thin/regular/t_etri_6x6.mdl")
  110. holoScale(12,vec(1.57,0.75,0.85)*Scale)
  111. holoPos(12,E:toWorld(vec(35.65,2.9,-1.5)*Scale))
  112. holoAng(12,E:toWorld(ang(90,0,0)))
  113.  
  114. #Spike - side tri 2
  115. holoCreate(13)
  116. holoParent(13,7)
  117. holoModel(13,"models/sprops/triangles_thin/regular/t_etri_6x6.mdl")
  118. holoScale(13,vec(1.57,0.75,0.85)*Scale)
  119. holoPos(13,E:toWorld(vec(35.65,-2.9,-1.5)*Scale))
  120. holoAng(13,E:toWorld(ang(90,0,0)))
  121.  
  122. #Spike - side hcyl 1
  123. holoCreate(14)
  124. holoParent(14,7)
  125. holoModel(14,"models/sprops/geometry/hdisc_12.mdl")
  126. holoScale(14,vec(0.3,0.375,0.35)*Scale)
  127. holoPos(14,E:toWorld(vec(37,2.9,-1.5)*Scale))
  128. holoAng(14,E:toWorld(ang(90,0,0)))
  129.  
  130. #Spike - side hcyl 2
  131. holoCreate(15)
  132. holoParent(15,7)
  133. holoModel(15,"models/sprops/geometry/hdisc_12.mdl")
  134. holoScale(15,vec(0.3,0.375,0.35)*Scale)
  135. holoPos(15,E:toWorld(vec(37,-2.9,-1.5)*Scale))
  136. holoAng(15,E:toWorld(ang(90,0,0)))
  137.  
  138. #Spike - hydraulic cyl 1
  139. holoCreate(17)
  140. holoParent(17,10)
  141. holoModel(17,"models/sprops/cylinders/size_3/cylinder_6x12.mdl")
  142. holoScale(17,vec(0.6,0.6,1)*Scale)
  143. holoPos(17,holoEntity(10):toWorld(vec(0,0,-1)*Scale)) #MOVEABLE
  144. holoAng(17,E:toWorld(ang(0,0,0)))
  145. holoMaterial(17,"sprops/textures/sprops_chrome")
  146.  
  147. #Spike - hydraulic cyl 2
  148. holoCreate(18)
  149. holoParent(18,17)
  150. holoModel(18,"models/sprops/cylinders/size_3/cylinder_6x12.mdl")
  151. holoScale(18,vec(0.5,0.5,1)*Scale)
  152. holoPos(18,holoEntity(17):toWorld(vec(0,0,-0.5)*Scale)) #MOVEABLE
  153. holoAng(18,E:toWorld(ang(0,0,0)))
  154. holoMaterial(18,"sprops/textures/sprops_chrome")
  155.  
  156. #Spike - spike
  157. holoCreate(19)
  158. holoParent(19,18)
  159. holoModel(19,"models/sprops/misc/cones/size_0/cone_3x6.mdl")
  160. holoScale(19,vec(1,1,1)*Scale)
  161. holoPos(19,holoEntity(18):toWorld(vec(0,0,-6)*Scale))
  162. holoAng(19,E:toWorld(ang(0,0,180)))
  163. holoMaterial(19,"sprops/textures/gear_metal")
  164.  
  165.  
  166.  
  167.  
  168. #Striped part of main arm
  169. holoCreate(99)
  170. holoParent(99,4)
  171. holoModel(99,"models/sprops/cuboids/height06/size_4/cube_24x60x6.mdl")
  172. holoMaterial(99,"phoenix_storms/stripes")
  173. holoScale(99,vec(0.475,0.3,0.91)*Scale)
  174. holoPos(99,E:toWorld(vec(16.75,0,-1.5)*Scale))
  175. holoAng(99,E:toWorld(ang(0,0,90)))
  176.  
  177. #Foot stand
  178. holoCreate(98)
  179. holoParent(98,4)
  180. holoModel(98,"models/props_wasteland/panel_leverhandle001a.mdl")
  181. #holoMaterial(98,"phoenix_storms/stripes")
  182. holoScale(98,vec(0.6,1.5,1)*Scale)
  183. holoPos(98,E:toWorld(vec(25,1*Mirror,-3)*Scale))
  184. holoAng(98,E:toWorld(ang(0,90*Mirror,180)))
  185.  
  186.  
  187. for(I=1,7) {
  188. holoMaterial(I,"sprops/textures/sprops_metal1")
  189. holoColor(I,vec(60))
  190. }
  191. for(I=8,16) {
  192. holoMaterial(I,"sprops/textures/sprops_metal1")
  193. holoColor(I,vec(175))
  194. }
  195.  
  196. holoAng(4,E:toWorld(ang(0,90 * -Mirror,0)))
  197. holoAng(16,holoEntity(7):toWorld(ang(0,-5,0)))
  198. }
  199.  
  200. interval(50)
  201.  
  202. if(changed(Toggle)&Toggle&!Lock) {
  203. if(!Deploy) {
  204. soundPurge()
  205. Stage = 1
  206. Lock = 1
  207. Deploy = 1
  208. E:soundPlay(1,0,"acf_extra/airfx/gear_up.wav")
  209. soundPitch(1,100)
  210. timer("stage2",3000)
  211. timer("stage3",7000)
  212. timer("stage3impact",7250)
  213. } else {
  214. Stage = 4
  215. Deploy = 0
  216. Lock = 1
  217. Base:propFreeze(0)
  218. soundPurge()
  219. holoEntity(17):soundPlay(1,0,"doors/heavy_metal_move1.wav")
  220. timer("stage5",1500)
  221. timer("stage6",5500)
  222. timer("stage6unlock",8500)
  223. }
  224. }
  225. if(clk("stage2")) {
  226. Stage = 2
  227. soundStop(1)
  228. holoEntity(7):soundPlay(2,0,"acf_extra/airfx/gear_up.wav")
  229. }
  230. if(clk("stage3")) {
  231. Stage = 3
  232. soundStop(2)
  233. holoEntity(17):soundPlay(3,0,"doors/vent_open1.wav")
  234. }
  235. if(clk("stage3impact")) {
  236. holoEntity(17):soundPlay(4,0,"Dirt.BulletImpact")
  237. if(rangerOffset(3*Scale,holoEntity(19):pos(),entity():up()*-1):hit()) {
  238. Base:propFreeze(1)
  239. print("Hit")
  240. }
  241. Lock = 0
  242. }
  243. if(clk("stage5")) {
  244. Stage = 5
  245. soundStop(1)
  246. holoEntity(7):soundPlay(2,0,"acf_extra/airfx/gear_up.wav")
  247. }
  248. if(clk("stage6")) {
  249. Stage = 6
  250. soundStop(2)
  251. holoEntity(4):soundPlay(3,0,"acf_extra/airfx/gear_up.wav")
  252. }
  253. if(clk("stage6unlock")) {
  254. Stage = 0
  255. Lock = 0
  256. }
  257.  
  258.  
  259.  
  260.  
  261. if(Stage == 1) {
  262. if(SwingAng < 90) {
  263. soundPitch(1,100 + sin(curtime()*90)*7.5)
  264. SwingAng+=2
  265. holoAng(4,E:toWorld(ang(0,(90 * -Mirror) + (SwingAng * Mirror),0)))
  266. }
  267. }
  268. if(Stage == 2) {
  269. if(ArmExtend < 18.5) {
  270. soundPitch(2,70 + cos(curtime()*75)*7.5)
  271. ArmExtend+=0.3
  272. holoPos(7,holoEntity(6):toWorld(vec(3.2 + ArmExtend,0,0)*Scale))
  273. }
  274. }
  275. if(Stage == 3) {
  276. if(SpikeExtend < 7.5) {
  277. SpikeExtend+=2.5
  278. holoPos(17,holoEntity(10):toWorld(vec(0,0,-1 - SpikeExtend*1.2)*Scale))
  279. holoPos(18,holoEntity(17):toWorld(vec(0,0,-0.5 - SpikeExtend*1.2)*Scale))
  280. }
  281. }
  282. if(Stage == 4) {
  283. if(SpikeExtend > 0) {
  284. SpikeExtend-=0.5
  285. holoPos(17,holoEntity(10):toWorld(vec(0,0,-1 - SpikeExtend*1.2)*Scale))
  286. holoPos(18,holoEntity(17):toWorld(vec(0,0,-0.5 - SpikeExtend*1.2)*Scale))
  287. }
  288. }
  289. if(Stage == 5) {
  290. if(ArmExtend > 0) {
  291. soundPitch(2,70 + cos(curtime()*75)*7.5)
  292. ArmExtend-=0.3
  293. holoPos(7,holoEntity(6):toWorld(vec(3.2 + ArmExtend,0,0)*Scale))
  294. }
  295. }
  296. if(Stage == 6) {
  297. if(SwingAng > 0) {
  298. soundPitch(3,100 + sin(curtime()*90)*7.5)
  299. SwingAng-=2
  300. holoAng(4,E:toWorld(ang(0,(90 * -Mirror) + (SwingAng * Mirror),0)))
  301. }
  302. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement