How do you implament Animtree with a weapon? And how would you make the weapon animations go at random?
How do you implament Animtree with a weapon? And how would you make the weapon animations go at random?
Look at UTWeap_RocketLauncher_Content.uc & AnimNodeRandom.
Kris RedbeardGROUND BRANCHRule #11: Always cheat, always win. The only unfair fight is the one you lose.
Mature Classic Tactical First Person Shooter
I looked, it doesn't help. But thanks for your help anyway.
Last edited by darkgundam55; 03-12-2011 at 12:44 AM.
Ok... not sure why it didn't help you.
The rocket launcher implements a basic animtree with the first person weapon mesh of a weapon.
As for the AnimNodeRandom, it is specifically designed to play random animations.Code:Begin Object Name=FirstPersonMesh SkeletalMesh=SkeletalMesh'WP_RocketLauncher.Mesh.SK_WP_RocketLauncher_1P' PhysicsAsset=None AnimTreeTemplate=AnimTree'WP_RocketLauncher.Anims.AT_WP_RocketLauncher_1P_Base' AnimSets(0)=AnimSet'WP_RocketLauncher.Anims.K_WP_RocketLauncher_1P_Base'
Do you mean something else?
How to access the animtree or its nodes?
How to build one?
Making one is the same any other model, via the UDK editor.
It does not have to be model specific - you can use a single animtree multiple times as long as the animation names are the same (fire, fire_slideback, reload etc).
You can access the animtree by looking for an nodes or controls attached to the mesh.
You can see this in UTWeap_RocketLauncher.uc for hiding the rockets:
Code://Give the name of a skelcontrol, turn the control on or off which sets BoneScale to 0 or 1 simulated function HideRocket(name RocketName, bool ShouldHide) { local SkelControlSingleBone SkelControl; //Choose to hide or unhide a rocket by name SkelControl = SkelControlSingleBone(SkeletonFirstPersonMesh.FindSkelControl(RocketName)); if(SkelControl != none) { //`log(ShouldHide?"Hiding"@RocketName:"Unhiding"@RocketName); SkelControl.SetSkelControlStrength(ShouldHide?1.0f:0.0f, 0.0f); } }
Kris RedbeardGROUND BRANCHRule #11: Always cheat, always win. The only unfair fight is the one you lose.
Mature Classic Tactical First Person Shooter
Well, I know how to build the Animtree and where to put it in the code. I want it so a different animation will play whenever I fire. I tried the Animtree random node and I put it in the code, but it still doesn't work.
Create a AnimNodeBlendList attached to mutiple sequence nodes.
Randomly pick a child index.
Play the sequence node attached to that child.
A custom animation that does this for you would be even better.
You would only have to attach different sequences then and
tell the animation node to simply play.
Surprised AnimNodeRandom doesn't have an option for this
Kris RedbeardGROUND BRANCHRule #11: Always cheat, always win. The only unfair fight is the one you lose.
Mature Classic Tactical First Person Shooter
I know this thread is old, but in the off chance that someone will see this. I need help with this same issue. I am trying to play an additive animation from my weapon class and all attempts thus far have failed. My AnimTree won't initialized in the weapon class. So my question is how do you, or can you, access AnimNodes from a weapon class. Is there a way to call "AnimNodeSlot" or "AnimNodeAdditiveBlending" in the weapon class with out having to initialize the AnimTree with "PostInitAnimTree"?
I have looked at the UTWeap_RocketLauncher_Content.uc but they are just calling skeletal controls, and there isn't any examples of how to call AnimNodes from the weapon class.
Thanks in advance for any help with this topic, if this thread get viewed again. I can also post code if needed if this post is seen, lol!
Hey many thanks, slowJusko, for your in-depth explanation and code - and I'm sure you helped out many other Australians too
@sidtone415 I'm no expert, just a fumbling modder! But my UDK weapons were done using old anims / weapons I made for UTk4, just improved textures and all work fine - no animtrees. I used an animtree for a tank mg -with mg hammer and bullet strap moving.
@Snipe34 my weapons use normal animations as well, but the tutorial I used to set up my arm mesh is weird and renders the arms as a weapon. So I am trying to figure out if weapons can use animtree's and if they can how to get postinitanimtree to initialize them.
I guess mine is a weird situation...
@Snipe34 my weapons use normal animations as well, but the tutorial I used to set up my arm mesh is weird and renders the arms as a weapon. So I am trying to figure out if weapons can use animtree's and if they can how to get postinitanimtree to initialize them.
I guess mine is a weird situation...
Sorry dude, just saw this again (i only ticked, get informed of subscribed threads recently) - and if you're still around!
And more sorry - to answer your question you need an expert but I don't know. I have run movement holding one gun, but how to add other guns I'm still playing with animtree wires. I just don't have a whole concept of animtrees. Why doesn't it switch to the secondary weapon movement... something in code I suppose. Why have code and an animtree as well? - a dumb question I guess - the animtree simplifies code I imagine - it blends between animations... The result for me in UDK with my character anim (.fbx) is it looks rough for some reason skipping a frame so the run loops jerk slightly. I tried the start at key 0 for export as per .psk/psa, but meh. Frankly now I wish I'd rigged using legacy, rant, rant, rant... I need to go thru Wraiyth's/GeoDav's and other tuts and explanations again is all.
But presently I absolutely have no frigging idea ><
Bookmarks