Data Realms Fan Forums http://45.55.195.193/ |
|
Check sharpaiming, also sound question http://45.55.195.193/viewtopic.php?f=73&t=31872 |
Page 1 of 1 |
Author: | p3lb0x [ Fri Oct 05, 2012 11:33 pm ] |
Post subject: | Check sharpaiming, also sound question |
Is 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? |
Author: | Roast Veg [ Sat Oct 06, 2012 12:36 am ] |
Post subject: | Re: Check sharpaiming, also sound question |
I haven't tested or heard tell whether PlaySound is working yet. You can try it or just do it the old way. |
Author: | 4zK [ Sat Oct 06, 2012 12:39 am ] |
Post subject: | Re: Check sharpaiming, also sound question |
Code: if target.deviceState == AHuman.AIMING then Found something like this in the AI lua. |
Author: | Abdul Alhazred [ Sat Oct 06, 2012 7:13 am ] |
Post subject: | Re: Check sharpaiming, also sound question |
If 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. |
Author: | p3lb0x [ Sat Oct 06, 2012 8:49 am ] |
Post subject: | Re: Check sharpaiming, also sound question |
Fantastic. 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) |
Author: | Abdul Alhazred [ Sat Oct 06, 2012 2:35 pm ] |
Post subject: | Re: Check sharpaiming, also sound question |
My 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) ... |
Author: | p3lb0x [ Sat Oct 06, 2012 3:24 pm ] |
Post subject: | Re: Check sharpaiming, also sound question |
That 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. |
Page 1 of 1 | All times are UTC [ DST ] |
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group http://www.phpbb.com/ |