Results 1 to 4 of 4
  1. #1

    Default Animated Projectiles [Solved]

    EDIT:
    *Problems with animated projectiles such as ..[below]..-
    ... can be solved by correctly referencing you animtree -LOOOOOL


    - Has anyone ever made a weapon with animated projectiles?
    - if so, please provide some help/ information, or a link...

    - i have used the search function and spent a few days compiling/ searching... but had no luck.

    - the only weapon i can think of with Animated projectiles - is the "SpiderMines" - but this creates some inherant problems [projectiles run along floor lol]


    - I am trying to improve my existing weapon [Homing Pigeon & SuperSheep]; by replacing the static mesh projectiles for - 'animated skeletal mesh'

    - here is as much code as i could find that might help me.
    Code:
    class UTProj_HP2 extends UTProj_AvrilRocket;
    
    var SkeletalMeshComponent mesh;
    var bool bplayed;
    var Name AnimSetName;
    //var AnimName MyAnimation;
    
    
    /** Helper to allow quick access to playing deploy animations */
    var AnimNodeSequence    AnimPlayControl;
    
    //Native Function PostBeginPlay()// 
    simulated function PostBeginPlay()
    {
    	//if (Role < ROLE_Authority && Physics == PHYS_None)
    	
    	//{
    	//	bProjTarget = true;
    	//	GotoState('AnimatedProjectile');
    	//}
            
    	Super.PostBeginPlay();
            AnimPlayControl = AnimNodeSequence(Mesh.Animations.FindAnimNode('FlySoar2'));//AnimTree
    	//PlayCustomAnim('FlySoar2', 1.0);
    }
    
    
    simulated event Tick( float DeltaTime )
    {
        super.Tick(DeltaTime);
    
        if(AnimPlayControl != none){
                    //`log("ANIM RATE " $ AnimPlayControl.Rate);
                    //`log("ANIM GetAnimPlaybackLength " $ AnimPlayControl.GetAnimPlaybackLength());
                    if(AnimPlayControl.bPlaying == false){
                            AnimPlayControl.SetAnim(AnimSetName);
                            AnimPlayControl.PlayAnim(false,0.01,0);//loop play, animation speed, start animation frame
                    }
                    //`log("time left " $ AnimPlayControl.GetTimeLeft());
        }
    }
    
    //function FlySoar2
    //
    //{
    //setanimaction.('FlySoar2')
    //PlayCustomAnim
    //}
    
    //final native function float PlayCustomAnim (name AnimName, float Rate, optional float BlendInTime, optional float BlendOutTime, optional bool bLooping, //optional bool bOverride)
    //{
    //Animsets.AnimName()
    //}
    
    //native function PlayAnimation(name Sequence, float SeqRate, bool bSeqLoop);
    //native function PlayAnimationSet(array<name> Sequences, float SeqRate, bool bLoopLast);
    //{
    	//Super.PlayAnim();
    
    	//if (bAutoStart)
    	//{
    	//	PlayAnim('FlySoar2','bLooping, Rate);
    	//}
    //}
    
    simulated function PlayFlyingAnimation(AnimNodeSequence SeqNode)
    {
       // Play Flyinganimation
       SeqNode.SetAnim('FlySoar2');
       SeqNode.PlayAnim(false, 1.f);
    
       // Turn on Root Motion on Animation node
       //SeqNode.RootBoneOption[0] = RBA_Translate;
       //SeqNode.RootBoneOption[1] = RBA_Translate;
       //SeqNode.RootBoneOption[2] = RBA_Translate;
    
       // Tell animation node to notify actor when animation is done playing
       //SeqNode.bCauseActorAnimEnd = TRUE;
    
       // Tell mesh to use Root Motion to translate the actor
       //Pawn.Mesh.RootMotionMode = RMM_Translate;
    
       // Tell mesh to notify us when root motion will be applied,
       // so we can seamlessly transition from physics movement to animation movement
      //Pawn.Mesh.bRootMotionModeChangeNotify = TRUE;
    }
    
    defaultproperties
    {
    	//MyAnimation=FlySoar2
            AnimSetName=FlySoar2
            Begin Object class=SkeletalMeshComponent Name=MeshFrame
                    SkeletalMesh=SkeletalMesh'WP_HomingPigeon.SkeletalMesh.SP_Bird1_SKMesh'
                    AnimSets.Add(AnimSet'WP_HomingPigeon.AnimSet.FlySoar2')
                    //AnimTreeTemplate=AnimTree'VHUTM_MechProtypeWalker.mecharm_minigun_animtree'
            End Object
    
            CollisionComponent=MeshFrame
            mesh=MeshFrame
            Components.Add(MeshFrame)
    
    	Begin Object class=AnimNodeSequence Name=MeshSequenceA
    	//how to set code for an animnodesequence?
    	//do i need an animnodesequence in my upk?
    	End Object
    
    	//dynamic object needs to be lit
    	//Begin Object Class=MyLightEnvironment Name=MyLightEnvironment
    	//	ModShadowFadeoutTime=1.0
    	//	AmbientGlow=(R=0.4,G=0.4,B=0.4)
    	//End Object
    	//Components.Add(MyLightEnvironment)
    	
    	//Begin Object Class=MeshComponentA Name=MeshComponentA
    	//	SkeletalMesh=SkeletalMesh'WP_HomingPigeon.SkeletalMesh.SP_Bird1_SKMesh'
    	//	Materials(0)=Material'WP_HomingPigeon.Materials.Bird_Mat'
    	//	AnimSets(0)=AnimSet'WP_HomingPigeon.AnimSet.FlySoar2'
    	//	Animations=MeshSequenceA
    	//	AlwaysLoadOnClient=true
    	//	AlwaysLoadOnServer=true
    	//	Translation=(Z=-11.0)
    	//	bUseAsOccluder=FALSE
    	//	bUpdateSkelWhenNotRendered=false
    	//	bAcceptsDecals=false
    	//	CastShadow=true
    	//	LightEnvironment=MyLightEnvironment
    	//	CullDistance=8000.0
    	//End Object
    	//Mesh=MeshComponentA
    	//Components.Add(MeshComponentA)
    	
    	//skeletal mesh collision
    	Begin Object Name=CollisionCylinder
    		CollisionRadius=10
    		CollisionHeight=10
    		CollideActors=True
    	End Object
    
    	ProjExplosionTemplate=ParticleSystem'WP_HomingPigeon.Particles.P_WP_Avril_Explo_mid'
    	ProjFlightTemplate=ParticleSystem'WP_HomingPigeon.Particles.P_WP_HomingPigeon_SmokeTrail'
    	ExplosionSound=SoundCue'WP_HomingPigeon.Sounds.PigeonReleaseCue'
    	ExplosionLightClass=class'UTGame.UTRocketExplosionLight'
    	
    	//Begin Object Class=AmbientAudio Name=AmbientAudio
    	//	bShouldRemainActiveIfDropped=true
    	//	bStopWhenOwnerDestroyed=true
    	//	SoundCue=SoundCue'WP_HomingPigeon.Sounds.PigeonFlyingCue'
    	//End Object
    	//WalkingSoundComponent=AmbientAudio
    	//Components.Add(AmbientAudio)
    
    	//Begin Object Class=AttackScreech Name=AttackScreech
    	//	bShouldRemainActiveIfDropped=false
    	//	bStopWhenOwnerDestroyed=true
    	//	bAllowSpatialization=true
    	//	SoundCue=SoundCue'WP_HomingPigeon.Sounds.DrawPigeonCue'
    	//End Object
    	//AttackScreechSoundComponent=AttackScreech
    	//Components.Add(AttackScreech)
    
    }
    - please ignore the sounds/ audio components etc- they are from the spidermines and not implemented yet
    - basically when a projectile is fired - how do i activate the animation.?
    Init?
    Onit?
    Function / event?
    setanim?
    animsets.add?
    playcustomanim?
    - lol i suck at this stuff!!!

    p.s.

    * the problem might be a UPK problem not a code problem -- is that a good assumption?

    - i find it hard to believe that Rattlesn4k3 is the only person who can code -- please - someone else make an effort to help.
    - Thousands of people post for help and then never return -- show some Reciprocity PLEASE!!
    Last edited by TKBS; 06-03-2012 at 03:58 PM.

  2. #2
    MSgt. Shooter Person
    Join Date
    Jun 2009
    Posts
    400

    Default

    Quote Originally Posted by TKBS View Post
    - Has anyone ever made a weapon with animated projectiles?
    Check UTProj_BioGlob. The projetile which the BioRifle will shoot for the alternate fire.
    Animset is set in the defaultpropetiers. "Shake2" is an animation of the animation set in "WP_BioRifle.Anims.Bio_Alt_Blob_Projectile_Sha ke".

    Anyway, i don't think you want my help.

    Quote Originally Posted by TKBS View Post
    - basically when a projectile is fired - how do i activate the animation.?
    Code:
    simulated function PostBeginPlay()
    {
        Super.PostBeginPlay();
    
        if (SkeletalMeshComponent(Mesh) != None)
        {
            SkeletalMeshComponent(Mesh).PlayAnim(AnimSetName,,true);
        }
    }
    Quote Originally Posted by TKBS View Post
    * the problem might be a UPK problem not a code problem -- is that a good assumption?
    Yes. As you're using a AnimTree, check if it is configured properly.


    Regarding your code:
    The animation speed is really low. So it might be the case you're not seeing the animation is running due to slow animation.

  3. #3

    Default

    Thank you rattleSN4K3-
    -
    Anyway, i don't think you want my help.
    ?- i think you misunderstand, i just find it hard to believe only you know this stuff.
    - i have seen you help peopel with better coding skills/ knowledge than me- they take your help and then we never see them again.

    - when i learn this stuff i want to give back to the community .

    P.S
    i have no idea how it worked- but i increased my "0.01f" - to - "1.o" [speed right??]
    and then did this....

    - The line that made it work was this.....
    Code:
    AnimTreeTemplate=AnimTree'WP_HomingPigeon.AnimTree.FlySoar2'
    - i cannot believe i actually had everything i need staring me in the face- but i did not remove the "//" LOL
    - like i said: BIG Thank you - even though i did not use your code - the input was just right

    P.P.S Your skeletal mesh function code gave me this log
    "refernce to 'skeletalmeshcomponent' is unneccessary" <
    Last edited by TKBS; 06-03-2012 at 03:59 PM.

  4. #4
    MSgt. Shooter Person
    Join Date
    Jun 2009
    Posts
    400

    Default

    Great to know.

    Quote Originally Posted by TKBS View Post
    P.P.S Your skeletal mesh function code gave me this log
    "refernce to 'skeletalmeshcomponent' is unneccessary" <
    Oh yes.
    The code i took that snippet from (UTProj_BioGlob) used a MeshCompoenent as storing variable but you're using the SkeletalMeshComponent.
    Code:
    var MeshComponent GooMesh;
    Casting the variable is not need.
    Code:
    Mesh.PlayAnim(AnimSetName,,true);


 

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.