View unanswered posts | View active topics It is currently Thu Dec 26, 2024 5:49 pm



Reply to topic  [ 7 posts ] 
 Fizzling Magazines? 
Author Message
User avatar

Joined: Sat Jul 31, 2010 10:01 pm
Posts: 42
Reply with quote
Post Fizzling Magazines?
What I intend to do is have a small magazine come off my weapon, and then upon separation from the gun, it burns out (probably using particles or emitters or something, I really don't know) and disappears, not leaving any matter to clutter terrain. I'm thinking I'd need to do this with Lua, hence posting here, but I would like to know if it's possible at all, and if so, a nudge in the right direction would be appreciated. This is all assuming that I can even use Lua on a Magazine.

If it's not possible, can the magazine be an emitter which only appears upon emptying a clip?


Mon Dec 27, 2010 1:26 am
Profile
User avatar

Joined: Tue Dec 12, 2006 3:10 pm
Posts: 495
Location: Uncertain quantum state
Reply with quote
Post Re: Fizzling Magazines?
Probably have the magazine gib to the fizzling emitter upon being ejected.
You should be able to do this with an emitter attached to the magazine, that emits a heavy enough particle to cause the magazine to gib,
or by making sure that the magazine will hit the gun and gib.

The emitter can be animated to disintergrate, too.


Mon Dec 27, 2010 1:32 am
Profile
REAL AMERICAN HERO
User avatar

Joined: Sat Jan 27, 2007 10:25 pm
Posts: 5655
Reply with quote
Post Re: Fizzling Magazines?
Actually you could do it even easier.

Since magazines, while attached, are attachables (and therefore do not run lua) by adding a lua script to the magazine that runs a 'dissolve' script in function Create(self) you'll just run the script as soon as the mag drops off.

So, recommended script: basically do what Findude said; create an AEmitter that fizzles, and delete/gib/whatever the magazine.


Mon Dec 27, 2010 2:14 am
Profile
User avatar

Joined: Wed Jan 07, 2009 10:26 am
Posts: 4074
Location: That quaint little British colony down south
Reply with quote
Post Re: Fizzling Magazines?
If I remember correctly, magazines never run scripts.


Mon Dec 27, 2010 3:20 am
Profile WWW
User avatar

Joined: Sat Jul 31, 2010 10:01 pm
Posts: 42
Reply with quote
Post Re: Fizzling Magazines?
Certainly I haven't got it to work yet, so that is possible. I suppose then I'd have to resort to standard .ini editing. Though... would it be possible for the bullet to check for the nearby magazine on firing, and then apply the effects to it without interfering with the shot? Also, when detached from the gun, I would assume the magazine is an MOSRotating, even if it won't run scripts itself?


Mon Dec 27, 2010 4:32 am
Profile
REAL AMERICAN HERO
User avatar

Joined: Sat Jan 27, 2007 10:25 pm
Posts: 5655
Reply with quote
Post Re: Fizzling Magazines?
Huh. I may well be wrong.

Anyways. Magazines, when detached, would probably be covered in MovableMan.Particles. Maybe check classnames for Magazine? Hmm. And then a presetname check to narrow it down to your particular mag.


Mon Dec 27, 2010 7:31 am
Profile
User avatar

Joined: Mon Jun 15, 2009 4:02 pm
Posts: 905
Reply with quote
Post Re: Fizzling Magazines?
As Allstone said, magazines don't run scripts by default.
Abdul Alhazred wrote:
Perhaps not terribly useful, but there exist a workaround for this. Add the following code to the StartActivity function of your scene:
Code:
   if not ToMagazine then
      ToMagazine = ToMOSRotating
   end


Mon Dec 27, 2010 2:53 pm
Profile WWW
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.074s | 13 Queries | GZIP : Off ]