| Author | 
            Message | 
        
        
			| 
				
				 Dylanhutch 
				
				
					 Joined: Sun Apr 25, 2010 12:04 am Posts: 303 Location: Australia
				 
				 
			 | 
			
				
				  How would I use key commands? Stopping an actor gibbing.  
					
						I want to make a script that makes the actor have AngularVel 5. How would I make a key press cause a Lua command? And what was the pastebin thing, with all the key presses in numeric form?
  I want the key to be 'Left Control'
 
  Thanks in advance! 
					
							
  
							
    							Last edited by Dylanhutch on Fri Dec 10, 2010 1:26 pm, edited 1 time in total. 
    						 
						
  
			 | 
		
		
			| Tue Dec 07, 2010 1:15 pm | 
			
				
					 
					
					 
				  
			 | 
    	
		
	
	
		  | 
	
	
			| 
				
				 trystanr 
				
				
					 Joined: Sat Oct 09, 2010 10:01 am Posts: 303 Location: Afrique d' Sud
				 
				 
			 | 
			
				
				  Re: How would I use key commands?  
					
						. 
					
							
  
							
    							Last edited by trystanr on Tue Dec 07, 2010 1:38 pm, edited 1 time in total. 
    						 
						
  
			 | 
		
		
			| Tue Dec 07, 2010 1:30 pm | 
			
				
					 
					
					 
				      
			 | 
    	
		
	
	
		  | 
	
	
			| 
				
				 Lizardheim 
				DRL Developer 
				
					 Joined: Fri May 15, 2009 10:29 am Posts: 4107 Location: Russia
				 
				 
			 | 
			
				
				  Re: How would I use key commands?  
					
						If you don't KNOW the stuff, simply don't even try to answer. Code:    A - 1      S - 19      Numpad 0 - 37      ins  - 76    B - 2      T - 20      Numpad 1 - 38      del  - 77    C - 3      U - 21      Numpad 2 - 39      home - 78    D - 4      V - 22      Numpad 3 - 40      end  - 79    E - 5      W - 23      Numpad 4 - 41      page up - 80    F - 6      X - 24      Numpad 5 - 42      page down - 81    G - 7      Y - 25      Numpad 6 - 43      left arrow - 82    H - 8      Z - 26      Numpad 7 - 44      right arrow - 83    I - 9      0 - 27      Numpad 8 - 45      up arrow - 84    J - 10      1 - 28      Numpad 9 - 46      down arrow - 85    K - 11      2 - 29      - - 61         numpad / - 86    L - 12      3 - 30      = - 62         numpad * - 87    M - 13      4 - 31      { - 65         numpad - - 88    N - 14      5 - 32      } - 66         numpad + - 89    O - 15      6 - 33      " - 69         numpad . - 90    P - 16      7 - 34      \ - 70         ;  - 105    Q - 17      8 - 35      , - 72    R - 18      9 - 36      . - 73 Courtesy of Darlos. And yeah, I know left control isn't there.  
					
  
			 | 
		
		
			| Tue Dec 07, 2010 1:33 pm | 
			
				
					 
					
					 
				  
			 | 
    	
		
	
	
		  | 
	
	
			| 
				
				 Dylanhutch 
				
				
					 Joined: Sun Apr 25, 2010 12:04 am Posts: 303 Location: Australia
				 
				 
			 | 
			
				
				  Re: How would I use key commands?  
					
						Thanks lizard, Though I still don't know how to trigger it with the key values. 
					
  
			 | 
		
		
			| Tue Dec 07, 2010 1:37 pm | 
			
				
					 
					
					 
				  
			 | 
    	
		
	
	
		  | 
	
	
			| 
				
				 Lizardheim 
				DRL Developer 
				
					 Joined: Fri May 15, 2009 10:29 am Posts: 4107 Location: Russia
				 
				 
			 | 
			
				
				  Re: How would I use key commands?  
					
						UInputMan:KeyHeld(#) 
					
  
			 | 
		
		
			| Tue Dec 07, 2010 1:39 pm | 
			
				
					 
					
					 
				  
			 | 
    	
		
	
	
		  | 
	
	
			| 
				
				 Dylanhutch 
				
				
					 Joined: Sun Apr 25, 2010 12:04 am Posts: 303 Location: Australia
				 
				 
			 | 
			
				
				  Re: How would I use key commands?  
					
						Thanks a lot Lizard!
 
  ....
 
 
  Ran into a bit of a problem, I need his health to stay the same and disallow gibbing. probably impossible to do though.
 
  EDIT
  I guess you could make the GibImpulselimit Reeeeaaaally high then change it back later. 
					
  
			 | 
		
		
			| Tue Dec 07, 2010 1:43 pm | 
			
				
					 
					
					 
				  
			 | 
    	
		
	
	
		  | 
	
	
			| 
				
				 Roast Veg 
				Data Realms Elite 
				
					 Joined: Tue May 25, 2010 8:27 pm Posts: 4522 Location: Constant motion
				 
				 
			 | 
			
				
				  Re: How would I use key commands?  
					
						Untrue. Code: if self.ToDelete == true then    local respawn = CreateAHuman(self.PresetName)    respawn.Pos = self.Pos    respawn.Vel = self.Vel    respawn.RotAngle = self.RotAngle    MovableMan:AddParticle(respawn) end  
					
  
			 | 
		
		
			| Tue Dec 07, 2010 5:48 pm | 
			
				
					 
					
					 
				  
			 | 
    	
		
	
	
		  | 
	
	
			| 
				
				 Dylanhutch 
				
				
					 Joined: Sun Apr 25, 2010 12:04 am Posts: 303 Location: Australia
				 
				 
			 | 
			
				
				  Re: How would I use key commands?  
					
						It's if it gibs though, so that would only work if something killed it by deleting said actor. 
					
  
			 | 
		
		
			| Wed Dec 08, 2010 1:38 am | 
			
				
					 
					
					 
				  
			 | 
    	
		
	
	
		  | 
	
	
			| 
				
				 Roast Veg 
				Data Realms Elite 
				
					 Joined: Tue May 25, 2010 8:27 pm Posts: 4522 Location: Constant motion
				 
				 
			 | 
			
				
				  Re: How would I use key commands?  
					
						No it counts gibbing, too.
  As far as I'm aware, it covers all kinds of death. 
					
  
			 | 
		
		
			| Wed Dec 08, 2010 6:36 pm | 
			
				
					 
					
					 
				  
			 | 
    	
		
	
	
		  | 
	
	
			| 
				
				 Dylanhutch 
				
				
					 Joined: Sun Apr 25, 2010 12:04 am Posts: 303 Location: Australia
				 
				 
			 | 
			
				
				  Re: How would I use key commands?  
					
						Oh, didn't work here. What about: Code: function Destroy(self) if UInputMan:KeyHeld(6) then local respawn = CreateAHuman(self.PresetName) respawn.Pos = self.Pos MovableMan:AddParticle(respawn) end end
  It Worked! All I need now is a snippet to change the actor's team!...... I still think it would be a lot cleaner to just change the GibImpuseLimit Code: function Uptate(self) if UInputMan:KeyPressed(6) then    self.AngularVel = -8    self.GibImpulseLimit = 18000    end else    GibImpulseLimit = 2000    end        
  Anything wrong here?  
					
  
			 | 
		
		
			| Thu Dec 09, 2010 12:57 am | 
			
				
					 
					
					 
				  
			 | 
    	
		
	
	
		  | 
	
	
			| 
				
				 Lizardheim 
				DRL Developer 
				
					 Joined: Fri May 15, 2009 10:29 am Posts: 4107 Location: Russia
				 
				 
			 | 
			
				
				  Re: How would I use key commands?  
					
						You specify the team when you spawn the actor. 
					
  
			 | 
		
		
			| Thu Dec 09, 2010 9:35 am | 
			
				
					 
					
					 
				  
			 | 
    	
		
	
	
		  | 
	
	
			| 
				
				 Dylanhutch 
				
				
					 Joined: Sun Apr 25, 2010 12:04 am Posts: 303 Location: Australia
				 
				 
			 | 
			
				
				  Re: How would I use key commands?  
					
						I would much rather set the gib impulse, I tried but failed. Here's the code: Code:    if UInputMan:KeyHeld(6) then    self.AngularVel = -8    self.GibImpulseLimit = 18000    end    if UInputMan:KeyReleased(6) then    self.GibImpulseLimit = 3000    end    if UInputMan:KeyHeld(18) then    self.AngularVel = 8    self.GibImpulseLimit = 18000    end    if UInputMan:KeyReleased(18) then    self.GibImpulseLimit = 3000 end  
					
  
			 | 
		
		
			| Thu Dec 09, 2010 12:40 pm | 
			
				
					 
					
					 
				  
			 | 
    	
		
	
	
		  | 
	
	
			| 
				
				 Roast Veg 
				Data Realms Elite 
				
					 Joined: Tue May 25, 2010 8:27 pm Posts: 4522 Location: Constant motion
				 
				 
			 | 
			
				
				  Re: How would I use key commands?  
					
						You can't set GibImpulse in Lua. 
					
  
			 | 
		
		
			| Thu Dec 09, 2010 5:51 pm | 
			
				
					 
					
					 
				  
			 | 
    	
		
	
	
		  | 
	
	
			| 
				
				 Dylanhutch 
				
				
					 Joined: Sun Apr 25, 2010 12:04 am Posts: 303 Location: Australia
				 
				 
			 | 
			
				
				  Re: How would I use key commands?  
					
						Oh, crap. Is there any other way to make it not gib? At all? AHAH!!!!!!!!! I HAVE IT!!!! It is my ♥♥♥♥♥ now, yeah!!!! WOOO!!!!!Actor switch! Code: function Update(self)    if UInputMan:KeyHeld(6) then    self.AngularVel = -8    ToDelete = true    local respawn = CreateAHuman(Parkour Runner2)    MovableMan:AddParticle(respawn)    end end Yes, I am making a parkour  modI stopped working on it but in the last week I have started again.  
					
  
			 | 
		
		
			| Fri Dec 10, 2010 12:43 am | 
			
				
					 
					
					 
				  
			 | 
    	
		
	
	
		  | 
	
	
			| 
				
				 Roast Veg 
				Data Realms Elite 
				
					 Joined: Tue May 25, 2010 8:27 pm Posts: 4522 Location: Constant motion
				 
				 
			 | 
			
				
				  Re: How would I use key commands? Stopping an actor gibbing.  
					
						Oh good, I kinda liked that. 
					
  
			 | 
		
		
			| Fri Dec 10, 2010 5:43 pm | 
			
				
					 
					
					 
				  
			 | 
    	
		
	
	
		  | 
	
	
	
		 |