May 23, 2012, 01:32:48 AM *
Welcome, Guest. Please login or register.

Login with username, password and session length
News: Please report any bugs or issues that you might be encountering with the Beta in the Support System so that we can better keep track of any oustanding issues that may come up.

GameCore Support System
 
   Home   Help Search Login Register  
Pages: [1]
  Print  
Author Topic: Hit fx  (Read 337 times)
pixel_legolas
Hero Member
*****
Posts: 786


View Profile
« on: June 03, 2009, 06:58:55 PM »

Hi all!

I just made a really nice effect. When my character hits something I activate a blood fx. The problem is that as long as I hit anything it keeps on playing the fx forever. I want it to play it just once only.

It's really hard to post a code somewhere but I used the exploding barrel and goal trigger as inspiration when creating this effect.

Here are some snippets:

Quote
void ApplyDamage( Object@ object, float value)
{
   
            {
               PushFullPath( object.GetFullPath());
            GetFXManager().CreateFXAtPosition( explodeFX, hitPosition);
            PopPath();
            }
         
      

}


and

Quote
void CollisionCallback( Object@ object, Object@, ObjectCollide@, ObjectCollide@, const Vector& in worldPos, const Vector& in normal)
{
   
   {
      hitPosition = worldPos;
      hitNormal = normal;
      ApplyDamage( object, health);
   }
}


I guess there needs to be some if's and while's there somewhere Smiley
Logged
Squat
Hero Member
*****
Posts: 592


View Profile
« Reply #1 on: June 04, 2009, 01:26:04 PM »

It may be that the FX itself is looping. Make sure that it ends and restarts in the FX Editor.

If you're calling the FX when the character touches something, that collision is basically happening over and over again as you stand on something. That also may be why it's recalling itself. If that's the case, and you need something like foot dust, then you'll need a delay and code to determine that the player is also moving. I suggest tracking the linear velocity. The player, while standing still, is basically hitting the ground, trying to pass through, getting pushed back up and resetting...over and over again so fast you can't see it. A collision call on the player may not be what you want.

If you provide more info, I'm sure this is easily solvable.
Logged
pixel_legolas
Hero Member
*****
Posts: 786


View Profile
« Reply #2 on: June 04, 2009, 02:04:07 PM »

i posted a new demo of RAGMAN and there you will see blood effect. It just keeps gushing out Wink I will try to update the fx, i can't remember if it is looped. thanks
Logged
Pages: [1]
  Print  
 
Jump to:  

 
Powered by MySQL Powered by PHP bluBlur Skin © 2006, hbSkins
Powered by SMF 1.1.14 | SMF © 2006-2011, Simple Machines LLC
Valid XHTML 1.0! Valid CSS!