Results 1 to 4 of 4
  1. #1
    MSgt. Shooter Person
    Join Date
    Mar 2012
    Posts
    81

    Default Melee weapons and fractured meshes

    By folowing the excellent tutorial about Melee weapon i can test this against rigid bodies and understand the damage is possible by producing an impulse with the following code:
    Code:
    		Momentum = Normal(SwordTip - SwordHilt) * InstantHitMomentum[CurrentFireMode];
    		HitActor.TakeDamage(DamageAmount, Instigator.Controller, HitLoc, Momentum, class'DamageType');
    But this doesn't apply to fractured meshes, how can I modify so that fractured meshes are also afected by the impulse? The TraceActorss iteration is detecting the collision with the fractured mesh, but i can make it start cracking. Any help?

  2. #2
    MSgt. Shooter Person
    Join Date
    Mar 2012
    Posts
    81

    Default

    Probably I wasn't clear enough about the problem, but basically I want to have melee weapons producing damage over fractured meshes. The tutorial above describes how to create a melee weapon and apply damage only to rigid bodies, maybe some parameters are missing or antoher kind of damage is needed, I have played around with the values of the TakeDamage none of them affect fractured meshes. Should I elaborate a bit more?

  3. #3
    Redeemer
    Join Date
    Nov 2009
    Location
    Help-me!
    Posts
    1,248

    Default

    Look for how projectiles affect fractured meshes.
    Lead Programmer
    It's the Only NEET Thing to Do

    Programming for non-fiction.
    I'm the function of my code. Conditions are my body and calls are my blood. I have input over a thousand lines. Unknown of bugs, nor known to work. Have withstand coffee to create many programs. Yet, those hands will never code anything again. So, as I pray, Unlimited Code Works.

  4. #4
    MSgt. Shooter Person
    Join Date
    Mar 2012
    Posts
    81

    Default

    Thanks Saishy, reading the projectile code, seems the fractured mesh collision is applied with the HitWall Event, correct me if am wrong, I noticed that basically what I need is to convert the HitStaticMesh to a class'KActorFromStatic' and then call the TakeDamage on it, could someone explain if it is possible how to achieve that from a fractured mesh? For the below code, I fail to get a valid StaticMeshComponent from the hit info, but also having a valid StaticMeshComponent returns a false for the HitStaticMesh.CanBecomeDynamic(), by ignoring the condition, it will only produce None warning access for this NewKActor entity

    Code:
     NewKActor = class'KActorFromStatic'.Static.MakeDynamic(HitStaticMesh);
    This is the whole function.

    Code:
    Class MeleeWeapon extends Weapon;
    
    function TraceSwing()
    {
       local Actor HitActor;
       local Vector HitLoc, HitNorm;
       local KActorFromStatic NewKActor;
       local StaticMeshComponent HitStaticMesh;
       local TraceHitInfo MyHitInfo;
    
       // gather HitInfo fom the HitActor
       foreach CollidingActors(class'Actor', HitActor, 1.0, HitLoc, true,,MyHitInfo )
       {
            HitStaticMesh = StaticMeshComponent(MyHitInfo.HitComponent);
    	if ( (HitStaticMesh != None) && HitStaticMesh.CanBecomeDynamic() )
    	{
    		NewKActor = class'KActorFromStatic'.Static.MakeDynamic(HitStaticMesh);
    		NewKActor.TakeDamage( 10000.0, Instigator.Controller, HitLoc, Momentum, class'DamageType',, self);
    	}	
       }
    }
    
    simulated state Swinging extends WeaponFiring
    {
       simulated event Tick(float DeltaTime)
       {
          super.Tick(DeltaTime);
          TraceSwing();
       }
    
       simulated event EndState(Name NextStateName)
       {
          super.EndState(NextStateName);
       }
    }
    Last edited by notNullGothik; 06-03-2012 at 09:53 PM.


 

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Copyright ©2009-2011 Epic Games, Inc. All Rights Reserved.
Digital Point modules: Sphinx-based search vBulletin skin by CompletevB.com.