Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- @name TITUS Spikes
- @inputs Toggle Base:entity
- @outputs SwingAng ArmExtend SpikeExtend Deploy Stage Lock
- @persist Scale Mirror E:entity
- @trigger none
- if(first()|dupefinished()) {
- soundPurge()
- E = entity()
- Mirror = -1 #1 or -1
- Scale = 1
- State = 0
- #Holder - half cylinders
- for(I=1,2) {
- holoCreate(I)
- holoParent(I,E)
- holoModel(I,"models/sprops/geometry/hdisc_12.mdl")
- holoScale(I,vec(0.5,0.95,0.5)*Scale)
- holoAng(I,E:toWorld(ang(0,90,90)))
- }
- holoPos(1,E:toWorld(vec(0,0,5.35)*Scale))
- holoPos(2,E:toWorld(vec(0,0,-5.35)*Scale))
- #Holder - back plate
- holoCreate(3)
- holoParent(3,E)
- holoScale(3,vec(0.1,0.5,1.125)*Scale)
- holoPos(3,E:toWorld(vec(-2,0,0)*Scale))
- holoAng(3,E:angles())
- #Cylinder - point of rotation
- holoCreate(4)
- holoParent(4,E)
- holoModel(4,"models/sprops/cylinders/size_2/cylinder_3x12.mdl")
- holoScale(4,vec(0.75,0.75,1.2)*Scale)
- holoAng(4,E:toWorld(ang(0,0,0))) #MOVEABLE
- holoPos(4,E:toWorld(vec(0.25,0,0)*Scale))
- #Small cube connecting to cylinder
- holoCreate(5)
- holoParent(5,4)
- holoModel(5,"models/sprops/cuboids/height06/size_2/cube_12x12x6.mdl")
- holoScale(5,vec(0.25,0.625,0.9)*Scale)
- holoPos(5,E:toWorld(vec(1.1,0,0)*Scale))
- holoAng(5,E:toWorld(ang(0,0,90)))
- #Primary arm
- holoCreate(6)
- holoParent(6,4)
- holoModel(6,"models/sprops/cuboids/height06/size_2/cube_12x12x6.mdl")
- holoScale(6,vec(2.5,0.875,0.9)*Scale)
- holoPos(6,E:toWorld(vec(16.75,0,-1.5)*Scale))
- holoAng(6,E:toWorld(ang(0,0,90)))
- #Secondary arm
- holoCreate(7)
- holoParent(7,4)
- holoModel(7,"models/sprops/cuboids/height06/size_2/cube_12x12x6.mdl")
- holoScale(7,vec(2.5,0.875,0.9)*0.9*Scale)
- holoPos(7,holoEntity(6):toWorld(vec(3.2,0,0)*Scale)) #MOVEABLE
- holoAng(7,E:toWorld(ang(0,0,90)))
- #Spike connection to secondary arm 1
- holoCreate(8)
- holoParent(8,7)
- holoModel(8,"models/sprops/rectangles_thin/size_0/rect_1_5x12x1_5.mdl")
- holoScale(8,vec(0.785,0.75,0.75)*Scale)
- holoPos(8,E:toWorld(vec(32.9,2.9,-1.5)*Scale))
- holoAng(8,E:toWorld(ang(90,0,0)))
- #Spike connection to secondary arm 2
- holoCreate(9)
- holoParent(9,7)
- holoModel(9,"models/sprops/rectangles_thin/size_0/rect_1_5x12x1_5.mdl")
- holoScale(9,vec(0.785,0.75,0.75)*Scale)
- holoPos(9,E:toWorld(vec(32.9,-2.9,-1.5)*Scale))
- holoAng(9,E:toWorld(ang(90,0,0)))
- #Spike - rotation axis cyl
- holoCreate(16)
- holoParent(16,7)
- holoModel(16,"models/sprops/cylinders/size_2/cylinder_3x6.mdl")
- holoScale(16,vec(0.75,0.75,1.25)*Scale)
- holoPos(16,E:toWorld(vec(36.5,0,-1.5)*Scale))
- holoAng(16,holoEntity(7):toWorld(ang(0,0,0))) #MOVEABLE
- #Spike - main cylinder
- holoCreate(10)
- holoParent(10,16)
- holoModel(10,"models/sprops/cylinders/size_3/cylinder_6x12.mdl")
- holoScale(10,vec(0.75,0.75,1.1)*Scale)
- holoPos(10,E:toWorld(vec(36.5,0,-3.25)*Scale))
- holoAng(10,E:toWorld(ang(0,0,0)))
- #Spike - cap
- holoCreate(11)
- holoParent(11,16)
- holoModel(11,"models/sprops/cylinders/size_4/cylinder_9x3.mdl")
- holoScale(11,vec(0.6,0.6,0.4)*Scale)
- holoPos(11,E:toWorld(vec(36.5,0,3.5)*Scale))
- holoAng(11,E:toWorld(ang(0,0,0)))
- #Spike - side tri 1
- holoCreate(12)
- holoParent(12,7)
- holoModel(12,"models/sprops/triangles_thin/regular/t_etri_6x6.mdl")
- holoScale(12,vec(1.57,0.75,0.85)*Scale)
- holoPos(12,E:toWorld(vec(35.65,2.9,-1.5)*Scale))
- holoAng(12,E:toWorld(ang(90,0,0)))
- #Spike - side tri 2
- holoCreate(13)
- holoParent(13,7)
- holoModel(13,"models/sprops/triangles_thin/regular/t_etri_6x6.mdl")
- holoScale(13,vec(1.57,0.75,0.85)*Scale)
- holoPos(13,E:toWorld(vec(35.65,-2.9,-1.5)*Scale))
- holoAng(13,E:toWorld(ang(90,0,0)))
- #Spike - side hcyl 1
- holoCreate(14)
- holoParent(14,7)
- holoModel(14,"models/sprops/geometry/hdisc_12.mdl")
- holoScale(14,vec(0.3,0.375,0.35)*Scale)
- holoPos(14,E:toWorld(vec(37,2.9,-1.5)*Scale))
- holoAng(14,E:toWorld(ang(90,0,0)))
- #Spike - side hcyl 2
- holoCreate(15)
- holoParent(15,7)
- holoModel(15,"models/sprops/geometry/hdisc_12.mdl")
- holoScale(15,vec(0.3,0.375,0.35)*Scale)
- holoPos(15,E:toWorld(vec(37,-2.9,-1.5)*Scale))
- holoAng(15,E:toWorld(ang(90,0,0)))
- #Spike - hydraulic cyl 1
- holoCreate(17)
- holoParent(17,10)
- holoModel(17,"models/sprops/cylinders/size_3/cylinder_6x12.mdl")
- holoScale(17,vec(0.6,0.6,1)*Scale)
- holoPos(17,holoEntity(10):toWorld(vec(0,0,-1)*Scale)) #MOVEABLE
- holoAng(17,E:toWorld(ang(0,0,0)))
- holoMaterial(17,"sprops/textures/sprops_chrome")
- #Spike - hydraulic cyl 2
- holoCreate(18)
- holoParent(18,17)
- holoModel(18,"models/sprops/cylinders/size_3/cylinder_6x12.mdl")
- holoScale(18,vec(0.5,0.5,1)*Scale)
- holoPos(18,holoEntity(17):toWorld(vec(0,0,-0.5)*Scale)) #MOVEABLE
- holoAng(18,E:toWorld(ang(0,0,0)))
- holoMaterial(18,"sprops/textures/sprops_chrome")
- #Spike - spike
- holoCreate(19)
- holoParent(19,18)
- holoModel(19,"models/sprops/misc/cones/size_0/cone_3x6.mdl")
- holoScale(19,vec(1,1,1)*Scale)
- holoPos(19,holoEntity(18):toWorld(vec(0,0,-6)*Scale))
- holoAng(19,E:toWorld(ang(0,0,180)))
- holoMaterial(19,"sprops/textures/gear_metal")
- #Striped part of main arm
- holoCreate(99)
- holoParent(99,4)
- holoModel(99,"models/sprops/cuboids/height06/size_4/cube_24x60x6.mdl")
- holoMaterial(99,"phoenix_storms/stripes")
- holoScale(99,vec(0.475,0.3,0.91)*Scale)
- holoPos(99,E:toWorld(vec(16.75,0,-1.5)*Scale))
- holoAng(99,E:toWorld(ang(0,0,90)))
- #Foot stand
- holoCreate(98)
- holoParent(98,4)
- holoModel(98,"models/props_wasteland/panel_leverhandle001a.mdl")
- #holoMaterial(98,"phoenix_storms/stripes")
- holoScale(98,vec(0.6,1.5,1)*Scale)
- holoPos(98,E:toWorld(vec(25,1*Mirror,-3)*Scale))
- holoAng(98,E:toWorld(ang(0,90*Mirror,180)))
- for(I=1,7) {
- holoMaterial(I,"sprops/textures/sprops_metal1")
- holoColor(I,vec(60))
- }
- for(I=8,16) {
- holoMaterial(I,"sprops/textures/sprops_metal1")
- holoColor(I,vec(175))
- }
- holoAng(4,E:toWorld(ang(0,90 * -Mirror,0)))
- holoAng(16,holoEntity(7):toWorld(ang(0,-5,0)))
- }
- interval(50)
- if(changed(Toggle)&Toggle&!Lock) {
- if(!Deploy) {
- soundPurge()
- Stage = 1
- Lock = 1
- Deploy = 1
- E:soundPlay(1,0,"acf_extra/airfx/gear_up.wav")
- soundPitch(1,100)
- timer("stage2",3000)
- timer("stage3",7000)
- timer("stage3impact",7250)
- } else {
- Stage = 4
- Deploy = 0
- Lock = 1
- Base:propFreeze(0)
- soundPurge()
- holoEntity(17):soundPlay(1,0,"doors/heavy_metal_move1.wav")
- timer("stage5",1500)
- timer("stage6",5500)
- timer("stage6unlock",8500)
- }
- }
- if(clk("stage2")) {
- Stage = 2
- soundStop(1)
- holoEntity(7):soundPlay(2,0,"acf_extra/airfx/gear_up.wav")
- }
- if(clk("stage3")) {
- Stage = 3
- soundStop(2)
- holoEntity(17):soundPlay(3,0,"doors/vent_open1.wav")
- }
- if(clk("stage3impact")) {
- holoEntity(17):soundPlay(4,0,"Dirt.BulletImpact")
- if(rangerOffset(3*Scale,holoEntity(19):pos(),entity():up()*-1):hit()) {
- Base:propFreeze(1)
- print("Hit")
- }
- Lock = 0
- }
- if(clk("stage5")) {
- Stage = 5
- soundStop(1)
- holoEntity(7):soundPlay(2,0,"acf_extra/airfx/gear_up.wav")
- }
- if(clk("stage6")) {
- Stage = 6
- soundStop(2)
- holoEntity(4):soundPlay(3,0,"acf_extra/airfx/gear_up.wav")
- }
- if(clk("stage6unlock")) {
- Stage = 0
- Lock = 0
- }
- if(Stage == 1) {
- if(SwingAng < 90) {
- soundPitch(1,100 + sin(curtime()*90)*7.5)
- SwingAng+=2
- holoAng(4,E:toWorld(ang(0,(90 * -Mirror) + (SwingAng * Mirror),0)))
- }
- }
- if(Stage == 2) {
- if(ArmExtend < 18.5) {
- soundPitch(2,70 + cos(curtime()*75)*7.5)
- ArmExtend+=0.3
- holoPos(7,holoEntity(6):toWorld(vec(3.2 + ArmExtend,0,0)*Scale))
- }
- }
- if(Stage == 3) {
- if(SpikeExtend < 7.5) {
- SpikeExtend+=2.5
- holoPos(17,holoEntity(10):toWorld(vec(0,0,-1 - SpikeExtend*1.2)*Scale))
- holoPos(18,holoEntity(17):toWorld(vec(0,0,-0.5 - SpikeExtend*1.2)*Scale))
- }
- }
- if(Stage == 4) {
- if(SpikeExtend > 0) {
- SpikeExtend-=0.5
- holoPos(17,holoEntity(10):toWorld(vec(0,0,-1 - SpikeExtend*1.2)*Scale))
- holoPos(18,holoEntity(17):toWorld(vec(0,0,-0.5 - SpikeExtend*1.2)*Scale))
- }
- }
- if(Stage == 5) {
- if(ArmExtend > 0) {
- soundPitch(2,70 + cos(curtime()*75)*7.5)
- ArmExtend-=0.3
- holoPos(7,holoEntity(6):toWorld(vec(3.2 + ArmExtend,0,0)*Scale))
- }
- }
- if(Stage == 6) {
- if(SwingAng > 0) {
- soundPitch(3,100 + sin(curtime()*90)*7.5)
- SwingAng-=2
- holoAng(4,E:toWorld(ang(0,(90 * -Mirror) + (SwingAng * Mirror),0)))
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement