Data Realms Fan Forums
http://forums.datarealms.com/

Changing ParticleSpreadRange with pie menu firing mode
http://forums.datarealms.com/viewtopic.php?f=73&t=25581
Page 1 of 1

Author:  NeoSeeker [ Mon Sep 19, 2011 1:03 pm ]
Post subject:  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?

Author:  Kettenkrad [ Mon Sep 19, 2011 1:12 pm ]
Post subject:  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.

Author:  Grif [ Tue Sep 20, 2011 10:48 am ]
Post subject:  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.

Author:  Awesomeness [ Wed Sep 21, 2011 3:32 am ]
Post subject:  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

Author:  CaveCricket48 [ Wed Sep 21, 2011 11:25 am ]
Post subject:  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.

Author:  Awesomeness [ Wed Sep 21, 2011 12:35 pm ]
Post subject:  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.

Author:  CaveCricket48 [ Wed Sep 21, 2011 1:08 pm ]
Post subject:  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.

Author:  Grif [ Wed Sep 21, 2011 7:57 pm ]
Post subject:  Re: Changing ParticleSpreadRange with pie menu firing mode

yeah the firing of the bullet will require sin, cos, and aim angle in radians

Author:  Awesomeness [ Wed Sep 21, 2011 10:26 pm ]
Post subject:  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

Author:  NeoSeeker [ Sat Sep 24, 2011 5:54 pm ]
Post subject:  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 ♥♥♥♥

Author:  Awesomeness [ Sun Sep 25, 2011 3:49 pm ]
Post subject:  Re: Changing ParticleSpreadRange with pie menu firing mode

I have ADHD... And programmed before and after I took medicine for it :P

Author:  NeoSeeker [ Mon Sep 26, 2011 2:13 am ]
Post subject:  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.

Author:  Awesomeness [ Wed Sep 28, 2011 2:46 am ]
Post subject:  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

Page 1 of 1 All times are UTC [ DST ]
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group
http://www.phpbb.com/