Author Topic: Simple tutorial to add effects to animations  (Read 907 times)

0 Members and 1 Guest are viewing this topic.

Online Bumbleguppy

  • Forum Moderator
  • Full Member
  • *
  • Topic Author
  • Posts: 339
  • Country: us
  • Karma: +17/-0
    • View Profile
    • Awards
Simple tutorial to add effects to animations
« on: 02 February 2018, 00:24:25 »
Do you know what an AIF file is? I don't.

Are you an expert with 3DSMax? I haven't touched it in 15 years. I downloaded Blender, but the learning curve is too steep for what I want to do (or what I am capable of lol).

DISCLAIMER: This method bypasses the ArtManager's source/asset functionality. Every time you do a fresh build of your mod after using this method, the ArtManager will ask if you want to delete the unassociated resource that is the animation you added. Just click no every time. It's annoying, but if you aren't a real developer and just want quick and dirty, it's a small price to pay.


I am assuming you are familiar with ArtManager and other tools already.

So here is the poor (or dumb like me) person's way to add a particle effect to an animation.

Here's the example. There is now a Saberlion Hero since Anniversary Edition, Creatures/Monsters/Saberlion/um_saberlion.dbr, and I want to give it an ice breath skill.

You could make it a wave and add a line effect to the skill file, but why do that when you can get a genuine looking breath effect? So let's add a snow breath effect animation to the Sabrelion.

We will need the animation files in a bit. Use ArcExplorer to extract the creature meshes and animation files somewhere.

Navigate to Creatures/Saberion/Saberlion01.msh in your Viewer.exe located in your install directory for TQ.

Here's the saberlion with the menu bar ->View/Attach Points enabled. Attach points are arbitrary points on the mesh usually attached to a "bone" in the mesh but always specified with an alignement to the mesh or bone XYZ alignment. Here is the Viewer.exe result of the Saberlion mesh using it's native "saberlion_attalpha.anm" animation. I have highlighted the "HeadEffect" attach point using the menu bar -> Select... -> HeadEffect -> Select.




Now the Ice Sprite already has an animation with a baked in ice breath particle effect, let's just use that? What the...?




You can use that if you want, but that's not what I am envisioning. :)

Here's the ice sprite in the Viewer.exe. Notice I have selected "HeadEffect" attach point again (which is important to know later) and it is highlighted. Now also look closely and notice the three arrows in the white box of the highlighted attachment? Those are the X,Y,Z axis of the attach point. Notice the green one? That is the "Y" axis. These colors match the colors in the PSEditor's three XYZ axis, too.




Here is the effect that the ice sprite frost breath animation calls in the PSEditor. Notice that it flows along the green "Y" axis? When it is attached in the animation file to the ice sprite "HeadEffect", the effect will orient itself to the attach point of the mesh. So if the effect is along the "Y" axis and the attach point is aligned with the "Y" axis facing the player, everything looks great.




Now navigate to Creatures/Monsters/Sprite/anm/spriteice_skill_castprojectile.anm. Open it with a GOOD text editor. I am using Notepad++ because it works and it's free. Here's what we see:




Scroll all the way to the bottom and see all the callback point stuff like "RightHandHit", "SwipeRight" etc. There is the entry I am looking for "CreateEntity". That's the language to add something to the animation from outside like an effect. Highlight and copy the CreateEntity and everything between the following braces { }.


Now navigate to Creatures/Monsters/Saberlion/anm/saberlion_attalpha.anm, this is the animation I chose to use. You could use any, but this looks more like a breath attack so I am using this one. Open this in your text editor and scroll all the way to the bottom.

Place your cursor at the the last place in the file and create a new line there. Paste the CreateEntity stuff you copied from the ice sprite animation.


Notice I matched the "frame" in the CreateEntity part with the moment in the animation I want it to go off, in this case it's the RightHandHit callback point.


Now, save the saberlion animation file somewhere making sure to maintain the ".anm" file extension.


Remember, this is the poor (or dumb) person's way. Not the RIGHT way, whatever that is. If I knew that, I wouldn't be writing this tutorial.

Copy and paste your new animation NOT in your working directory, but in the Documents/My Games/CustomMaps/YourMod/Resources/Whatever folder of your existing mod, e.g. Creatures/Monsters/Saberlion/anm/.


Open up your existing mod in Art Manager. In the menubar, select "Archive" -> "Build". This automagically injects your animation file into your compiled mod's .arc file that matches the directory in the Resources that you pasted the animation into. This is not the usual build command, I have only ever used the "Archive->Build" for doing this.

Now go to the Saberlion animation directory in Art Manager. Creatures/Monsters/Saberlion/anm. Open the "anm_saberlion.dbr" file.

In the All Groups -> Animation Sets -> Unarmed tab scroll down to "unarmedSpecialAnim1" row. Double click in the 4th column and click the "...". Navigate to the new animation you just archived and select it.

Two rows below that is the unarmedSpecialRef1 slot. In the fourth column enter "Icebreath". Remember the case, it doesn't matter what it is as long as it's the same wherever you use it later.

In the skill file that the ice sprite's use "Records\Skills\Monster Skills\Attack_Projectile\IceSprite_FreezingBlast.dbr", there is an entry to add Skill Config -> skillSpecialAnimationName. Enter "Icebreath" here as well. Don't worry, the ice sprites will still use their animations because it is their default for spellcasting in this case. That could cause problems sharing a monster skill between monsters, but just be careful and check. You could always copy the ice sprite skill and give it another name no problem.


In the Saberlion Hero's (Creatures/Monsters/Saberlion/um_saberlion.dbr) skill tree enter the ice sprite breath skill. Enter it in the saber lion's skill config as you wish.

Build your mod.

Bam. Saberlion hero has ice breath now.
« Last Edit: 02 February 2018, 00:43:56 by Bumbleguppy »

Online nargil66

  • Forum Moderator
  • Full Member
  • *
  • Posts: 852
  • Country: bg
  • Karma: +9/-0
  • Gender: Male
    • View Profile
    • Awards
  • Time Zone: ?
Re: Simple tutorial to add effects to animations
« Reply #1 on: 21 November 2018, 06:01:01 »
I tried to attach bone scourge projectiles to orthus breath animation and use it for the stygian hound pet. This is what happened :(:
Spoiler for Hiden:
I bet i do several mistakes at the same time... can you help?

Online Bumbleguppy

  • Forum Moderator
  • Full Member
  • *
  • Topic Author
  • Posts: 339
  • Country: us
  • Karma: +17/-0
    • View Profile
    • Awards
Re: Simple tutorial to add effects to animations
« Reply #2 on: 21 November 2018, 14:29:48 »
I think I can help...

First, what are you trying to achieve? If you are trying to make a spirit breath effect, you need to go into the effect editor and play around with the orthrus fire breath effect, which I think in this case is simply borrowed from Yaou Guai. Make it teal colored, add some ghost textures spitting out, get creative. I've attached an example effect file I used for a "spirit breath" in a mod before to get you started.

Then import that new particle effect into your mod, add it to an effect file and substitute that effect file .dbr's path in the existing text portion of the orthrus animation file's effect file path. Then save that animation file to your mods resources and then use the "archive" command in art manager.

The only way to attach MESH to an animation file I am aware of is to use the "prop" mechanic.

Check out malepc_bow_skill_callofthehunt.anm and you will see what I mean. The monster/player skill file will hold the reference to the mesh as a "prop" file which uses it's own unique "prop" template. The animation will call the mesh with the "SkillProp1Add" and "SkillProp1Remove" commands.

Online nargil66

  • Forum Moderator
  • Full Member
  • *
  • Posts: 852
  • Country: bg
  • Karma: +9/-0
  • Gender: Male
    • View Profile
    • Awards
  • Time Zone: ?
Re: Simple tutorial to add effects to animations
« Reply #3 on: 21 November 2018, 18:20:35 »
Ah, I see. But the Orthus attack is only in melee range, not what i need. What i was trying to do is make it cast several spirit projectiles at a long distance, and somehow it "looks" they are coming from his mouth.
I have similar problem with the empusa summon - i made a 3 projectiles skill (faking ternion) and tried to force it use staff_attalpha animation, but the projectiles are coming from her legs, no matter what i do. Her staff is attached, but she uses staff attack for unarmed and for special "Spit" anim.

Online Bumbleguppy

  • Forum Moderator
  • Full Member
  • *
  • Topic Author
  • Posts: 339
  • Country: us
  • Karma: +17/-0
    • View Profile
    • Awards
Re: Simple tutorial to add effects to animations
« Reply #4 on: 21 November 2018, 18:36:33 »
Oh okay, I see now.

Look at the empusa staff attack animation. See how the animation has
Code: [Select]
CallbackPoint
{
name = "LeftHandHit"
frame = 18
}

I think the commands "LeftHandHit" and "RightHandHit" are in the game engine and are used with weapons.

You can have the animation proc from an attach point simply by listing it. Check the monsters that don't use weapons animations, their animations call attach points on the hit frame.

In the empusa animation for staff, change that line to

Code: [Select]
CallbackPoint
{
name = "L Hand"
frame = 18
}

so it comes from an attach point and not the weapon that she clearly doesn't have.

EDIT: Also look at the AE Liche King mesh, he has an attach point on the end of his staff, maybe you can use those attach point coordinates for the empusa mesh.
« Last Edit: 21 November 2018, 18:46:50 by Bumbleguppy »

Online Bumbleguppy

  • Forum Moderator
  • Full Member
  • *
  • Topic Author
  • Posts: 339
  • Country: us
  • Karma: +17/-0
    • View Profile
    • Awards
Re: Simple tutorial to add effects to animations
« Reply #5 on: 21 November 2018, 18:48:58 »
As far as the Orthru, you can still use the breathe fire animation, simply remove the effect attachEntity code from the animation and save.

Make sure that the attach point listed for the hit fram is the one closest to his mouth, and your projectile skill will come from there, easy peasy.

Online nargil66

  • Forum Moderator
  • Full Member
  • *
  • Posts: 852
  • Country: bg
  • Karma: +9/-0
  • Gender: Male
    • View Profile
    • Awards
  • Time Zone: ?
Re: Simple tutorial to add effects to animations
« Reply #6 on: 21 November 2018, 20:22:27 »
I tried the "L Hand" method and the projectiles were still coming from her legs... But i figured it out. The problem was the skill template. It seems AttackProjectileFan doesnt work. Chanded it to "burst" and it sudenly worked! Then i tried using back the default empusa staff animation - the projectiles are coming from her staff :D

Spoiler for Hiden:
Maybe the projectile attach point for staff attack are in the animation, no matter if its equipped or not.
Edit: The hound is still stubborn though. When i removed the AttachEntity, the animation remained glitched. Then i tried using the default bone scourge blast animation both on SpellAttackAnimation and SpecialAttack parameters. It is not glitched, but only sound appears with no proectiles. Replaced his petskill with bone scourge spirit blast... nothing.
« Last Edit: 21 November 2018, 21:45:16 by nargil66 »

Tags: