View unanswered posts | View active topics It is currently Fri Dec 27, 2024 8:08 am



Reply to topic  [ 4 posts ] 
 How to make an actor not fire a gun. 
Author Message
User avatar

Joined: Tue Jun 12, 2007 11:52 pm
Posts: 13144
Location: Here
Reply with quote
Post Re: How to make an actor not fire a gun.
If you get a pointer to the actor's gun, you should be able to use

Code:
ToHDFirearm(pointer):Deactivate();

To keep the gun from firing.


Sat May 21, 2011 8:22 pm
Profile
User avatar

Joined: Tue Jun 12, 2007 11:52 pm
Posts: 13144
Location: Here
Reply with quote
Post Re: How to make an actor not fire a gun.
You would want to run through all MOIDs and grab MOs from those. Then check the RootID of the MO, make sure its ClassName is HDFirearm, and then Deactivate() it.


Sat May 21, 2011 8:36 pm
Profile
User avatar

Joined: Tue Jun 12, 2007 11:52 pm
Posts: 13144
Location: Here
Reply with quote
Post Re: How to make an actor not fire a gun.
Code:

   for i = 1,MovableMan:GetMOIDCount()-1 do
      local gun = MovableMan:GetMOFromID(i)
      if gun.RootID == self.RootID and gun.ClassName == "HDFirearm" then
         ToHDFirearm(gun):Deactivate();
         break;
      end
   end


You don't need the distance check, or move over the 'gun' pointer over to a pointer named 'pointer'. Also, this script for for attaching to the actor holding the gun.


Sat May 21, 2011 8:45 pm
Profile
User avatar

Joined: Tue Jun 12, 2007 11:52 pm
Posts: 13144
Location: Here
Reply with quote
Post Re: How to make an actor not fire a gun.
The code snippet, it goes into a script, and that script is put on the actor.


Sat May 21, 2011 8:53 pm
Profile
Display posts from previous:  Sort by  
Reply to topic   [ 4 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:  
cron
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group.
Designed by STSoftware for PTF.
[ Time : 0.042s | 14 Queries | GZIP : Off ]