Results 1 to 21 of 21
  1. #1
    MSgt. Shooter Person
    Join Date
    Sep 2011
    Posts
    65

    Default Skeletalmesh KActor with physics

    Yup, I pretty much sumed up my problem on the title. I have a KActor, with no physics. I added in a phAt but no dice. Its a placeable kactor, and I dont really want it to be uber physics or anything, just to have a small gravity and heavy feeling to it. Any idea or suggestions would be appreciated.

    Thanks!

  2. #2
    MSgt. Shooter Person
    Join Date
    Feb 2011
    Posts
    242

    Default

    What do you mean you added in a phAt? Do you mean you added a PhysicsAsset to your actor?

    I think if you go into your KActor's properties window, you should see an option called "Physics Weight" under your skeletalmeshcomponent tab. Try setting it to a value greater than zero, see if anything happens.

    Failing that, I think UDN also lists some video tutorials on the subject from 3DBuzz, which you can pick up here: http://udn.epicgames.com/Three/Video...%20Using%20UDK

    Other than that, can't really recommend much to you. Good luck.

  3. #3
    MSgt. Shooter Person
    Join Date
    Sep 2011
    Posts
    65

    Default

    Yep, I added a physics asset to the skel mesh, but nothing really happened. It defies gravity and stuff.

    /edit

    Also, even though through the code I specify a skeletalmeshcomponent, in the editor there are no skeletalmeshcomponent tabs. There is a staticmesh tab, but it says there's no mesh in it.

    I know the skeletalmesh is there though, i can see it, and particles popup where the sockets are. Is there any other way?
    Last edited by Barzorx; 12-04-2011 at 04:06 AM.

  4. #4
    MSgt. Shooter Person
    Join Date
    Sep 2011
    Posts
    132

    Default

    there must be an "WakeOnLevelStart" -option (F4) in your placeable KActor I think.
    If so, check it.

  5. #5
    MSgt. Shooter Person
    Join Date
    Sep 2011
    Posts
    65

    Default

    Yeah, I already know its there. And its already toggled. Its on by default, and it didnt really matter if it was on or off, both ways it has no physics and I cant move it with the physics gun either

  6. #6
    MSgt. Shooter Person
    Join Date
    Sep 2011
    Posts
    65

    Default

    Bump, here's some of my code so you guys can see what im doing or.. trying to at least

    Code:
    class MercedesHull extends KActor
    	placeable;
    
    var int Health;
    //var DynamicLightEnvironmentComponent LightEnvironment;
    var ParticleSystem FireEmitter1, Explosion;
    var bool Fire1;
    var bool Fire2;
    var bool Fire3;
    var bool ExplosionEm;
    var SkeletalMeshComponent Mercedes;
    
    var class<DamageType> dmgType;
    var float DefaultImpulse;
    
    auto state Active
    {
    
    	event TakeDamage(int Damage, Controller EventInstigator, vector HitLocation, vector Momentum, class<DamageType> DamageType, optional TraceHitInfo HitInfo, optional Actor DamageCauser)
    	{
            dmgType = DamageType;
    	`log("Damage done "@Damage);
    	Health -= Damage;
    	Super.TakeDamage(Damage, EventInstigator, HitLocation, Momentum, DamageType, HitInfo, DamageCauser);
    	
    	
    	if(!Fire1 && Health<=70)
    	{
    		SpawnEffect(1);
    		Fire1=true;
    	}
    	
    	if(!Fire2 && Health<=50)
    	{
    		SpawnEffect(2);
    		Fire2=true;
    	}
    	
    	if(!Fire3 && Health<=20)
    	{
    		SpawnEffect(3);
    		Fire3=true;
    	}
    
    	if(Health<=0 && !ExplosionEm)
    	{
    		ExplosionEm=true;
    		ExplodingCar();
    		HurtRadius
    			(
    			    75,
    			    128,
    			    dmgType,
    			    0,
    			    Location,
    			    None,
    			    EventInstigator,
    			    false
    			);
    	}
    	
    	}
    
    	simulated function Tick(float DeltaTime)
    	{
    		
    		super.Tick(DeltaTime);
    
    		if(Health<=35 && Health>0)
    		{
    			Health-=5;
    			`log("Self Damage for 5 points, HP left "@Health);
    		}
    		if(Health<0 && !ExplosionEm)
    	        {
    			ExplosionEm=true;
    			ExplodingCar();
    
    		}
    	}
    
    	
    	function ExplodingCar()
    	{
    		SpawnEffect(4);
    		ExplosionEm=true;
    		ApplyImpulse(vect(0,0,10),DefaultImpulse, vect(0,0,0));
    		HurtRadius
    			(
    			    1000,
    			    1000,
    			    dmgType,
    			    0,
    			    Location,
    			    ,
    			    ,
    			);
    
    		GoToState('Dead');
    	}
    
    }
    
    
    state Dead
    {
    	ignores TakeDamage,TakeRadiusDamage;
    	
    }
    
    
    function SpawnEffect(int number)
    {
    if(number==1){ WorldInfo.MyEmitterPool.SpawnEmitterMeshAttachment(FireEmitter1,Mercedes, 'FireParticle1',true,,);}
    
    if(number==2){ WorldInfo.MyEmitterPool.SpawnEmitterMeshAttachment(FireEmitter1,Mercedes, 'FireParticle2',true,,);}
    
    if(number==3){ WorldInfo.MyEmitterPool.SpawnEmitterMeshAttachment(FireEmitter1,Mercedes, 'FireParticle3',true,,);}
    
    if(number==4){ WorldInfo.MyEmitterPool.SpawnEmitterMeshAttachment(Explosion,Mercedes, 'FireParticle3',true,,);}
    
    }
    
    defaultproperties
    {
    Fire1=false
    Fire2=false
    Fire3=false
    ExplosionEm=false
    Health=100
    bBlockActors=true
    bCollideWorld=true
    bCollideActors=true
    bPathColliding=true
    
    
    DefaultImpulse=20.0
    
    //particlesystems
    FireEmitter1=ParticleSystem'Particles.FlameTorch_CARS'
    Explosion=ParticleSystem'Particles.Explosion_Mercedes'
    
    //Begin Object Class=DynamicLightEnvironmentComponent Name=MyLightEnvironment
    //		bSynthesizeSHLight=true
    //		bUseBooleanEnvironmentShadowing=false
    //	End Object
    //	LightEnvironment=MyLightEnvironment
    //	Components.Add(MyLightEnvironment)
    
    bWakeOnLevelStart=true
    
    Begin Object class=SkeletalMeshComponent name=MercedesHull
    	SkeletalMesh=SkeletalMesh'HD_CivilianVehicles.Mercedes_Rigged'
    	PhysicsAsset=PhysicsAsset'HD_CivilianVehicles.Mercedes_Rigged_Physics'
    	CollideActors=true
    	BlockActors=true
    	BlockNonZeroExtent=true
    	BlockZeroExtent=true
    	Scale=10.0
    	LightingChannels=(Dynamic=TRUE)
    	AlwaysCheckCollision=TRUE
    	End Object
    	Components.Add(MercedesHull);
    	Mercedes=MercedesHull;
    }
    The code itself still has a couple of glitches, but I can fix those myself. Im more worried about why it has no physics at all.

  7. #7
    MSgt. Shooter Person
    Join Date
    Sep 2011
    Posts
    132

    Default

    try to set DefaultImpulse higher for testing purpose (like 20000).
    and to be sure set "Health <= 0" in Tick.

    hope it changes something

  8. #8
    MSgt. Shooter Person
    Join Date
    Sep 2011
    Posts
    65

    Default

    done and done, still no gravity and no physics on the car though...

  9. #9
    Technical Writer - UDN
    Join Date
    Aug 2006
    Posts
    3,928
    Gamer IDs

    Gamertag: ffejnosliw

    Default

    Why are you using KActor? KActor is for static mesh rigid bodies. KAsset is for skeletal mesh rigid bodies.

  10. #10
    MSgt. Shooter Person
    Join Date
    Feb 2011
    Posts
    242

    Default

    Of course... it makes sense now!

    You said that the skeletalmeshcomponent did not show up in your object's properties, right? It's because in the code you pasted, you have not formally declared the end of the object, and added the component.

    In your code here:
    Code:
    Begin Object class=SkeletalMeshComponent name=MercedesHull
    	SkeletalMesh=SkeletalMesh'HD_CivilianVehicles.Mercedes_Rigged'
    	PhysicsAsset=PhysicsAsset'HD_CivilianVehicles.Mercedes_Rigged_Physics'
    	CollideActors=true
    	BlockActors=true
    	BlockNonZeroExtent=true
    	BlockZeroExtent=true
    	Scale=10.0
    	LightingChannels=(Dynamic=TRUE)
    	AlwaysCheckCollision=TRUE
    	End Object
    	Components.Add(MercedesHull);
    	Mercedes=MercedesHull;
    }
    On the next line after your "Mercedes=MercedesHull;" parameter, you need to add this:

    Code:
    End Object
    Components.Add(MercedesHull)
    Now the skeletalmeshcomponent tab should end up in your properties now, along with your physicsasset property. But I don't know if this will create the proper physics for your object though.

    Start from there, see what happens.

  11. #11
    MSgt. Shooter Person
    Join Date
    Sep 2011
    Posts
    65

    Default

    @ADayInForever uhh that line is right there though. Right before the mercedes=mercedeshull, I end the object and add it in to the components list. I moved the code around though and still no Physis Weight in any tab, just in case.


    @ffejnosliw I'm using KActor so I can use the ApplyImpulse function, KAsset doesnt have that.

  12. #12
    Palace Guard

    Join Date
    Jun 2007
    Location
    Christchurch
    Posts
    3,781

    Default

    You can implement ApplyImpulse yourself since the relevant functions are implemented in PrimitiveComponent anyways. StaticMeshComponent and SkeletalMeshComponent are both subclasses of PrimitiveComponent.

    You could probably copy and paste KActor.ApplyImpulse() into KAsset no problems. Although make sure you subclass KAsset, instead of modifying the original source code.

  13. #13
    MSgt. Shooter Person
    Join Date
    Sep 2011
    Posts
    65

    Default

    Well, extending from KAsset doesnt do the trick by itself though, the car is pretty much still floating, and not movable though.

  14. #14
    Technical Writer - UDN
    Join Date
    Aug 2006
    Posts
    3,928
    Gamer IDs

    Gamertag: ffejnosliw

    Default

    It sounds like you are making a vehicle. Can I ask why you aren't using the vehicle classes?

  15. #15
    MSgt. Shooter Person
    Join Date
    Sep 2011
    Posts
    65

    Default

    Because its not a vehicle per se, it's not meant to be used, just stand there and explode whenever I shoot at it. The idea is having multiple vehicles that will explode after X amount of hits, while shooting at it it catches on fire and the moment of the explosion it causes damage to everything surrounding it. If it explodes, it should obviously raise up a bit or something to add in some dramatic effects... but i cant even get it to move at all after exploding. I use a skel mesh to use sockets, where i spawn the particle systems of fire and explosion.

  16. #16
    MSgt. Shooter Person
    Join Date
    Sep 2011
    Posts
    65

    Default

    bump for programming goodness! I still havent managed to get it working

  17. #17
    MSgt. Shooter Person
    Join Date
    Sep 2011
    Posts
    65

    Default

    anyone? please? D:

  18. #18
    MSgt. Shooter Person
    Join Date
    Sep 2011
    Posts
    65

    Default

    Seriously though, any idea is good. I really need to add some sort of physics to the car itself.

    Maybe im wrong and i dont have to use a KActor. What I need is to use a skeletalmesh for its sockets, some sort of physics so the car will fall off, and to be able to use an impulse and radialdamage post-explosion...

  19. #19
    MSgt. Shooter Person
    Join Date
    Apr 2011
    Posts
    97

    Default

    I have been trying to do the same thing, except that I was trying to create a street lamp with physics and sockets on it. Couldn't manage to work mine either.

  20. #20
    MSgt. Shooter Person
    Join Date
    Sep 2011
    Posts
    65

    Default

    There has to be a way to do this. Someone out there has to know why a skeletal mesh kactor has no physics. Or maybe its just a matter of using a different class?

  21. #21
    MSgt. Shooter Person
    Join Date
    Jan 2011
    Posts
    426

    Default

    As has been stated before, use KAsset for skeletal meshes.

    For the ApplyImpulse() function just make a new class that extends KAsset and implement the ApplyImpulse() function yourself, basically copy paste it from KActor should work.

    For the problem of not seeing the SkeletalMeshComponent in the properties, you haven't even declared that the SkeletalMeshComponent should be visible in the properties
    what you have is:

    var SkeletalMeshComponent Mercedes;

    where is should be:

    var(Whatever) SkeletalMeshComponent merchedes;


 

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.