Author |
Message |
Voxxitronic
Joined: Sat Feb 12, 2011 8:05 pm Posts: 39 Location: Somewhere over the Double Rainbow
|
Projectile Velocity over time (Opposite of air resistance?)
Is there a way to create a bullet that goes faster the longer it exists? I tried doing negative air resistance first, but that didn't work. Would there be another way to do this besides using a mass-emitting AEmitter attached to an MOSRotating?
|
Wed Jan 01, 2014 10:59 pm |
|
|
p3lb0x
Forum Moderator
Joined: Fri Feb 02, 2007 3:53 pm Posts: 1896 Location: in my little gay bunker
|
Re: Projectile Velocity over time (Opposite of air resistance?)
With lua, sure. Or AEmitters. Code: function Update(self) self.vel = self.vel * 1.001 end
|
Wed Jan 01, 2014 11:05 pm |
|
|
Voxxitronic
Joined: Sat Feb 12, 2011 8:05 pm Posts: 39 Location: Somewhere over the Double Rainbow
|
Re: Projectile Velocity over time (Opposite of air resistance?)
Thanks dog.
|
Wed Jan 01, 2014 11:25 pm |
|
|
p3lb0x
Forum Moderator
Joined: Fri Feb 02, 2007 3:53 pm Posts: 1896 Location: in my little gay bunker
|
Re: Projectile Velocity over time (Opposite of air resistance?)
If I recall correctly particles disappear if they are flying faster than some arbitrary value (500 comes to mind, but I am not sure), so you'd probably also want to add a check for that before changing velocity further.
|
Thu Jan 02, 2014 12:09 am |
|
|
CaveCricket48
Joined: Tue Jun 12, 2007 11:52 pm Posts: 13144 Location: Here
|
Re: Projectile Velocity over time (Opposite of air resistance?)
Also, Lua scripts run per frame, and since the FPS can fluctuate while in-game time remains the same (or vice versa), that script will accelerate your particle at different rates based on FPS, and won't be consistent with the in-game time.
|
Thu Jan 02, 2014 6:42 am |
|
|
Voxxitronic
Joined: Sat Feb 12, 2011 8:05 pm Posts: 39 Location: Somewhere over the Double Rainbow
|
Re: Projectile Velocity over time (Opposite of air resistance?)
Do yall know if this script works with MOSRotatings? I'm doing this with an autocannon-based weapon, adding it to the round causes a could not match property error, and adding it to the MOSRotating does nothing, no matter how high the value.
|
Thu Jan 02, 2014 8:10 am |
|
|
CaveCricket48
Joined: Tue Jun 12, 2007 11:52 pm Posts: 13144 Location: Here
|
Re: Projectile Velocity over time (Opposite of air resistance?)
In the script, it needs to be "Vel", not "vel". Capital "V". Attaching it to the MOSRotating should work fine.
|
Thu Jan 02, 2014 8:42 am |
|
|
p3lb0x
Forum Moderator
Joined: Fri Feb 02, 2007 3:53 pm Posts: 1896 Location: in my little gay bunker
|
Re: Projectile Velocity over time (Opposite of air resistance?)
You could multiply by delta time if that's possible, I don't really remember.
edit: Seems like you can only find the fixed delta time that the game tries to run simulation at. Oh well
|
Thu Jan 02, 2014 2:19 pm |
|
|
CaveCricket48
Joined: Tue Jun 12, 2007 11:52 pm Posts: 13144 Location: Here
|
Re: Projectile Velocity over time (Opposite of air resistance?)
You can have a timer to check the exact amount of time elapsed since the last frame.
|
Fri Jan 03, 2014 2:53 am |
|
|
|