@name Verus's treads chip @inputs @outputs @persist R Interval Scale WheelCount Height WheelSpace Width ForFor ForUp Parented BackFor BackUp MovingTreads HoloSpawner ToBeSpawned @persist [WheelMat TreadMat]:string [H1 E Base]:entity RotationalAng:angle [HoloSettings WheelEnts]:array @persist [Dis1 Dis2 WheelRGB TreadRGB Pos1 Pos2]:vector @trigger if(first()){ Interval = 50 Scale = 2 WheelCount = 5 Height = 30 WheelSpace = 30 Width = 1.5 MovingTreads = 0 HoloSettings = array( "models/props_pipes/pipemetal001a" #This is the material of the wheels ,"phoenix_storms/car_tire" #This is the material of the treads ,vec(150,150,150) #This is the color of the wheels ,vec(255,255,255) #This is the color of the treads ,"hq_rcylinder_thick" #This is the model of the wheels ,"cube" #This is the model of the treads ,5 #This is how much the e2 will "stretch" the material of the tread ) # small top wheels # ForFor = 0 #this is how much forward or backwards the small forward wheel will be ForUp = 0 #this is how much up or fown the small forward wheel will be BackFor = 0 #this is how much forward or backwards the small Rear wheel will be BackUp = 0 #this is how much up or down the small Rear wheel will be # coding below # interval(100) ToBeSpawned = clamp(WheelCount,1,500) * 3 + 6 HoloSpawner = 0 Base = E:parent() E = entity() Parented = Base:isValid() } elseif(HoloSpawner < ToBeSpawned) { interval(100) HoloSpawner++ if( HoloSpawner == 1) { CurHolo = array( vec(ForFor,0,ForUp), vec(Scale / 1.4,Scale / 1.4,Width), ang(0,0,90), HoloSettings[3,vector], HoloSettings[1,string], HoloSettings[5,string], 0,E ) } elseif( HoloSpawner == 2) { if(MovingTreads){ CurHolo = array( vec(ForFor,0,ForUp), vec(Scale / 1.3,Scale / 1.3,Width), ang(0,0,90), HoloSettings[4,vector], HoloSettings[2,string], "hq_tube_thin", 1 )} else{ CurHolo = array( vec(ForFor,0,ForUp), vec(Scale / 1.3,Scale / 1.3,Width), ang(0,0,90), HoloSettings[4,vector], HoloSettings[2,string], "hq_tube_thin", 0,E )} } elseif( HoloSpawner == 3) { CurHolo = array( vec(-Scale * 2.6,0, -Scale * 3.3), vec(Width,HoloSettings[7,number],Scale / 15), ang(0,0,90), HoloSettings[4,vector], HoloSettings[2,string], HoloSettings[6,string], 0,E ) } elseif( HoloSpawner == 4) { CurHolo = array( vec(BackFor + WheelSpace * (WheelCount + 1),0,BackUp), vec(Scale / 1.4,Scale / 1.4,Width), ang(0,0,90), HoloSettings[3,vector], HoloSettings[1,string], HoloSettings[5,string], 0,E ) } elseif( HoloSpawner == 5) { if(MovingTreads){ CurHolo = array( vec(BackFor + WheelSpace * (WheelCount + 1),0,BackUp), vec(Scale / 1.3,Scale / 1.3,Width), ang(0,0,90), HoloSettings[4,vector], HoloSettings[2,string], "hq_tube_thin", 4 )} else{ CurHolo = array( vec(BackFor + WheelSpace * (WheelCount + 1),0,BackUp), vec(Scale / 1.3,Scale / 1.3,Width), ang(0,0,90), HoloSettings[4,vector], HoloSettings[2,string], "hq_tube_thin", 0,E )} } elseif( HoloSpawner == 6) { CurHolo = array( vec(BackFor + WheelSpace * (WheelCount + 1) + Scale * 2.6,0,BackUp - Scale * 3.3), vec(Width,HoloSettings[7,number],Scale / 15), ang(0,0,90), HoloSettings[4,vector], HoloSettings[2,string], HoloSettings[6,string], 0,E ) } elseif( HoloSpawner == 7) { Teh2 = (vec(ForFor,0,ForUp + Scale * 4.5) + vec(BackFor + WheelSpace * (WheelCount + 1),0,BackUp + Scale * 4.5)) / 2 Dist2 = vec(ForFor,0,ForUp + Scale * 4.5):distance(vec(BackFor + WheelSpace * (WheelCount + 1),0,BackUp + Scale * 4.5)) CurHolo = array( Teh2, vec(Dist2 / 11.15,Dist2 / 180,Width), ang((ForUp + BackUp ) / WheelCount,0,90), # / WheelCount HoloSettings[4,vector], HoloSettings[2,string], "hq_tube_thin", 0,E ) } elseif( (HoloSpawner > (7) ) & (HoloSpawner < (WheelCount + 8) ) ) { CurHolo = array( vec((HoloSpawner - 7) * WheelSpace,0,-Height), vec(Scale * 1.15,Scale * 1.15,Width), ang(0,0,90), HoloSettings[4,vector], HoloSettings[2,string], "hq_cylinder", 0,E ) } elseif( (HoloSpawner > (WheelCount + 7) ) & (HoloSpawner < (WheelCount * 2 + 8) ) ) { CurHolo = array( vec((HoloSpawner - 7 - WheelCount) * WheelSpace,0,-Height), vec(Scale,Scale,Width), ang(0,0,90), HoloSettings[3,vector], HoloSettings[1,string], HoloSettings[5,string], HoloSpawner - WheelCount ) } elseif( (HoloSpawner > (WheelCount * 2 + 7) ) & (HoloSpawner < (WheelCount * 3 + 7) ) ) { CurHolo = array( vec((HoloSpawner - 7 - WheelCount * 2) * WheelSpace,0,-Height - Scale * 6.5), vec(Scale,Scale,Width), ang(0,90,0), HoloSettings[4,vector], HoloSettings[2,string], HoloSettings[6,string], HoloSpawner - WheelCount * 2 ) } holoCreate(HoloSpawner,E:toWorld(CurHolo[1,vector]) ,CurHolo[2,vector] ,E:toWorld(CurHolo[3,angle]) ,CurHolo[4,vector]) holoModel(HoloSpawner,CurHolo[6,string]) holoMaterial(HoloSpawner,CurHolo[5,string]) holoVisible(HoloSpawner,players(),1) if(CurHolo[7,number] > 0) {holoParent(HoloSpawner,CurHolo[7,number])} else {holoParent(HoloSpawner,CurHolo[8,entity])} #holoClip(2,vec(),vec(1,1,0),0) if(HoloSpawner == 2) { for(A = 2,5) {holoClipEnabled(HoloSpawner,A,0)} holoClipEnabled(HoloSpawner,1,1) holoClip(2,vec(),vec(1,0,0):rotate(ang(0,160,0)),0) } elseif(HoloSpawner == 3) { for(A = 2,5) {holoClipEnabled(HoloSpawner,A,0)} holoClipEnabled(HoloSpawner,1,1) holoClip(3,vec(),vec(0,1,0),0) } elseif(HoloSpawner == 5) { for(A = 2,5) {holoClipEnabled(HoloSpawner,A,0)} holoClipEnabled(HoloSpawner,1,1) holoClip(5,vec(),vec(1,0,0):rotate(ang(0,20,0)),0) } elseif(HoloSpawner == 6) { for(A = 2,5) {holoClipEnabled(HoloSpawner,A,0)} holoClipEnabled(HoloSpawner,1,1) holoClip(6,vec(),vec(0,1,0),0) } elseif(HoloSpawner == 7) { for(A = 1,5) {holoClipEnabled(HoloSpawner,A,1)} holoClipEnabled(HoloSpawner,4,0) holoClipEnabled(HoloSpawner,5,0) holoClip(7,1,vec(),vec(0,-1,0),0) holoClip(7,2,vec(Scale * 43.7,0,0),vec(-1,0,0),0) holoClip(7,3,vec(-Scale * 43.7,0,0),vec(1,0,0),0) } if((HoloSpawner < 8) & (HoloSpawner != 7)) { for(A = 2,5) {holoClipEnabled(HoloSpawner,A,0)} holoClipEnabled(HoloSpawner,1,1) holoClipEnabled(HoloSpawner,2,1) } elseif( (HoloSpawner > (7) ) & (HoloSpawner < (WheelCount + 8) ) ) { for(A = 2,5) {holoClipEnabled(HoloSpawner,A,0)} holoClipEnabled(HoloSpawner,1,1) holoClip(HoloSpawner,1,vec(0,-Scale * 6,0),vec(0,-1,0),0) # holoClip(HoloSpawner,2,vec(0,Scale,0),vec(0,-1,0),0) WheelEnts:pushEntity(holoEntity(HoloSpawner)) } elseif( (HoloSpawner > (WheelCount + 7) ) & (HoloSpawner < (WheelCount * 2 + 8) ) ) { for(A = 1,5) {holoClipEnabled(HoloSpawner,A,0)} } elseif( (HoloSpawner > (WheelCount * 2 + 7) ) & (HoloSpawner < (WheelCount * 3 + 7) )) { for(A = 3,5) {holoClipEnabled(HoloSpawner,A,0)} holoClipEnabled(HoloSpawner,1,1) holoClipEnabled(HoloSpawner,2,1) holoClip(HoloSpawner,1,vec(0,0,0),vec(0,1,0),0) } for(A = 1,WheelCount) { rangerPersist(1) rangerFilter(E:getConstraints()) rangerFilter(players()) } } else {interval(Interval) EAng = E:angles() R = mod(R + (Parented ? Base:velL():y() : E:velL():x() ) / Scale / 2,360) RotationalAng = E:toWorld(ang(R,0,90)) Up = vec(0,0,Scale * 7):rotate(EAng) Roll = E:angles():roll() Static = vec(0,0,-Scale * 6.5):rotate(EAng) if(MovingTreads) { for(A = 1,WheelCount) { rangerPersist(1) Ranger = rangerOffset(Height,E:toWorld(vec(A * WheelSpace,0,0)),-E:up()):position() holoPos(A + 7,Ranger + Up) holoAng(A + WheelCount + 7,RotationalAng) } for(B = 1,WheelCount - 1) { Pos1 = WheelEnts[B ,entity]:pos() + Static Pos2 = WheelEnts[B + 1,entity]:pos() + Static HID = B + 7 + WheelCount * 2 Angle = (Pos1 - Pos2):toAngle():setRoll(-Roll) holoPos(HID,(Pos1 + Pos2) / 2) holoAng(HID,Angle:rotateAroundAxis(vec(0,0,1):rotate(Angle),90)) Distance = Pos1:distance(Pos2) / 2 holoClip(HID,1,vec(0,Distance,0),vec(0,-1,0),0) holoClip(HID,2,vec(0,-Distance,0),vec(0,1,0),0) } ForeWheelPos1 = E:toWorld(vec(-Scale * 2.6,0,Scale * 1.7)) + vec(0,0,-Scale * 5):rotate(EAng) FreeWheelPos1 = WheelEnts[1,entity]:pos() + vec(-Scale * 2.6,0,-Scale * 6):rotate(EAng) Angle1 = (ForeWheelPos1 - FreeWheelPos1):toAngle():setRoll(-Roll) D1 = ForeWheelPos1:distance(FreeWheelPos1) / 2 ForeWheelPos2 = E:toWorld(vec(0,0,0)) FreeWheelPos2 = WheelEnts[WheelEnts:count(),entity]:pos() + Static Angle2 = (ForeWheelPos2 - FreeWheelPos2):toAngle():setRoll(-Roll) D2 = ForeWheelPos1:distance(FreeWheelPos1) / 2 holoAng(1,RotationalAng) holoClip(2,vec(),vec(1,0,0):rotate(ang(0,R + 160,0)),0) holoPos(3,(ForeWheelPos1 + FreeWheelPos1) / 2) holoAng(3,Angle1:rotateAroundAxis(vec(0,0,1):rotate(Angle1),90)) holoClip(3,1,vec(0,D1,0),vec(0,-1,0),0) holoClip(3,2,vec(0,-D1,0),vec(0,1,0),0) } else { for(A = 1,WheelCount) { Ranger = rangerOffset(Height - Scale * 8,E:toWorld(vec(A * WheelSpace,0,-Scale * 8)),-E:up()):position() holoPos(A + 7,Ranger + Up) holoAng(A + WheelCount + 7,RotationalAng) } for(B = 1,WheelCount - 1) { Pos1 = WheelEnts[B ,entity]:pos() + Static Pos2 = WheelEnts[B + 1,entity]:pos() + Static HID = B + 7 + WheelCount * 2 Angle = (Pos1 - Pos2):toAngle():setRoll(-Roll) Distance = Pos1:distance(Pos2) / 2 holoAng(HID,Angle:rotateAroundAxis(vec(0,0,1):rotate(Angle),90)) holoScale(HID,vec(Width,Distance / 3,Scale / 15)) } ForeWheelPos1 = E:toWorld(vec(ForFor - Scale * 2.6,0,ForUp + Scale * 1.7)) + vec(0,0,-Scale * 5):rotate(EAng) FreeWheelPos1 = WheelEnts[1,entity]:pos() + vec(-Scale * 2.6,0,-Scale * 6):rotate(EAng) Angle1 = (ForeWheelPos1 - FreeWheelPos1):toAngle():setRoll(-Roll) D1 = ForeWheelPos1:distance(FreeWheelPos1) / 2 ForeWheelPos2 = E:toWorld(vec(BackFor + WheelSpace * (WheelCount + 1) + Scale * 2.6,0,BackUp + Scale * 1.7)) + vec(0,0,-Scale * 5):rotate(EAng) FreeWheelPos2 = WheelEnts[WheelCount,entity]:pos() + vec(Scale * 2.6,0,-Scale * 6):rotate(EAng) Angle2 = (ForeWheelPos2 - FreeWheelPos2):toAngle():setRoll(-Roll) D2 = ForeWheelPos2:distance(FreeWheelPos2) / 2 holoAng(1,RotationalAng) holoAng(4,RotationalAng) holoAng(3,Angle1:rotateAroundAxis(vec(0,0,1):rotate(Angle1),90)) holoScale(3,vec(Width,D1 / 3,Scale / 15)) holoAng(6,Angle2:rotateAroundAxis(vec(0,0,1):rotate(Angle2),90)) holoScale(6,vec(Width,D2 / 3,Scale / 15)) } } if(dupefinished()) {reset()}