| Author | Message | 
        
			| p3lb0x Forum Moderator 
					Joined: Fri Feb 02, 2007 3:53 pm
 Posts: 1896
 Location: in my little gay bunker
   |   Check sharpaiming, also sound questionIs it possible to check whether an actor is sharpaiming? And is there a way to play audio through lua or do you still need to spawn particles that do it? 
 
 | 
		
			| Fri Oct 05, 2012 11:33 pm | 
					
					   | 
	
	
		|  | 
	
			| Roast Veg Data Realms Elite 
					Joined: Tue May 25, 2010 8:27 pm
 Posts: 4522
 Location: Constant motion
   |   Re: Check sharpaiming, also sound questionI haven't tested or heard tell whether PlaySound is working yet. You can try it or just do it the old way. 
 
 | 
		
			| Sat Oct 06, 2012 12:36 am | 
					
					   | 
	
	
		|  | 
	
			| 4zK 
					Joined: Mon Oct 11, 2010 1:15 pm
 Posts: 594
 Location: Finlandia
   |   Re: Check sharpaiming, also sound questionCode: if target.deviceState == AHuman.AIMING thenFound something like this in the AI lua.
 
 | 
		
			| Sat Oct 06, 2012 12:39 am | 
					
					   | 
	
	
		|  | 
	
			| Abdul Alhazred DRL Developer 
					Joined: Tue Aug 11, 2009 5:09 am
 Posts: 395
   |   Re: Check sharpaiming, also sound questionIf you are modifying the AI you can check deviceState like 4zK said but that variable can not be accessed by other scripts, so you have to check if the controller state is in AIM_SHARP if you are trying to figure out if another actor is aiming. 
 
 | 
		
			| Sat Oct 06, 2012 7:13 am | 
					
					   | 
	
	
		|  | 
	
			| p3lb0x Forum Moderator 
					Joined: Fri Feb 02, 2007 3:53 pm
 Posts: 1896
 Location: in my little gay bunker
   |   Re: Check sharpaiming, also sound questionFantastic. I should be able to figure that out. Thanks. Edit: What part of the below is not working? I am running this on a HDFirearm in case that is important. Code: MovableMan:GetMOFromID(self.RootID):GetController():IsState(Controller.AIM_SHARP)
 
 | 
		
			| Sat Oct 06, 2012 8:49 am | 
					
					   | 
	
	
		|  | 
	
			| Abdul Alhazred DRL Developer 
					Joined: Tue Aug 11, 2009 5:09 am
 Posts: 395
   |   Re: Check sharpaiming, also sound questionMy best guess is that GetMOFromID returns an MovableObject but GetController is a part of the Actor class, so that function is not available. Have you tried this? Code: local MO = ...GetMOFromID(id)if MO then
 local Actor = ToActor(MO)
 ...
 
 
 | 
		
			| Sat Oct 06, 2012 2:35 pm | 
					
					   | 
	
	
		|  | 
	
			| p3lb0x Forum Moderator 
					Joined: Fri Feb 02, 2007 3:53 pm
 Posts: 1896
 Location: in my little gay bunker
   |   Re: Check sharpaiming, also sound questionThat did it! Thanks a lot Abdul! Now I just need to get some sounds. I'll probably use the old AEmitter way unless there's something better. 
 
 | 
		
			| Sat Oct 06, 2012 3:24 pm | 
					
					   | 
	
	
		|  | 
	
	
		|  |