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.
- please ignore the sounds/ audio components etc- they are from the spidermines and not implemented yetCode: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) }
- 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!!



Reply With Quote


Bookmarks