View unanswered posts | View active topics It is currently Fri Apr 19, 2024 5:27 pm



Reply to topic  [ 13 posts ] 
 Changing ParticleSpreadRange with pie menu firing mode 
Author Message
User avatar

Joined: Tue Jul 24, 2007 1:13 am
Posts: 1183
Location: eating sock's face like a cupcake
Reply with quote
Post 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
Profile
User avatar

Joined: Mon Oct 25, 2010 5:51 am
Posts: 1198
Location: Sydney
Reply with quote
Post 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
Profile
REAL AMERICAN HERO
User avatar

Joined: Sat Jan 27, 2007 10:25 pm
Posts: 5655
Reply with quote
Post 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
Profile
User avatar

Joined: Sat Jun 19, 2010 5:02 pm
Posts: 331
Location: Mekkan
Reply with quote
Post 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
Profile
User avatar

Joined: Tue Jun 12, 2007 11:52 pm
Posts: 13143
Location: Here
Reply with quote
Post 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
Profile
User avatar

Joined: Sat Jun 19, 2010 5:02 pm
Posts: 331
Location: Mekkan
Reply with quote
Post 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
Profile
User avatar

Joined: Tue Jun 12, 2007 11:52 pm
Posts: 13143
Location: Here
Reply with quote
Post 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
Profile
REAL AMERICAN HERO
User avatar

Joined: Sat Jan 27, 2007 10:25 pm
Posts: 5655
Reply with quote
Post 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
Profile
User avatar

Joined: Sat Jun 19, 2010 5:02 pm
Posts: 331
Location: Mekkan
Reply with quote
Post 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. :P


Wed Sep 21, 2011 10:26 pm
Profile
User avatar

Joined: Tue Jul 24, 2007 1:13 am
Posts: 1183
Location: eating sock's face like a cupcake
Reply with quote
Post 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
Profile
User avatar

Joined: Sat Jun 19, 2010 5:02 pm
Posts: 331
Location: Mekkan
Reply with quote
Post Re: Changing ParticleSpreadRange with pie menu firing mode
I have ADHD... And programmed before and after I took medicine for it :P


Sun Sep 25, 2011 3:49 pm
Profile
User avatar

Joined: Tue Jul 24, 2007 1:13 am
Posts: 1183
Location: eating sock's face like a cupcake
Reply with quote
Post 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
Profile
User avatar

Joined: Sat Jun 19, 2010 5:02 pm
Posts: 331
Location: Mekkan
Reply with quote
Post 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. :P


Wed Sep 28, 2011 2:46 am
Profile
Display posts from previous:  Sort by  
Reply to topic   [ 13 posts ] 

Who is online

Users browsing this forum: No registered users


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group.
Designed by STSoftware for PTF.
[ Time : 0.046s | 17 Queries | GZIP : Off ]