Data Realms Fan Forums
http://45.55.195.193/

Fizzling Magazines?
http://45.55.195.193/viewtopic.php?f=73&t=20909
Page 1 of 1

Author:  Technomancer [ Mon Dec 27, 2010 1:26 am ]
Post subject:  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?

Author:  findude [ Mon Dec 27, 2010 1:32 am ]
Post subject:  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.

Author:  Grif [ Mon Dec 27, 2010 2:14 am ]
Post subject:  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.

Author:  411570N3 [ Mon Dec 27, 2010 3:20 am ]
Post subject:  Re: Fizzling Magazines?

If I remember correctly, magazines never run scripts.

Author:  Technomancer [ Mon Dec 27, 2010 4:32 am ]
Post subject:  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?

Author:  Grif [ Mon Dec 27, 2010 7:31 am ]
Post subject:  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.

Author:  Petethegoat [ Mon Dec 27, 2010 2:53 pm ]
Post subject:  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

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