Data Realms Fan Forums http://45.55.195.193/ |
|
Projectile Velocity over time (Opposite of air resistance?) http://45.55.195.193/viewtopic.php?f=1&t=45532 |
Page 1 of 1 |
Author: | Voxxitronic [ Wed Jan 01, 2014 10:59 pm ] |
Post subject: | 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? |
Author: | p3lb0x [ Wed Jan 01, 2014 11:05 pm ] |
Post subject: | 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 |
Author: | Voxxitronic [ Wed Jan 01, 2014 11:25 pm ] |
Post subject: | Re: Projectile Velocity over time (Opposite of air resistance?) |
Thanks dog. |
Author: | p3lb0x [ Thu Jan 02, 2014 12:09 am ] |
Post subject: | 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. |
Author: | CaveCricket48 [ Thu Jan 02, 2014 6:42 am ] |
Post subject: | 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. |
Author: | Voxxitronic [ Thu Jan 02, 2014 8:10 am ] |
Post subject: | 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. |
Author: | CaveCricket48 [ Thu Jan 02, 2014 8:42 am ] |
Post subject: | 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. |
Author: | p3lb0x [ Thu Jan 02, 2014 2:19 pm ] |
Post subject: | 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 |
Author: | CaveCricket48 [ Fri Jan 03, 2014 2:53 am ] |
Post subject: | 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. |
Page 1 of 1 | All times are UTC [ DST ] |
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group http://www.phpbb.com/ |