View unanswered posts | View active topics It is currently Fri Dec 27, 2024 8:54 am



Reply to topic  [ 3 posts ] 
 Grenade explosion timer AFTER bounce 
Author Message
User avatar

Joined: Sat Jun 23, 2012 2:03 pm
Posts: 340
Location: At home, drinking some tears (probably mine)
Reply with quote
Post Grenade explosion timer AFTER bounce
Right now, whether or not the grenade ever touches anything on Bound Mode, it still explodes after a set time.

What i'm thinking of is just adding a little bit to the GrenadeBounce.lua so that the timer starts after it hits something, but I have no idea what.
Does anybody know if this is possible, and example code would be greatly appreciated!


Sun Jul 22, 2012 12:47 am
Profile
User avatar

Joined: Sat Nov 03, 2007 9:44 pm
Posts: 1916
Location: Flint Hills
Reply with quote
Post Re: Grenade explosion timer AFTER bounce
You could do a check for a major change in speed, which would indicate the collision.

something like
if self.Vel.Magnitude < self.previousvelmag - 10 or self.Vel.Magnitude > self.previousvelmag + 10 then
[start timer to do the other stuff]
end
self.previousvelmag = self.Vel.Magnitude


Alternatively, you could have one non-timed grenade that gibs into the timed one, but switching objects out mid-collision makes the collision a little funky, IIRC.


Sun Jul 22, 2012 9:30 pm
Profile
User avatar

Joined: Sat Jun 23, 2012 2:03 pm
Posts: 340
Location: At home, drinking some tears (probably mine)
Reply with quote
Post Re: Grenade explosion timer AFTER bounce
Thanks, that sounds nice!


Mon Jul 23, 2012 1:35 pm
Profile
Display posts from previous:  Sort by  
Reply to topic   [ 3 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.051s | 13 Queries | GZIP : Off ]