Advertisement
KrazziPro

HoverScooterV2 (KrazziPro Enhanced)

Jun 20th, 2018
103
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 6.29 KB | None | 0 0
  1. @name HoverScooterV2 (KrazziPro Enhanced)
  2. @inputs Pod:wirelink Active_p
  3. @outputs Light:vector W A S D
  4. @persist E:entity R1_dist W_i START Active Active_i E_speed H_i R_E:array Warning_bip W_active M1
  5. @trigger
  6. @model models/hunter/blocks/cube05x105x05.mdl
  7.  
  8. interval(20)
  9.  
  10. if(first()| dupefinished())
  11. {
  12. timer("bip",500)
  13. soundPlay(0,0,"ambient/tones/garage.wav")
  14. soundPlay(1,0,"ambient/machines/big_truck.wav")
  15. soundPlay(2,0,"weapons/airboat/airboat_gun_loop2.wav")
  16.  
  17. E=entity()
  18. E:setMass(300)
  19. #E:setAlpha(0)
  20. R_E=E:getConstraints()
  21. rangerPersist(1)
  22. rangerHitWater(1)
  23.  
  24. rangerPersist(1)
  25. rangerHitWater(1)
  26. }
  27.  
  28. holoCreate(0,E:toWorld(vec(10,13,0)),vec(0.5,0.5,3))
  29.  
  30. holoModel(0,"models/props_combine/combine_mine01.mdl")
  31. holoParent(0,E)
  32.  
  33. holoCreate(1,E:toWorld(vec(-10,13,0)),vec(0.5,0.5,3))
  34.  
  35. holoModel(1,"models/props_combine/combine_mine01.mdl")
  36. holoParent(1,E)
  37. holoCreate(2,E:toWorld(vec(0,8,-14)),vec(0.5,1,1))
  38. holoAlpha(2,0)
  39. holoParent(2,E)
  40.  
  41. holoCreate(3,E:toWorld(vec(-5,8,-10)),vec(0.5,1,1))
  42. holoModel(3,"models/Weapons/w_rocket_launcher.mdl")
  43. holoParent(3,2)
  44.  
  45. holoCreate(4,E:toWorld(vec(0,5,0)),vec(0.7,1.5,0.2),E:toWorld(ang(0,0,0)))
  46. holoColor(4,vec(30,30,140))
  47. holoModel(4,"models/Effects/vol_light64x256.mdl")
  48. holoParent(4,E)
  49.  
  50. holoCreate(5,E:toWorld(vec(10,-14,-4)),vec(0.15,0.3,0.1),E:toWorld(ang(-45,0,0)))
  51. holoColor(5,vec(100,100,255))
  52. holoModel(5,"models/Effects/vol_light128x128.mdl")
  53. holoParent(5,E)
  54.  
  55. holoCreate(6,E:toWorld(vec(-10,-14,-4)),vec(0.15,0.3,0.1),E:toWorld(ang(45,0,0)))
  56. holoColor(6,vec(100,100,255))
  57. holoModel(6,"models/Effects/vol_light128x128.mdl")
  58. holoParent(6,E)
  59.  
  60. holoCreate(7,E:toWorld(vec(0,28,-15)),vec(0.15,0.3,0.1),E:toWorld(ang(0,0,0)))
  61. holoColor(7,vec(100,100,255))
  62. holoModel(7,"models/Effects/vol_light128x128.mdl")
  63. holoParent(7,E)
  64.  
  65. holoCreate(8,E:toWorld(vec(0,-40,4)),vec(1,1,1),E:toWorld(ang(0,-90,180)))
  66. holoColor(8,vec(100,100,100))
  67. holoModel(8,"models/props_wasteland/light_spotlight01_lamp.mdl",1)
  68. holoParent(8,E)
  69.  
  70. holoCreate(9,E:toWorld(vec(0,-48,1)),vec(0.5,0.5,0.5)*0.4,E:toWorld(ang(0,0,-90)))
  71. holoColor(9,vec(100,100,255))
  72. holoModel(9,"models/Effects/vol_light128x128.mdl")
  73. holoParent(9,E)
  74. holoAlpha(9,0)
  75.  
  76. holoCreate(10,E:toWorld(vec(0,-36,30)),vec(0.7,1.5,1.5)*0.4,E:toWorld(ang(180,90,0)))
  77. holoModel(10,"models/props_trainstation/mount_connection001a.mdl")
  78. holoParent(10,E)
  79.  
  80. }
  81.  
  82. W=Pod["W",number]
  83. A=Pod["A",number]
  84. S=Pod["S",number]
  85. D=Pod["D",number]
  86. BEA=Pod["Bearing",number]
  87. ELE=Pod["Elevation",number]
  88. M1=Pod["Mouse1",number]
  89. START=Pod["R",number]
  90. DRIVER=Pod["Entity",entity]
  91. if(START & $START)
  92. {
  93. Active=Active==0
  94. if(Active)
  95. {
  96. soundPlay(6,0,"ambient/machines/thumper_startup1.wav")
  97. soundStop(5)
  98. soundPlay(7,2,"hl1/fvox/activated.wav")
  99. }
  100. else
  101. {
  102. soundPlay(5,0,"ambient/machines/thumper_shutdown1.wav")
  103. soundStop(6)
  104. soundPlay(8,2,"hl1/fvox/deactivated.wav")
  105. }
  106. }
  107. Active_i+=-0.012+(Active>Active_i)*0.02
  108. W_i=W
  109. if($W)
  110. {
  111. if(W)
  112. {
  113. holoAlpha(9,255)
  114. holoSkin(8,0)
  115. soundPlay(4,0,"ambient/machines/diesel_engine_idle1.wav")
  116. }
  117. else
  118. {
  119. holoAlpha(9,0)
  120. holoSkin(8,1)
  121. soundStop(4)
  122. }
  123. }
  124.  
  125. SHIFT=Pod["Shift",number]
  126. Light=vec(100,100,255)*Active
  127. E_vel=E:vel()
  128. E_speed=E_vel:length()
  129. R1_dist_set=30-min(E_vel:z()/2,0)
  130. if($E_speed<-(50+Active*250) )
  131. {
  132. if(Active)
  133. {
  134. #fx("explosion",E:pos(),1)
  135. soundPlay(9,0,"vehicles/v8/vehicle_impact_heavy.wav")
  136. }
  137. #Active=0
  138. #Active_i=0
  139. #Pod["Damage Health",number]=E_speed/20
  140. #soundPlay(6,0.8,"vehicles/v8/vehicle_impact_heavy"+randint(1,4):toString()+".wav")
  141.  
  142.  
  143. }
  144. rangerFilter(R_E)
  145. R1=rangerOffset(R1_dist_set,E:toWorld(vec(0,35,-10)),-vec(0,0,1))
  146. rangerFilter(R_E)
  147. R1_2=rangerOffset(R1_dist_set,E:toWorld(vec(0,-35,-10)),-vec(0,0,1))
  148. rangerFilter(R_E)
  149. R2=rangerOffset(E:pos(),E:pos()+E:vel()*3)
  150. R1_dist=R1:distance()
  151. R2_dist=R1_2:distance()
  152. E_velL=E:velL()
  153. Force=(8+(R1_dist_set-(R1_dist+R2_dist)/2)/3-$R1_dist*3*R1:hit()-E_velL:z()/300 +E_velL:y()/1200)
  154.  
  155. #Force=(10+SHIFT*6+(80-R1_dist)/3-$R1_dist*3*R1:hit())
  156. S_i=abs(E_velL:y())/5
  157. H_i+=(S_i/10+6)*Active_i
  158. holoAng(0,E:toWorld(ang(H_i,0,90)))
  159. holoAng(1,E:toWorld(ang(-H_i,0,90)))
  160.  
  161. soundPitch(0,(Force*3 +S_i/2)*Active_i)
  162. soundPitch(1,(40+S_i/2)*Active_i)
  163. soundPitch(2,Active*10+(20+S_i/4)*Active_i)
  164. soundPitch(4,(200+S_i/10)*Active_i)
  165. E:applyForce((-E:forward()*E_velL:x()*vec(1,1,-0.7)*10+E:up()*Force*400 -E:right()*(W-S)*10000 +E_vel)*Active_i)
  166. #E:applyAngForce((-ang(E_velL:x()*2 -(D-A)*100,(-A+D)*500,+min(max(-E_velL:y()+(W-S)*100000,-400),400+E_velL:y()/2))/20-E:angles()*ang(1,0,1)-E:angVel()/2)*500)
  167. E:applyAngForce(((-ang(+min(max(E_velL:x()*2 -(D-A)*100,-70000000000000),70000000),(-A+D)*900,(R1_dist-R2_dist)*120+(W-S)*500 +0- E_velL:y()*((Active_p==0)*10-0.5+SHIFT*1.6) )/20-E:angles()*ang(1,0,1)-E:angVel()*ang(0.5,0.5,1))*500)*Active_i)
  168.  
  169. holoAng(2,ang(-ELE,BEA,0)+ang(180,0,0))
  170. if(M1 & $M1)
  171. {
  172. #Missile=spawnEntity("rpg_missile",E:pos()-E:up()*35,ang(-ELE,BEA,0),0)
  173.  
  174. }
  175. if(clk("bip"))
  176. {
  177. timer("bip",500)
  178. if(R2:hit() & Active)
  179. {
  180. Dist_i=(E:pos()-R2:position()):length()
  181. if(((E_vel:length()*3)/Dist_i)>3)
  182. {
  183. #soundPlay(8,0,"hl1/fvox/warning.wav")
  184. soundPitch(8,100)
  185. timer("bip",1000)
  186. }
  187. else
  188. {
  189. #soundPlay(8,0,"buttons/button17.wav")
  190. soundPitch(8,50+8000/Dist_i)
  191. timer("bip",300)
  192. }
  193. }
  194.  
  195. }
  196. if(abs(E:angles():pitch())>70 & E_speed<3)
  197. {
  198. E:applyAngForce(-E:angles()*ang(1,0,1)*8000)
  199. E:soundPlay(12,0,"ambient/machines/diesel_engine_idle1.wav")
  200. }
  201.  
  202. #holoAlpha(5,(0.4+random(1))*Active_i)
  203. #holoAlpha(6,(0.4+random(1))*Active_i)
  204. #holoAlpha(7,(0.4+random(1))*Active_i)
  205. #holoAlpha(4,(0.4+random(1))*Active_i)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement