View unanswered posts | View active topics It is currently Sun Dec 01, 2024 4:29 am



Reply to topic  [ 7 posts ] 
 Check sharpaiming, also sound question 
Author Message
Forum Moderator
User avatar

Joined: Fri Feb 02, 2007 3:53 pm
Posts: 1896
Location: in my little gay bunker
Reply with quote
Post 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?


Fri Oct 05, 2012 11:33 pm
Profile
Data Realms Elite
Data Realms Elite
User avatar

Joined: Tue May 25, 2010 8:27 pm
Posts: 4521
Location: Constant motion
Reply with quote
Post 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.


Sat Oct 06, 2012 12:36 am
Profile
User avatar

Joined: Mon Oct 11, 2010 1:15 pm
Posts: 594
Location: Finlandia
Reply with quote
Post Re: Check sharpaiming, also sound question
Code:
if target.deviceState == AHuman.AIMING then

Found something like this in the AI lua.


Sat Oct 06, 2012 12:39 am
Profile
DRL Developer
DRL Developer

Joined: Tue Aug 11, 2009 5:09 am
Posts: 395
Reply with quote
Post 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.


Sat Oct 06, 2012 7:13 am
Profile
Forum Moderator
User avatar

Joined: Fri Feb 02, 2007 3:53 pm
Posts: 1896
Location: in my little gay bunker
Reply with quote
Post 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)


Sat Oct 06, 2012 8:49 am
Profile
DRL Developer
DRL Developer

Joined: Tue Aug 11, 2009 5:09 am
Posts: 395
Reply with quote
Post 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)
  ...


Sat Oct 06, 2012 2:35 pm
Profile
Forum Moderator
User avatar

Joined: Fri Feb 02, 2007 3:53 pm
Posts: 1896
Location: in my little gay bunker
Reply with quote
Post 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.


Sat Oct 06, 2012 3:24 pm
Profile
Display posts from previous:  Sort by  
Reply to topic   [ 7 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.038s | 13 Queries | GZIP : Off ]