Data Realms Fan Forums http://45.55.195.193/ |
|
Questions on HDFirearms/Magazines http://45.55.195.193/viewtopic.php?f=73&t=17176 |
Page 1 of 1 |
Author: | CaveCricket48 [ Sat Nov 21, 2009 10:18 pm ] |
Post subject: | Questions on HDFirearms/Magazines |
How do you use Lua to find a magazine on a gun? Can you force a gun to not reload when it's empty? Can you change the RoundCount of a magazine? |
Author: | TheLastBanana [ Sun Nov 22, 2009 12:08 am ] |
Post subject: | Re: Questions on HDFirearms/Magazines |
1. If it has GetsHitByMOs on, you can find it with the standard MO-finding technique. Otherwise, ther eis no way. 2. As far as I know, no. You can give it a massive reload time, maybe. 3. Nope. |
Author: | CaveCricket48 [ Sun Nov 22, 2009 12:31 am ] |
Post subject: | Re: Questions on HDFirearms/Magazines |
For some reason the magazine isn't being detected when it's GetsHitByMOs = 1. Code: for i = 1,MovableMan:GetMOIDCount()-1 do mag = MovableMan:GetMOFromID(i); if mag.ClassName == "Magazine" and mag.RootID == self.parent.ID then mag.ToDelete = true; mag.LifeTime = 0; print("mag delete"); end end |
Author: | TheLastBanana [ Sun Nov 22, 2009 12:43 am ] |
Post subject: | Re: Questions on HDFirearms/Magazines |
Is self.parent an actor or a weapon? |
Author: | TorrentHKU [ Sun Nov 22, 2009 1:09 am ] |
Post subject: | Re: Questions on HDFirearms/Magazines |
TheLastBanana wrote: 2. As far as I know, no. You can give it a massive reload time, maybe. |
Author: | CaveCricket48 [ Sun Nov 22, 2009 1:57 am ] |
Post subject: | Re: Questions on HDFirearms/Magazines |
self.parent is an actor. |
Author: | Foa [ Sun Nov 22, 2009 5:01 am ] |
Post subject: | Re: Questions on HDFirearms/Magazines |
CaveCricket48 wrote: For some reason the magazine isn't being detected when it's GetsHitByMOs = 1. Code: for i = 1,MovableMan:GetMOIDCount()-1 do mag = MovableMan:GetMOFromID(i); if mag.ClassName == "Magazine" and mag.RootID == self.parent.ID then mag.ToDelete = true; mag.LifeTime = 0; print("mag delete"); end end I think you got this from Ballistic Weapons' Railgun. ( The magazine gibs in three seconds, so you literally only have three seconds to fire ) But the thing used .ini trickery ( lifetime = 3000 ) I think you are trying to get a realistic ammo system, so you will need lua so it can go from can't reload to reload. |
Author: | CaveCricket48 [ Sun Nov 22, 2009 5:41 am ] |
Post subject: | Re: Questions on HDFirearms/Magazines |
Foa wrote: CaveCricket48 wrote: For some reason the magazine isn't being detected when it's GetsHitByMOs = 1. Code: for i = 1,MovableMan:GetMOIDCount()-1 do mag = MovableMan:GetMOFromID(i); if mag.ClassName == "Magazine" and mag.RootID == self.parent.ID then mag.ToDelete = true; mag.LifeTime = 0; print("mag delete"); end end I think you got this from Ballistic Weapons' Railgun. ( The magazine gibs in three seconds, so you literally only have three seconds to fire ) But the thing used .ini trickery ( lifetime = 3000 ) I think you are trying to get a realistic ammo system, so you will need lua so it can go from can't reload to reload. I think I got that from my head. And I want the mag to dissapear under a specific circumstance, not after a set time limit when you draw your weapon. |
Author: | Lizardheim [ Sun Nov 22, 2009 7:32 am ] |
Post subject: | Re: Questions on HDFirearms/Magazines |
Have it put a thingmajigg on the actor, that makes it check if there is a rocket/bullet/whatever being fired away from him, and have it check lifetime too. And have the script terminate if the weapon is dropped and one has no more of them in inventory. |
Author: | CaveCricket48 [ Sun Nov 22, 2009 6:04 pm ] |
Post subject: | Re: Questions on HDFirearms/Magazines |
That sounds good. Will try. Edit: Success! Thanks Lizard and everyone else. |
Page 1 of 1 | All times are UTC [ DST ] |
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group http://www.phpbb.com/ |