Author |
Message |
NeoSeeker
Joined: Tue Jul 24, 2007 1:13 am Posts: 1183 Location: eating sock's face like a cupcake
|
Changing ParticleSpreadRange with pie menu firing mode
In simple terms i want to make a shotgun that can be changed through the pie menu from firing normal buckshot to flechette/slug rounds.
It's a pretty simple thing to do except to make flechette or slug rounds viable i'd need to be able to change the ParticleSpreadRange of the shotgun so the alt fire, the singular slug or flechette rounds, more accurate. how do i go about changing a weapon's ParticleSpreadRange along with the ammo using the pie menu?
|
Mon Sep 19, 2011 1:03 pm |
|
|
Kettenkrad
Joined: Mon Oct 25, 2010 5:51 am Posts: 1198 Location: Sydney
|
Re: Changing ParticleSpreadRange with pie menu firing mode
I'd have each mag fire an emitter with a different spread value for the emissions. You can also have variable pellet velocities and shiny smoke effects this way too.
|
Mon Sep 19, 2011 1:12 pm |
|
|
Grif
REAL AMERICAN HERO
Joined: Sat Jan 27, 2007 10:25 pm Posts: 5655
|
Re: Changing ParticleSpreadRange with pie menu firing mode
You get much more control if you entirely fake the actual bullet firing with .lua. It's a much better spackle and gives you more freedom overall.
|
Tue Sep 20, 2011 10:48 am |
|
|
Awesomeness
Joined: Sat Jun 19, 2010 5:02 pm Posts: 331 Location: Mekkan
|
Re: Changing ParticleSpreadRange with pie menu firing mode
Just a few suggestions to help you with making a Lua gun: Code: HeldDevice.MuzzlePos --The position of the muzzle
HeldDevice:RotateOffset(Vector(20,0)) --RotateOffset gives you the point in this case 20 pixels away --relative to the muzzle. So if the gun is pointing straight right --it gives you the vector (20,0), straight up would give (0,-20), etc
Vector:DegRotate(x) --Rotates a vector in degrees by x. So you --can make this a random small number for spread
|
Wed Sep 21, 2011 3:32 am |
|
|
CaveCricket48
Joined: Tue Jun 12, 2007 11:52 pm Posts: 13144 Location: Here
|
Re: Changing ParticleSpreadRange with pie menu firing mode
Most of the angles in CC are returned as radians (aim angle, AngularVel, RotAngle), so it's best to work with radians than degrees (RadRotate instead of DegRotate) so you don't have to worry about conversions.
|
Wed Sep 21, 2011 11:25 am |
|
|
Awesomeness
Joined: Sat Jun 19, 2010 5:02 pm Posts: 331 Location: Mekkan
|
Re: Changing ParticleSpreadRange with pie menu firing mode
Yeah... But just to make a plain gun with Lua I don't think you need radians at all.
|
Wed Sep 21, 2011 12:35 pm |
|
|
CaveCricket48
Joined: Tue Jun 12, 2007 11:52 pm Posts: 13144 Location: Here
|
Re: Changing ParticleSpreadRange with pie menu firing mode
Actually, you probably do. If you want the projectiles to rotate in relation to the gun, you'd have to grab the angle of the gun or the aim angle of the actor holding the gun, and both of those are stored as radians.
|
Wed Sep 21, 2011 1:08 pm |
|
|
Grif
REAL AMERICAN HERO
Joined: Sat Jan 27, 2007 10:25 pm Posts: 5655
|
Re: Changing ParticleSpreadRange with pie menu firing mode
yeah the firing of the bullet will require sin, cos, and aim angle in radians
|
Wed Sep 21, 2011 7:57 pm |
|
|
Awesomeness
Joined: Sat Jun 19, 2010 5:02 pm Posts: 331 Location: Mekkan
|
Re: Changing ParticleSpreadRange with pie menu firing mode
But...
RotateOffset gives you a vector of angle, and you can get degrees out of that using Vector's functions and properties just fine... Oh well. Just use radians.
|
Wed Sep 21, 2011 10:26 pm |
|
|
NeoSeeker
Joined: Tue Jul 24, 2007 1:13 am Posts: 1183 Location: eating sock's face like a cupcake
|
Re: Changing ParticleSpreadRange with pie menu firing mode
I really wish my adhd medication didn't make me go crazy... then i could actually learn Lua and pump out some unbelievable ♥♥♥♥
|
Sat Sep 24, 2011 5:54 pm |
|
|
Awesomeness
Joined: Sat Jun 19, 2010 5:02 pm Posts: 331 Location: Mekkan
|
Re: Changing ParticleSpreadRange with pie menu firing mode
I have ADHD... And programmed before and after I took medicine for it
|
Sun Sep 25, 2011 3:49 pm |
|
|
NeoSeeker
Joined: Tue Jul 24, 2007 1:13 am Posts: 1183 Location: eating sock's face like a cupcake
|
Re: Changing ParticleSpreadRange with pie menu firing mode
yeah well you don't have a laundry list of other mental disorders.
i could learn to program now considering i'm taking massive doses of clonazepam, just at this point in my life i'd rather do other things.
question, does it hurt to concentrate for you? i get physically uncomfortable, sometimes extremely so, like screaming.
|
Mon Sep 26, 2011 2:13 am |
|
|
Awesomeness
Joined: Sat Jun 19, 2010 5:02 pm Posts: 331 Location: Mekkan
|
Re: Changing ParticleSpreadRange with pie menu firing mode
prep the nun wrote: yeah well you don't have a laundry list of other mental disorders.
i could learn to program now considering i'm taking massive doses of clonazepam, just at this point in my life i'd rather do other things.
question, does it hurt to concentrate for you? i get physically uncomfortable, sometimes extremely so, like screaming. ._. Not at all. By the way, learning a programming language is best done as young as possible. It's more than a skill; it's a mindset. So you should do it as soon as you can.
|
Wed Sep 28, 2011 2:46 am |
|
|
|