Flint Particle System Forum - Design a weapon system on top of Flint Sat, 25 Dec 2010 18:55:53 +0000 http://flintparticles.org/forum/ Lussumo Vanilla 1.1.10 & Feed Publisher Design a weapon system on top of Flint http://flintparticles.org/forum/comments.php?DiscussionID=48&Focus=243#Comment_243 http://flintparticles.org/forum/comments.php?DiscussionID=48&Focus=243#Comment_243 Wed, 16 Jul 2008 06:05:36 +0100 NateDog
In other words, during the weapon firing, the target will be moving and so the emitter needs to constantly change its target. I think I should be using Blast in conjunction with a custom Class definition to have the blast particles constantly move toward the target MovieClip (which will be moving).

If anyone could point me in the right direction in terms of is this an Action or an Activity? Or is this already supported by using the correct attributes on a GravityWell?

I made my own Action called TurnTowardMovieClip based on TurnTowardMouse but it seems to zjigzag its way to the target like a snake. Kinda cool, but not too laser-like :o

Thanks in advance for anyone with ideas on best approach. And thanks again richard for Flint ... it's AMAZING! ]]>
Design a weapon system on top of Flint http://flintparticles.org/forum/comments.php?DiscussionID=48&Focus=245#Comment_245 http://flintparticles.org/forum/comments.php?DiscussionID=48&Focus=245#Comment_245 Wed, 16 Jul 2008 09:11:00 +0100 Richard
The difference between activities and actions is what they affect. An activity alters the state of the emitter, and an action alters the state of the particles that were created by the emitter.

If you use a Blast counter, as you suggest, to throw a bunch of particles at a target and alter the particles in flight then the particles will physically change direction while moving. Is that what you want? If so the TurnTowardsMovieClip action is what you need (more on the zig-zag at the end of the post).

Or do you want the particles to move in a straight line once they have been emitted? But all new particles to be directed towards the target's current position. In that case, you would want to alter the direction of motion of new particles as they are created. This could be done one of two ways.


  1. Use a custom activity to continuously rotate the emitter to face towards the target.

  2. Use a custom initializer to initialize each particle's initial velocity to direct it towards the target.



Either option would be fine - the difference will only be noticeable if you are also using the EmitterImage activity. If you are, option 1 will rotate the emitter image while option 2 will not.

Re: The problem with the TurnTowards actions.

The problem with the TurnTowards actions is that they don't know when they sometimes turn too far, then turn back again, and back again, and thus zig-zag. This is particularly common if you apply a large power to the turning movement. The action was designed for doing simple swarming behaviour, which involves gradual turns with a low power setting.

I have just now fixed the problem with the zigzag and checked new versions of TurnTowardsMouse and TurnTowardsPoint into SVN five minutes age. ]]>