Data Realms Fan Forums
http://45.55.195.193/

How to make an actor not fire a gun.
http://45.55.195.193/viewtopic.php?f=73&t=23874
Page 1 of 1

Author:  CaveCricket48 [ Sat May 21, 2011 8:22 pm ]
Post subject:  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.

Author:  CaveCricket48 [ Sat May 21, 2011 8:36 pm ]
Post subject:  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.

Author:  CaveCricket48 [ Sat May 21, 2011 8:45 pm ]
Post subject:  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.

Author:  CaveCricket48 [ Sat May 21, 2011 8:53 pm ]
Post subject:  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.

Page 1 of 1 All times are UTC [ DST ]
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group
http://www.phpbb.com/