Description:
Hologram minigun, made out of exactly 50 holograms (can be more, if you raise the number of the gun pipes [6 at the moment]). This minigun CAN kill. Its portable: you can detach it from its stand, and add it to your back, and carry it around, and then set it up again, much like the DoD:S machine gunner, but a bit different. The barrel spins at 0* to 30*/100ms, it has real VELOCITY, meaning that it slows down, rather than stopping instantly. The fire speed is also determinate by the spin velocity of the barrels -> clamp(vel/3,1,15) shots per 100ms. It emits a shell when firing, it automatically cleans up the shells after 3 seconds individually per shell, leaving minimum of 5 shells spawned. It has real like ammo feed on a wheel, so the ammo looks like its being inserted into the minigun. The minigun is dead accurate in aiming. You can change the spread on the shootTo part, if you want to, but I bet you won?t, coz you want to be powning :P
With E:shootTo, its 100% holograms, NO physic props
Animations:
Barrel spin (with velocity)
Ammo insertion to minigun
Bullet shells flying off (propcore)
Extensions:
Prop core -> bullet shell cases, not important
E:shootTo(VNNN) -> McLovins, essential, for making it shoot. Click me to get it
Video:
Code:
http://www.wegame.com/watch/holo-minigun/
Watch it on Wegame
Usage:
Important!
BEFORE you spawn it, set the convar "wire_holograms_burst_amount" to 50!!!
-------
Using the minigun is simple, if you remember these thing:
Don?t aim at people you don?t want dead or bad consequences could result. (especially with admins)
Always spin up (right mouse) the minigun before firing.
Fire speed is greater the bigger the spin velocity of the barrel is.
On/Off: HOLD right mouse and press E (use)
------------------------------------------
Portability
Numpad:
1: detach minigun from stand
2: deploy the stand, minimum of 200 units from where you aim.
3: attach the minigun
Chat commands:
"deat" Deattaches the minigun from stand
"dep" Deploys stand
"att" Attaches minigun to stand
"give name" Gives control over the minigun to name, owner of the E2 only!
Code:
Yeah, decided not to be an ass and give out the code.
You need E:shootTo for it to work, join my server to use it!
Code:
@name minigun
@inputs Num1 Num2 Num3 NumEnt
@outputs CanFire AttachedToPod UseEnable Fire Spin Use On Vel SoundSpin SoundFire Operator:entity Target:entity
@persist Ang AngFire [Bulets DieTime Disposed]:array
@trigger
@model models/hunter/blocks/cube025x025x025.mdl
interval(100)
if(last()&Bulets:count()>0)
{
for(I=1,Bulets:count())
{
Bulets[I,entity]:propDelete()
}
}
E=entity()
if(first())
{
runOnLast(1)
runOnChat(1)
#entity():setAlpha(0)
E=holoCreate(0)
holoPos(0,entity():toWorld(vec(0,0,50)))
holoColor(0,vec(27,27,33))
holoModel(0,"hqcylinder2")
holoScale(0,vec(0.6,0.6,0.8))
holoAng(0,entity():toWorld(ang(-90,180,0)))
#holoAlpha(-1,100)
Max=14#/2 for real gun count
Fr=360/Max
Mul=1.5
Fat=0.1
for(I=1,Max)
{
if(I%2==1){continue}
holoCreate(I/2)
holoModel(I/2,"hqcylinder2")
holoScale(I/2,vec(Fat,Fat,2.3))
holoPos(I/2,E:toWorld(vec(sin(Fr*I)*Mul,cos(Fr*I)*Mul,16)))#tune for length
holoAng(I/2,E:toWorld(ang()))
holoMaterial(I/2,"phoenix_storms/gear")
#phoenix_storms/gear i use 100,100,100 for color
holoColor(I/2,vec(100,100,100))
}
#-------------------------------
#spinning parts
#-------------------------------
#end cylinder spining mount
holoCreate(9)
holoModel(9,"hqcylinder2")
holoScale(9,vec(0.45,0.45,0.2))
holoPos(9,E:toWorld(vec(0,0,5)))
holoColor(9,vec(100,100,100))
holoAng(9,E:toWorld(ang()))
holoMaterial(9,"phoenix_storms/gear")
#start cylinder bullets
holoCreate(10)
holoModel(10,"hqcylinder2")
holoScale(10,vec(0.45,0.45,0.05))
holoPos(10,E:toWorld(vec(0,0,29)))
holoAng(10,E:toWorld(ang()))
holoMaterial(10,"phoenix_storms/gear")
holoColor(10,vec(100,100,100))
#2nd end
holoCreate(11)
holoModel(11,"hqcylinder2")
holoScale(11,vec(0.45,0.45,0.05))
holoPos(11,E:toWorld(vec(0,0,28)))
holoAng(11,E:toWorld(ang()))
holoMaterial(11,"phoenix_storms/gear")
holoColor(11,vec(100,100,100))
#3rd end
holoCreate(12)
holoModel(12,"hqcylinder2")
holoScale(12,vec(0.45,0.45,0.05))
holoPos(12,E:toWorld(vec(0,0,27)))
holoAng(12,E:toWorld(ang()))
holoMaterial(12,"phoenix_storms/gear")
holoColor(12,vec(100,100,100))
#4th fat
holoCreate(13)
holoModel(13,"hqcylinder2")
holoScale(13,vec(0.45,0.45,0.1))
holoPos(13,E:toWorld(vec(0,0,18)))
holoAng(13,E:toWorld(ang()))
holoMaterial(13,"phoenix_storms/gear")
holoColor(13,vec(100,100,100))
#shoot pos part
holoCreate(14)
holoPos(14,E:toWorld(vec(0,0,20)))
holoScale(14,vec(0.1,0.1,0.1))
holoAlpha(14,0)
holoAng(14,E:toWorld(ang(-90,0,0)))
#detail props
#-------------------------------
#non spining parts
#-------------------------------
#batery
holoCreate(15)
holoModel(15,"hqcylinder2")
holoScale(15,vec(0.2,0.2,0.3))
holoPos(15,E:toWorld(vec(-1,4,-2)))
holoColor(15,vec(27,27,33))
holoAng(15,E:toWorld(ang()))
#handhold 1
H1=holoCreate(16)
holoModel(16,"hqcylinder2")
holoScale(16,vec(0.2,0.2,0.4))
holoPos(16,E:toWorld(vec(2.3,0,-5.5)))
holoColor(16,vec(27,27,33))
holoAng(16,E:toWorld(ang()))
#handhold 2
H2=holoCreate(17)
holoModel(17,"hqcylinder2")
holoScale(17,vec(0.2,0.2,0.4))
holoPos(17,H1:toWorld(vec(2,0,-2.5)))
holoColor(17,vec(27,27,33))
holoAng(17,E:toWorld(ang(-100,0,0)))
#joint smoother
holoCreate(18)
holoModel(18,"hqicosphere2")
holoScale(18,vec(0.22,0.22,0.22))
holoPos(18,H2:toWorld(vec(0,0,2)))
holoColor(18,vec(27,27,33))
holoAng(18,E:toWorld(ang()))
#pad
holoCreate(19)
holoModel(19,"hqicosphere2")
holoScale(19,vec(0.2,0.2,0.1))
holoPos(19,H2:toWorld(vec(0,0,-2.2)))
holoColor(19,vec(27,27,33))
holoAng(19,H2:toWorld(ang(0,0,0)))
#big red btn!
holoCreate(20)
holoModel(20,"hqcylinder2")
holoScale(20,vec(0.05,0.05,0.05))
holoPos(20,H2:toWorld(vec(0,0,-2.9)))
holoColor(20,vec(255,0,0))
holoAng(20,H2:toWorld(ang(0,0,0)))
#base smoother back
holoCreate(21)
holoModel(21,"hqicosphere2")
holoScale(21,vec(0.61,0.61,0.2))
holoPos(21,E:toWorld(vec(0,0,-4.8)))
holoColor(21,vec(27,27,33))
holoAng(21,E:toWorld(ang()))
#trigger
holoCreate(22)
holoModel(22,"hqicosphere2")
holoScale(22,vec(0.1,0.1,0.2))
holoPos(22,H2:toWorld(vec(1,0,-0.8)))
holoColor(22,vec(255,255,255))
holoAng(22,H2:toWorld(ang(35,0,0)))
#bulet case emiter
holoCreate(23)
holoModel(23,"hqcylinder2")
holoScale(23,vec(0.15,0.15,0.3))
holoPos(23,E:toWorld(vec(sin(20)*3.2,cos(20)*3.2,0)))
holoAng(23,E:toWorld(ang(0,0,0)))
holoMaterial(23,"phoenix_storms/gear")
holoColor(23,vec(100,100,100))
holoCreate(24)
holoModel(24,"hqicosphere")
holoScale(24,vec(0.156,0.156,0.156))
holoPos(24,E:toWorld(vec(sin(20)*3.2,cos(20)*3.2,1.7)))
holoAng(24,E:toWorld(ang(0,0,0)))
holoMaterial(24,"phoenix_storms/gear")
holoColor(24,vec(100,100,100))
#base sent for position setting
Base=holoCreate(50)
holoPos(50,E:toWorld(vec(0,0,0)))
holoScale(50,vec(0.1,0.1,0.1))
holoAlpha(50,0)
#-------------------------------
#stand
#-------------------------------
Stand=holoCreate(25)
holoModel(25,"hqcylinder2")
holoScale(25,vec(0.2,0.2,2.8))
holoPos(25,Base:toWorld(vec(0,0,-20)))
holoAng(25,Base:toWorld(ang(0,0,0)))
holoMaterial(25,"phoenix_storms/gear")
holoColor(25,vec(100,100,100))
holoCreate(26)
holoModel(26,"hqcylinder2")
holoScale(26,vec(1,1,0.05))
holoPos(26,Stand:toWorld(vec(0,0,-16)))
holoAng(26,Stand:toWorld(ang(0,0,0)))
holoMaterial(26,"phoenix_storms/gear")
holoColor(26,vec(100,100,100))
holoCreate(27)
holoModel(27,"hqcone")
holoScale(27,vec(1,1,0.2))
holoPos(27,Stand:toWorld(vec(0,0,-15)))
holoAng(27,Stand:toWorld(ang(0,0,0)))
holoMaterial(27,"phoenix_storms/gear")
holoColor(27,vec(100,100,100))
#ammo box floor
holoCreate(28)
holoModel(28,"cube")
holoScale(28,vec(0.05,0.6,0.4))
holoPos(28,E:toWorld(vec(-2,-6,0)))
holoAng(28,E:toWorld(ang(0,0,0)))
holoMaterial(28,"phoenix_storms/gear")
holoColor(28,vec(100,100,100))
#ammo box front
holoCreate(29)
holoModel(29,"cube")
holoScale(29,vec(0.05,0.6,0.3))
holoPos(29,E:toWorld(vec(-0.5,-6,2.2)))
holoAng(29,E:toWorld(ang(90,0,0)))
holoMaterial(29,"phoenix_storms/gear")
holoColor(29,vec(100,100,100))
#ammo box back
holoCreate(30)
holoModel(30,"cube")
holoScale(30,vec(0.05,0.6,0.3))
holoPos(30,E:toWorld(vec(-0.5,-6,-2.2)))
holoAng(30,E:toWorld(ang(90,0,0)))
holoMaterial(30,"phoenix_storms/gear")
holoColor(30,vec(100,100,100))
#ammo box side
holoCreate(31)
holoModel(31,"cube")
holoScale(31,vec(0.4,0.05,0.3))
holoPos(31,E:toWorld(vec(-0.5,-9.4,0)))
holoAng(31,E:toWorld(ang(90,0,0)))
holoMaterial(31,"phoenix_storms/gear")
holoColor(31,vec(100,100,100))
#ammo box top
holoCreate(32)
holoModel(32,"cube")
holoScale(32,vec(0.05,0.25,0.4))
holoPos(32,E:toWorld(vec(1,-8,0)))
holoAng(32,E:toWorld(ang(0,0,0)))
holoMaterial(32,"phoenix_storms/gear")
holoColor(32,vec(100,100,100))
#ammo wheel hax
Wheel=holoCreate(33)
holoModel(33,"hqcylinder2")
holoScale(33,vec(0.3,0.3,0.2))
holoPos(33,E:toWorld(vec(-0,-4,0)))
holoAng(33,E:toWorld(ang(0,0,0)))
holoMaterial(33,"phoenix_storms/gear")
holoColor(33,vec4(100,100,100,0))
#ammo
for(I=1,14)
{
#if(I%2==1){continue}
RI=33+I
Mul=1.7
MMul=(360/14)*I
holoCreate(RI)
holoModel(RI,"hqcylinder2")
holoScale(RI,vec(0.08,0.08,0.3))
holoPos(RI,Wheel:toWorld(vec(sin(MMul)*Mul,cos(MMul)*Mul,0)))
holoAng(RI,Wheel:toWorld(ang(0,0,0)))
holoColor(RI,vec(43,39,3))
holoParent(RI,33)
}
holoCreate(48)
holoModel(48,"hqcylinder2")
holoScale(48,vec(0.08,0.08,0.3))
holoPos(48,Wheel:toWorld(vec(0.6,-2,0)))
holoAng(48,Wheel:toWorld(ang(0,0,0)))
holoColor(48,vec(43,39,3))
holoParent(48,50)
holoCreate(49)
holoModel(49,"hqcylinder2")
holoScale(49,vec(0.08,0.08,0.3))
holoPos(49,Wheel:toWorld(vec(0.3,-2.5,0)))
holoAng(49,Wheel:toWorld(ang(0,0,0)))
holoColor(49,vec(43,39,3))
holoParent(49,50)
#parent hierarchy
for(I=1,13){if(I==9){continue} holoParent(I,9)}
holoParent(9,0)
for(I=14,24){holoParent(I,50)}
for(I=28,33){holoParent(I,50)}
holoParent(0,50)
holoParent(14,50)
#holoParent(50,entity())
holoParent(50,25)
for(I=26,27){holoParent(I,25)}
AttachedToPod=1
#-------------------------------
#/stand
#-------------------------------
#-------------------------------
#turret adition TF2 minigun style
#-------------------------------
#holoCreate(28)
#holoModel(28,"dome2")
#holoScale(28,vec(0.6,0.6,1))
#holoPos(28,E:toWorld(vec(0,0,33)))
#holoAng(28,E:toWorld(ang(180,0,0)))
#holoMaterial(28,"phoenix_storms/gear")
#holoColor(28,vec(100,100,100))
On=1
Operator=owner()
#
##-------------------------------
# #experimental handhold
##-------------------------------
#
#On=0
#O=Operator()
#Base=holoEntity(50)
#holoPos(50,O:attachmentPos("anim_attachment_RH"))
#holoPos(50,Base:toWorld(vec(-10,0,0)))
#holoAng(50,O:eyeAngles()*ang(1,1,0))
#holoParent(50,Operator())
for(I=1,0)
{
#Disposed:pushEntity(propspawn))
}
}
#-------------------------------
#define keys
#-------------------------------
O=Operator
Fire=O:keyAttack1()&On&((holoEntity(27):pos()-Operator:pos()):length()<100)&AttachedToPod
Spin=O:keyAttack2()&On&((holoEntity(27):pos()-Operator:pos()):length()<100)&AttachedToPod
Use=O:keyUse()&((holoEntity(50):pos()-Operator:pos()):length()<100)&AttachedToPod
if(changed(Use)&Use&UseEnable){On=!On print("On: "+On)}#chat
if(changed(Use)&Use&O:keyAttack2()){On=!On print("On: "+On)}#no chat
#-------------------------------
#positiom minigun
#-------------------------------
if(On&((holoEntity(27):pos()-Operator:pos()):length()<100)&AttachedToPod&!Target){holoAng(50,(Operator:aimPos()-holoEntity(50):pos()):toAngle())}
elseif(On&((holoEntity(27):pos()-Operator:pos()):length()<100)&AttachedToPod&Target){holoAng(50,((Target:pos()+vec(0,0,50))-holoEntity(50):pos()):toAngle())}
#-------------------------------
#spin+spin velocity
#-------------------------------
if(Spin|Vel>0)
{
if(Spin|Fire){Vel+=(Fire ? 2 : 1)}
if(!Spin&!Fire){Vel-=0.5 }
Vel=clamp(Vel,0,30)
if(Spin){Ang+=Vel}
elseif(Vel>0){Ang+=Vel}
if(Ang>180){Ang=-180}
Ang=angnorm(Ang)
holoAng(9,holoEntity(0):toWorld(ang(0,Ang,0)))
}
else
{
Vel-=0.5
Vel=clamp(Vel,0,30)
}
#-------------------------------
#FIRE!
#-------------------------------
if(Fire&(Spin|Vel>0))
{
for(I=1,clamp(Vel/2,1,15))
{
H=holoEntity(50)
H:shootTo(H:forward(),0,100,100)
}
#CanFire=!CanFire
if(CanFire|1)
{
propSpawnEffect(0)
Ar=propSpawn("models/weapons/shells/shell_sniperrifle.mdl",holoEntity(0):toWorld(vec(sin(20)*4,cos(20)*4,1)),holoEntity(0):toWorld(ang(90,0,0)),0)
Ar:applyForce((Ar:toWorld(vec(0,10,-3))-Ar:pos())*15)
Bulets:pushEntity(Ar)
DieTime:pushNumber(curtime()+3)#time before bullet dies
}
AngFire+=Vel
AngFire=angnorm(AngFire)
holoAng(33,holoEntity(0):toWorld(ang(0,AngFire,0)))
}
#-------------------------------
#dispose of bullet shells
#-------------------------------
if(Bulets:count()>5)
{
for(I=1,Bulets:count())
{
if(I>Bulets:count()-5){break}#at least 5 shells must be left!
Bul=Bulets[I,entity]
Time=DieTime[I,number]
if(!Bul)
{
Bulets:remove(I)
DieTime:remove(I)
I-=1
}
if(Time<curtime()&Bul)
{
Bul:propDelete()
Bulets:remove(I)
DieTime:remove(I)
I-=1
}
if(maxquota()<100){print("ops run out D:") break}
}
}
#-------------------------------
#chat controll of pos. stuff
#-------------------------------
if(chatClk(Operator))
{
Ls=Operator:lastSaid()
if(Ls=="use")
{
UseEnable=!UseEnable
print("Use enabled: "+UseEnable)
hideChat(1)
}
elseif(Ls=="deat")#deattach
{
if((holoEntity(50):pos()-Operator:pos()):length()<100&AttachedToPod)
{
On=0
holoUnparent(50)
AttachedToPod=0
holoAng(50,Operator:toWorld(ang(-55,82,0)))
holoPos(50,Operator:toWorld(vec(-10,0,43)))
holoParent(50,Operator)
print("gun deattached")
}
elseif(!AttachedToPod)
{
print("you are allready carrying the minigun!")
}
else
{
print("failed to deattach, you are too far away")
}
hideChat(1)
}
elseif(Ls=="att")#attach to stand
{
Stand=holoEntity(25)
if((Stand:pos()-Operator:pos()):length()<100&!AttachedToPod)
{
On=1
holoUnparent(50)
AttachedToPod=1
#holoAng(50,holoEntity(25):toWorld(ang(-55,82,0)))
holoPos(50,Stand:toWorld(vec(0,0,20)))
holoParent(50,25)
print("gun attached")
}
elseif(AttachedToPod)
{
print("you are allready attached to stand!")
}
else
{
print("failed to attach, you are too far away")
}
hideChat(1)
}
elseif(Ls=="dep")#deploy stand
{
if(!AttachedToPod&(Operator:aimPos()-Operator:pos()):length()<100)
{
On=1
holoPos(25,Operator:aimPos()+vec(0,0,18))
holoUnparent(25)
holoAng(25,ang())
#ranger trace
if(owner():aimEntity()){holoParent(25,owner():aimEntity())}
print("stand deployed")
}
elseif(AttachedToPod)
{
print("you are allready attached and deployed!!")
}
else
{
print("failed to deploy, too far away")
}
hideChat(1)
}
elseif(Ls:sub(0,3)=="tar")
{
Args=Ls:explode(" ")
Target=findPlayerByName(Args[2,string])
if(Target){print("New target: "+Target:name())}
hideChat(1)
}
elseif(Ls=="notar")
{
Target=noentity()
hideChat(1)
}
}
if(chatClk(owner()))
{
Args=owner():lastSaid():explode(" ")
if(Args[1,string]=="give")
{
Operator=findPlayerByName(Args[2,string])
if(Operator){print("New operator:"+Operator:name())}
else{print("fail, set to you") Operator=owner()}
hideChat(1)
}
}
#-------------------------------
#numpad ctrl for above
#-------------------------------
if((~Num1&Num1)|(~Num2&Num2)|(~Num3&Num3)|(~NumEnt&NumEnt))
{
if(Operator!=owner()){print("sorry, but you are not in controll of the minigun at the moment!") exit()}
if(NumEnt)
{
UseEnable=!UseEnable
print("Use enabled: "+UseEnable)
}
if(Num1)
{
if((holoEntity(50):pos()-Operator:pos()):length()<100&AttachedToPod)
{
On=0
holoUnparent(50)
AttachedToPod=0
holoAng(50,Operator:toWorld(ang(-55,82,0)))
holoPos(50,Operator:toWorld(vec(-10,0,43)))
holoParent(50,Operator)
print("gun deattached")
}
elseif(!AttachedToPod)
{
print("you are allready carrieing the minigun!")
}
else
{
print("failed to deattach, you are too far away")
}
}
if(Num3)
{
Stand=holoEntity(25)
if((Stand:pos()-Operator:pos()):length()<100&!AttachedToPod)
{
On=1
holoUnparent(50)
AttachedToPod=1
#holoAng(50,holoEntity(25):toWorld(ang(-55,82,0)))
holoPos(50,Stand:toWorld(vec(0,0,20)))
holoParent(50,25)
print("gun attached")
}
elseif(AttachedToPod)
{
print("you are allready attached to stand!")
}
else
{
print("failed to attach, you are too far away")
}
}
if(Num2)
{
if(!AttachedToPod&(Operator:aimPos()-Operator:pos()):length()<100)
{
On=1
holoUnparent(50)
holoPos(25,Operator:aimPos()+vec(0,0,18))
holoParent(50,25)
holoUnparent(25)
if(owner():aimEntity()){holoParent(25,owner():aimEntity())}
print("stand deployed")
}
elseif(AttachedToPod)
{
print("you are allready attached and deployed!!")
}
else
{
print("failed to deploy, too far away")
}
}
}
#-------------------------------
#sounds
#-------------------------------
if(Vel>0&!SoundSpin){holoEntity(0):soundPlay(5,0,"ambient/machines/lab_loop1.wav") SoundSpin=1}
if(Vel<=0&SoundSpin){SoundSpin=0 soundStop(5)}
if(!Fire&SoundFire){soundStop(6) SoundFire=0}
if(SoundSpin)
{
soundPitch(5,(63*Vel))
soundVolume(5,(63*Vel)/3000)
}
if(Fire&(Spin|Vel>0))
{
# soundPlay(1,1,"weapons/ar2/fire1.wav")
# soundPlay(2,1,"weapons/smg1/smg1_fire1.wav")
#soundPlay(3,1,"weapons/pistol/pistol_fire2.wav")
# soundPlay(4,1,"weapons/shotgun/shotgun_fire6.wav")
# for(I=1,4){soundVolume(I,0.3)}
holoEntity(0):soundPlay(6,0,"arty/25mm.wav")
SoundFire=1
}
#-------------------------------
#target sorter
#-------------------------------
if(Target&Target:health()<=0){print("target down") Target=noentity()}
#-------------------------------
#END OF CODE
#-------------------------------
Here is the non E:shootTo version, uses a turret. Hook a entity marker to a turret, and wire the Fire to Firee on the E2. Then the turret entity to E2 turret input. Make it invisible. Have fun!
Code:
@name minigun
@inputs Num1 Num2 Num3 NumEnt Turr:entity
@outputs CanFire AttachedToPod UseEnable Fire Spin Use On Vel SoundSpin SoundFire Operator:entity Target:entity Firee
@persist Ang AngFire [Bulets DieTime Disposed]:array
@trigger
@model models/hunter/blocks/cube025x025x025.mdl
interval(100)
Firee=0
if(last()&Bulets:count()>0)
{
for(I=1,Bulets:count())
{
Bulets[I,entity]:propDelete()
}
}
E=entity()
if(first())
{
runOnLast(1)
runOnChat(1)
#entity():setAlpha(0)
E=holoCreate(0)
holoPos(0,entity():toWorld(vec(0,0,50)))
holoColor(0,vec(27,27,33))
holoModel(0,"hqcylinder2")
holoScale(0,vec(0.6,0.6,0.8))
holoAng(0,entity():toWorld(ang(-90,180,0)))
#holoAlpha(-1,100)
Max=14#/2 for real gun count
Fr=360/Max
Mul=1.5
Fat=0.1
for(I=1,Max)
{
if(I%2==1){continue}
holoCreate(I/2)
holoModel(I/2,"hqcylinder2")
holoScale(I/2,vec(Fat,Fat,2.3))
holoPos(I/2,E:toWorld(vec(sin(Fr*I)*Mul,cos(Fr*I)*Mul,16)))#tune for length
holoAng(I/2,E:toWorld(ang()))
holoMaterial(I/2,"phoenix_storms/gear")
#phoenix_storms/gear i use 100,100,100 for color
holoColor(I/2,vec(100,100,100))
}
#-------------------------------
#spinning parts
#-------------------------------
#end cylinder spining mount
holoCreate(9)
holoModel(9,"hqcylinder2")
holoScale(9,vec(0.45,0.45,0.2))
holoPos(9,E:toWorld(vec(0,0,5)))
holoColor(9,vec(100,100,100))
holoAng(9,E:toWorld(ang()))
holoMaterial(9,"phoenix_storms/gear")
#start cylinder bullets
holoCreate(10)
holoModel(10,"hqcylinder2")
holoScale(10,vec(0.45,0.45,0.05))
holoPos(10,E:toWorld(vec(0,0,29)))
holoAng(10,E:toWorld(ang()))
holoMaterial(10,"phoenix_storms/gear")
holoColor(10,vec(100,100,100))
#2nd end
holoCreate(11)
holoModel(11,"hqcylinder2")
holoScale(11,vec(0.45,0.45,0.05))
holoPos(11,E:toWorld(vec(0,0,28)))
holoAng(11,E:toWorld(ang()))
holoMaterial(11,"phoenix_storms/gear")
holoColor(11,vec(100,100,100))
#3rd end
holoCreate(12)
holoModel(12,"hqcylinder2")
holoScale(12,vec(0.45,0.45,0.05))
holoPos(12,E:toWorld(vec(0,0,27)))
holoAng(12,E:toWorld(ang()))
holoMaterial(12,"phoenix_storms/gear")
holoColor(12,vec(100,100,100))
#4th fat
holoCreate(13)
holoModel(13,"hqcylinder2")
holoScale(13,vec(0.45,0.45,0.1))
holoPos(13,E:toWorld(vec(0,0,18)))
holoAng(13,E:toWorld(ang()))
holoMaterial(13,"phoenix_storms/gear")
holoColor(13,vec(100,100,100))
#shoot pos part
holoCreate(14)
holoPos(14,E:toWorld(vec(0,0,20)))
holoScale(14,vec(0.1,0.1,0.1))
holoAlpha(14,0)
holoAng(14,E:toWorld(ang(-90,0,0)))
#detail props
#-------------------------------
#non spining parts
#-------------------------------
#batery
holoCreate(15)
holoModel(15,"hqcylinder2")
holoScale(15,vec(0.2,0.2,0.3))
holoPos(15,E:toWorld(vec(-1,4,-2)))
holoColor(15,vec(27,27,33))
holoAng(15,E:toWorld(ang()))
#handhold 1
H1=holoCreate(16)
holoModel(16,"hqcylinder2")
holoScale(16,vec(0.2,0.2,0.4))
holoPos(16,E:toWorld(vec(2.3,0,-5.5)))
holoColor(16,vec(27,27,33))
holoAng(16,E:toWorld(ang()))
#handhold 2
H2=holoCreate(17)
holoModel(17,"hqcylinder2")
holoScale(17,vec(0.2,0.2,0.4))
holoPos(17,H1:toWorld(vec(2,0,-2.5)))
holoColor(17,vec(27,27,33))
holoAng(17,E:toWorld(ang(-100,0,0)))
#joint smoother
holoCreate(18)
holoModel(18,"hqicosphere2")
holoScale(18,vec(0.22,0.22,0.22))
holoPos(18,H2:toWorld(vec(0,0,2)))
holoColor(18,vec(27,27,33))
holoAng(18,E:toWorld(ang()))
#pad
holoCreate(19)
holoModel(19,"hqicosphere2")
holoScale(19,vec(0.2,0.2,0.1))
holoPos(19,H2:toWorld(vec(0,0,-2.2)))
holoColor(19,vec(27,27,33))
holoAng(19,H2:toWorld(ang(0,0,0)))
#big red btn!
holoCreate(20)
holoModel(20,"hqcylinder2")
holoScale(20,vec(0.05,0.05,0.05))
holoPos(20,H2:toWorld(vec(0,0,-2.9)))
holoColor(20,vec(255,0,0))
holoAng(20,H2:toWorld(ang(0,0,0)))
#base smoother back
holoCreate(21)
holoModel(21,"hqicosphere2")
holoScale(21,vec(0.61,0.61,0.2))
holoPos(21,E:toWorld(vec(0,0,-4.8)))
holoColor(21,vec(27,27,33))
holoAng(21,E:toWorld(ang()))
#trigger
holoCreate(22)
holoModel(22,"hqicosphere2")
holoScale(22,vec(0.1,0.1,0.2))
holoPos(22,H2:toWorld(vec(1,0,-0.8)))
holoColor(22,vec(255,255,255))
holoAng(22,H2:toWorld(ang(35,0,0)))
#bulet case emiter
holoCreate(23)
holoModel(23,"hqcylinder2")
holoScale(23,vec(0.15,0.15,0.3))
holoPos(23,E:toWorld(vec(sin(20)*3.2,cos(20)*3.2,0)))
holoAng(23,E:toWorld(ang(0,0,0)))
holoMaterial(23,"phoenix_storms/gear")
holoColor(23,vec(100,100,100))
holoCreate(24)
holoModel(24,"hqicosphere")
holoScale(24,vec(0.156,0.156,0.156))
holoPos(24,E:toWorld(vec(sin(20)*3.2,cos(20)*3.2,1.7)))
holoAng(24,E:toWorld(ang(0,0,0)))
holoMaterial(24,"phoenix_storms/gear")
holoColor(24,vec(100,100,100))
#base sent for position setting
Base=holoCreate(50)
holoPos(50,E:toWorld(vec(0,0,0)))
holoScale(50,vec(0.1,0.1,0.1))
holoAlpha(50,0)
#-------------------------------
#stand
#-------------------------------
Stand=holoCreate(25)
holoModel(25,"hqcylinder2")
holoScale(25,vec(0.2,0.2,2.8))
holoPos(25,Base:toWorld(vec(0,0,-20)))
holoAng(25,Base:toWorld(ang(0,0,0)))
holoMaterial(25,"phoenix_storms/gear")
holoColor(25,vec(100,100,100))
holoCreate(26)
holoModel(26,"hqcylinder2")
holoScale(26,vec(1,1,0.05))
holoPos(26,Stand:toWorld(vec(0,0,-16)))
holoAng(26,Stand:toWorld(ang(0,0,0)))
holoMaterial(26,"phoenix_storms/gear")
holoColor(26,vec(100,100,100))
holoCreate(27)
holoModel(27,"hqcone")
holoScale(27,vec(1,1,0.2))
holoPos(27,Stand:toWorld(vec(0,0,-15)))
holoAng(27,Stand:toWorld(ang(0,0,0)))
holoMaterial(27,"phoenix_storms/gear")
holoColor(27,vec(100,100,100))
#ammo box floor
holoCreate(28)
holoModel(28,"cube")
holoScale(28,vec(0.05,0.6,0.4))
holoPos(28,E:toWorld(vec(-2,-6,0)))
holoAng(28,E:toWorld(ang(0,0,0)))
holoMaterial(28,"phoenix_storms/gear")
holoColor(28,vec(100,100,100))
#ammo box front
holoCreate(29)
holoModel(29,"cube")
holoScale(29,vec(0.05,0.6,0.3))
holoPos(29,E:toWorld(vec(-0.5,-6,2.2)))
holoAng(29,E:toWorld(ang(90,0,0)))
holoMaterial(29,"phoenix_storms/gear")
holoColor(29,vec(100,100,100))
#ammo box back
holoCreate(30)
holoModel(30,"cube")
holoScale(30,vec(0.05,0.6,0.3))
holoPos(30,E:toWorld(vec(-0.5,-6,-2.2)))
holoAng(30,E:toWorld(ang(90,0,0)))
holoMaterial(30,"phoenix_storms/gear")
holoColor(30,vec(100,100,100))
#ammo box side
holoCreate(31)
holoModel(31,"cube")
holoScale(31,vec(0.4,0.05,0.3))
holoPos(31,E:toWorld(vec(-0.5,-9.4,0)))
holoAng(31,E:toWorld(ang(90,0,0)))
holoMaterial(31,"phoenix_storms/gear")
holoColor(31,vec(100,100,100))
#ammo box top
holoCreate(32)
holoModel(32,"cube")
holoScale(32,vec(0.05,0.25,0.4))
holoPos(32,E:toWorld(vec(1,-8,0)))
holoAng(32,E:toWorld(ang(0,0,0)))
holoMaterial(32,"phoenix_storms/gear")
holoColor(32,vec(100,100,100))
#ammo wheel hax
Wheel=holoCreate(33)
holoModel(33,"hqcylinder2")
holoScale(33,vec(0.3,0.3,0.2))
holoPos(33,E:toWorld(vec(-0,-4,0)))
holoAng(33,E:toWorld(ang(0,0,0)))
holoMaterial(33,"phoenix_storms/gear")
holoColor(33,vec4(100,100,100,0))
#ammo
for(I=1,14)
{
#if(I%2==1){continue}
RI=33+I
Mul=1.7
MMul=(360/14)*I
holoCreate(RI)
holoModel(RI,"hqcylinder2")
holoScale(RI,vec(0.08,0.08,0.3))
holoPos(RI,Wheel:toWorld(vec(sin(MMul)*Mul,cos(MMul)*Mul,0)))
holoAng(RI,Wheel:toWorld(ang(0,0,0)))
holoColor(RI,vec(43,39,3))
holoParent(RI,33)
}
holoCreate(48)
holoModel(48,"hqcylinder2")
holoScale(48,vec(0.08,0.08,0.3))
holoPos(48,Wheel:toWorld(vec(0.6,-2,0)))
holoAng(48,Wheel:toWorld(ang(0,0,0)))
holoColor(48,vec(43,39,3))
holoParent(48,50)
holoCreate(49)
holoModel(49,"hqcylinder2")
holoScale(49,vec(0.08,0.08,0.3))
holoPos(49,Wheel:toWorld(vec(0.3,-2.5,0)))
holoAng(49,Wheel:toWorld(ang(0,0,0)))
holoColor(49,vec(43,39,3))
holoParent(49,50)
#parent hierarchy
for(I=1,13){if(I==9){continue} holoParent(I,9)}
holoParent(9,0)
for(I=14,24){holoParent(I,50)}
for(I=28,33){holoParent(I,50)}
holoParent(0,50)
holoParent(14,50)
#holoParent(50,entity())
holoParent(50,25)
for(I=26,27){holoParent(I,25)}
AttachedToPod=1
#-------------------------------
#/stand
#-------------------------------
#-------------------------------
#turret adition TF2 minigun style
#-------------------------------
#holoCreate(28)
#holoModel(28,"dome2")
#holoScale(28,vec(0.6,0.6,1))
#holoPos(28,E:toWorld(vec(0,0,33)))
#holoAng(28,E:toWorld(ang(180,0,0)))
#holoMaterial(28,"phoenix_storms/gear")
#holoColor(28,vec(100,100,100))
On=1
Operator=owner()
#
##-------------------------------
# #experimental handhold
##-------------------------------
#
#On=0
#O=Operator()
#Base=holoEntity(50)
#holoPos(50,O:attachmentPos("anim_attachment_RH"))
#holoPos(50,Base:toWorld(vec(-10,0,0)))
#holoAng(50,O:eyeAngles()*ang(1,1,0))
#holoParent(50,Operator())
for(I=1,0)
{
#Disposed:pushEntity(propspawn))
}
}
#-------------------------------
#define keys
#-------------------------------
O=Operator
Fire=O:keyAttack1()&On&((holoEntity(27):pos()-Operator:pos()):length()<100)&AttachedToPod
Spin=O:keyAttack2()&On&((holoEntity(27):pos()-Operator:pos()):length()<100)&AttachedToPod
Use=O:keyUse()&((holoEntity(50):pos()-Operator:pos()):length()<100)&AttachedToPod
if(changed(Use)&Use&UseEnable){On=!On print("On: "+On)}#chat
if(changed(Use)&Use&O:keyAttack2()){On=!On print("On: "+On)}#no chat
#-------------------------------
#positiom minigun
#-------------------------------
if(On&((holoEntity(27):pos()-Operator:pos()):length()<100)&AttachedToPod&!Target){holoAng(50,(Operator:aimPos()-holoEntity(50):pos()):toAngle())}
elseif(On&((holoEntity(27):pos()-Operator:pos()):length()<100)&AttachedToPod&Target){holoAng(50,((Target:pos()+vec(0,0,50))-holoEntity(50):pos()):toAngle())}
#-------------------------------
#spin+spin velocity
#-------------------------------
if(Spin|Vel>0)
{
if(Spin|Fire){Vel+=(Fire ? 2 : 1)}
if(!Spin&!Fire){Vel-=0.5 }
Vel=clamp(Vel,0,30)
if(Spin){Ang+=Vel}
elseif(Vel>0){Ang+=Vel}
if(Ang>180){Ang=-180}
Ang=angnorm(Ang)
holoAng(9,holoEntity(0):toWorld(ang(0,Ang,0)))
}
else
{
Vel-=0.5
Vel=clamp(Vel,0,30)
}
#-------------------------------
#FIRE!
#-------------------------------
if(Fire&(Spin|Vel>0))
{
H=holoEntity(50)
Turr:setPos(H:pos())
Turr:setAng(H:angles())
Firee=1
if(CanFire|1)
{
propSpawnEffect(0)
Ar=propSpawn("models/weapons/shells/shell_sniperrifle.mdl",holoEntity(0):toWorld(vec(sin(20)*4,cos(20)*4,1)),holoEntity(0):toWorld(ang(90,0,0)),0)
Ar:applyForce((Ar:toWorld(vec(0,10,-3))-Ar:pos())*15)
Bulets:pushEntity(Ar)
DieTime:pushNumber(curtime()+3)#time before bullet dies
}
AngFire+=Vel
AngFire=angnorm(AngFire)
holoAng(33,holoEntity(0):toWorld(ang(0,AngFire,0)))
}
#-------------------------------
#dispose of bullet shells
#-------------------------------
if(Bulets:count()>5)
{
for(I=1,Bulets:count())
{
if(I>Bulets:count()-5){break}#at least 5 shells must be left!
Bul=Bulets[I,entity]
Time=DieTime[I,number]
if(!Bul)
{
Bulets:remove(I)
DieTime:remove(I)
I-=1
}
if(Time<curtime()&Bul)
{
Bul:propDelete()
Bulets:remove(I)
DieTime:remove(I)
I-=1
}
if(maxquota()<100){print("ops run out D:") break}
}
}
#-------------------------------
#chat controll of pos. stuff
#-------------------------------
if(chatClk(Operator))
{
Ls=Operator:lastSaid()
if(Ls=="use")
{
UseEnable=!UseEnable
print("Use enabled: "+UseEnable)
hideChat(1)
}
elseif(Ls=="deat")#deattach
{
if((holoEntity(50):pos()-Operator:pos()):length()<100&AttachedToPod)
{
On=0
holoUnparent(50)
AttachedToPod=0
holoAng(50,Operator:toWorld(ang(-55,82,0)))
holoPos(50,Operator:toWorld(vec(-10,0,43)))
holoParent(50,Operator)
print("gun deattached")
}
elseif(!AttachedToPod)
{
print("you are allready carrying the minigun!")
}
else
{
print("failed to deattach, you are too far away")
}
hideChat(1)
}
elseif(Ls=="att")#attach to stand
{
Stand=holoEntity(25)
if((Stand:pos()-Operator:pos()):length()<100&!AttachedToPod)
{
On=1
holoUnparent(50)
AttachedToPod=1
#holoAng(50,holoEntity(25):toWorld(ang(-55,82,0)))
holoPos(50,Stand:toWorld(vec(0,0,20)))
holoParent(50,25)
print("gun attached")
}
elseif(AttachedToPod)
{
print("you are allready attached to stand!")
}
else
{
print("failed to attach, you are too far away")
}
hideChat(1)
}
elseif(Ls=="dep")#deploy stand
{
if(!AttachedToPod&(Operator:aimPos()-Operator:pos()):length()<100)
{
On=1
holoPos(25,Operator:aimPos()+vec(0,0,18))
holoUnparent(25)
holoAng(25,ang())
#ranger trace
if(owner():aimEntity()){holoParent(25,owner():aimEntity())}
print("stand deployed")
}
elseif(AttachedToPod)
{
print("you are allready attached and deployed!!")
}
else
{
print("failed to deploy, too far away")
}
hideChat(1)
}
elseif(Ls:sub(0,3)=="tar")
{
Args=Ls:explode(" ")
Target=findPlayerByName(Args[2,string])
if(Target){print("New target: "+Target:name())}
hideChat(1)
}
elseif(Ls=="notar")
{
Target=noentity()
hideChat(1)
}
}
if(chatClk(owner()))
{
Args=owner():lastSaid():explode(" ")
if(Args[1,string]=="give")
{
Operator=findPlayerByName(Args[2,string])
if(Operator){print("New operator:"+Operator:name())}
else{print("fail, set to you") Operator=owner()}
hideChat(1)
}
}
#-------------------------------
#numpad ctrl for above
#-------------------------------
if((~Num1&Num1)|(~Num2&Num2)|(~Num3&Num3)|(~NumEnt&NumEnt))
{
if(Operator!=owner()){print("sorry, but you are not in controll of the minigun at the moment!") exit()}
if(NumEnt)
{
UseEnable=!UseEnable
print("Use enabled: "+UseEnable)
}
if(Num1)
{
if((holoEntity(50):pos()-Operator:pos()):length()<100&AttachedToPod)
{
On=0
holoUnparent(50)
AttachedToPod=0
holoAng(50,Operator:toWorld(ang(-55,82,0)))
holoPos(50,Operator:toWorld(vec(-10,0,43)))
holoParent(50,Operator)
print("gun deattached")
}
elseif(!AttachedToPod)
{
print("you are allready carrieing the minigun!")
}
else
{
print("failed to deattach, you are too far away")
}
}
if(Num3)
{
Stand=holoEntity(25)
if((Stand:pos()-Operator:pos()):length()<100&!AttachedToPod)
{
On=1
holoUnparent(50)
AttachedToPod=1
#holoAng(50,holoEntity(25):toWorld(ang(-55,82,0)))
holoPos(50,Stand:toWorld(vec(0,0,20)))
holoParent(50,25)
print("gun attached")
}
elseif(AttachedToPod)
{
print("you are allready attached to stand!")
}
else
{
print("failed to attach, you are too far away")
}
}
if(Num2)
{
if(!AttachedToPod&(Operator:aimPos()-Operator:pos()):length()<100)
{
On=1
holoUnparent(50)
holoPos(25,Operator:aimPos()+vec(0,0,18))
holoParent(50,25)
holoUnparent(25)
if(owner():aimEntity()){holoParent(25,owner():aimEntity())}
print("stand deployed")
}
elseif(AttachedToPod)
{
print("you are allready attached and deployed!!")
}
else
{
print("failed to deploy, too far away")
}
}
}
#-------------------------------
#sounds
#-------------------------------
if(Vel>0&!SoundSpin){holoEntity(0):soundPlay(5,0,"ambient/machines/lab_loop1.wav") SoundSpin=1}
if(Vel<=0&SoundSpin){SoundSpin=0 soundStop(5)}
if(!Fire&SoundFire){soundStop(6) SoundFire=0}
if(SoundSpin)
{
soundPitch(5,(63*Vel))
soundVolume(5,(63*Vel)/3000)
}
if(Fire&(Spin|Vel>0))
{
# soundPlay(1,1,"weapons/ar2/fire1.wav")
# soundPlay(2,1,"weapons/smg1/smg1_fire1.wav")
#soundPlay(3,1,"weapons/pistol/pistol_fire2.wav")
# soundPlay(4,1,"weapons/shotgun/shotgun_fire6.wav")
# for(I=1,4){soundVolume(I,0.3)}
holoEntity(0):soundPlay(6,0,"arty/25mm.wav")
SoundFire=1
}
#-------------------------------
#target sorter
#-------------------------------
if(Target&Target:health()<=0){print("target down") Target=noentity()}
#-------------------------------
#END OF CODE
#-------------------------------
Bookmarks