View unanswered posts | View active topics It is currently Thu Dec 26, 2024 3:24 pm



Reply to topic  [ 9 posts ] 
 Projectile Velocity over time (Opposite of air resistance?) 
Author Message
User avatar

Joined: Sat Feb 12, 2011 8:05 pm
Posts: 39
Location: Somewhere over the Double Rainbow
Reply with quote
Post 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
Profile
Forum Moderator
User avatar

Joined: Fri Feb 02, 2007 3:53 pm
Posts: 1896
Location: in my little gay bunker
Reply with quote
Post 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
Profile
User avatar

Joined: Sat Feb 12, 2011 8:05 pm
Posts: 39
Location: Somewhere over the Double Rainbow
Reply with quote
Post Re: Projectile Velocity over time (Opposite of air resistance?)
Thanks dog.


Wed Jan 01, 2014 11:25 pm
Profile
Forum Moderator
User avatar

Joined: Fri Feb 02, 2007 3:53 pm
Posts: 1896
Location: in my little gay bunker
Reply with quote
Post 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
Profile
User avatar

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

Joined: Sat Feb 12, 2011 8:05 pm
Posts: 39
Location: Somewhere over the Double Rainbow
Reply with quote
Post 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
Profile
User avatar

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

Joined: Fri Feb 02, 2007 3:53 pm
Posts: 1896
Location: in my little gay bunker
Reply with quote
Post 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
Profile
User avatar

Joined: Tue Jun 12, 2007 11:52 pm
Posts: 13144
Location: Here
Reply with quote
Post 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
Profile
Display posts from previous:  Sort by  
Reply to topic   [ 9 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.028s | 13 Queries | GZIP : Off ]