| 
	| 
		
		FAQ
		 • Search • Login
	 | 
	
    
	
	 
  
	
	
		
			
				 
			 | 
		
			 Page 1 of 1
  | 
			 [ 3 posts ]  | 
			 | 
		
	 
	 
			
	
	 Grenade explosion timer AFTER bounce   
	
        
        
            | Author | 
            Message | 
         
        
			| 
				
				 AndyChanglee 
				
				
					 Joined: Sat Jun 23, 2012 2:03 pm Posts: 340 Location: At home, drinking some tears (probably mine)
				 
				 
			 | 
			
				
				  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 | 
			
				
					 
					
					 
				  
			 | 
    	
		 
	
	
		  | 
	 
	
			| 
				
				 Azukki 
				
				
					 Joined: Sat Nov 03, 2007 9:44 pm Posts: 1916 Location: Flint Hills
				 
				 
			 | 
			
				
				  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 | 
			
				
					 
					
					 
				  
			 | 
    	
		 
	
	
		  | 
	 
	
			| 
				
				 AndyChanglee 
				
				
					 Joined: Sat Jun 23, 2012 2:03 pm Posts: 340 Location: At home, drinking some tears (probably mine)
				 
				 
			 | 
			
				
				  Re: Grenade explosion timer AFTER bounce  
					
						Thanks, that sounds nice! 
					
  
			 | 
		 
		
			| Mon Jul 23, 2012 1:35 pm | 
			
				
					 
					
					 
				  
			 | 
    	
		 
	
	
		  | 
	 
	
	
		 | 
	 
	
	 
	
	
	
		
			
				  
			 | 
		
			 Page 1 of 1
  | 
			 [ 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
  | 
 
 
 
 
	 |