Create an Alternate Power Animation

From Portal Corps
Jump to navigation Jump to search

How to change or add Animations and Effects for Existing Powers (WIP)

First things first, this guide assumes that you have a proper server setup for using loose files to make changes by following Bubble's guide

If you've got that properly set up and working, we can move from there to finding the file PFX File for the specific power you want to make changes to. The directory for player PFX files is serverdata\menu\Powers/AnimFX\PlayerPowers. Pretty much all of the player powers are under this folder, with most of them being sorted by class and effect. For Example, the effect and Animation wiring for Siphon Power for Defenders is stored in DefenderBuff_Kinetics_SiphonPower.PFX

So what is in a PFX File? PFX Files basically point to where the different parts of a single powers animations and effects live. They are subdivided into two sections (which are clearly labeled) for each variation of an ability, with one section being where the Animations (For example, the motion of a kick) are Linked, and the other one being where the FX files (For example, the flames emitted by Scorch) are linked. Each section has several attributes that can be used to alter the behavior of a powers overall appearance.

Animation Related Fields

This is where you'll find the links to the specific parts of an animation. Some powers are pretty simple, only having two or three linked animations, while others can have quite a few. Unfortunately I have been unable to locate where the animations referenced here actually live inside the data we have, but it's easy enough to simply copy the animation attributes from an ability that shares the animation you want and place it in the field of the animation you want to change. There are several fields for this animation bits and bobs but I haven't been able to figure out what they all are as of yet either.

Two fields I have figured out are the FramesBeforeHit and AttackFrames fields. FramesBeforeHit basically lays out how many frames have to pass before the HitFX .fx file is called (IE at what point in this motion does the big ole THWACK happen). AttackFrames on the other hand is how many frames it will take to play the entire animation.

FX Related Fields

The FX related fields are where the links to individual .FX files are linked. Unlike the Animation Fields, the paths for these are quite straightforward. Pretty much all of the .FX files are stored in subdirectories inside serverdata\FX with the main ones being Customizablepowers, Powers, and Weapons. Customizablepowers is exactly what it says on the tin, Powers is where all of the pre-customization update powers live, and Weapons are where Weapon power FX files live. As a note, I haven't yet had a chance to toy with Weapons too much, but they seem to be a bit different from rank and file powers in the way that they are wired.

Now, as for the fields involved, they vary heavily depending on the type of power you are changing. In general, they are have fairly straightforward names, such as HitFX (Plays when an attack hits an enemy), ActivationFX (Plays when you first click a power), ContinuingFX (Plays continually as long as the power is effecting a target), and ConditionalFX (Effects that play when a certain condition is met). Now, from what I can tell, these fields are fairly happy to take any .FX file, they merely decide how and when those effects are played. (These fields also tie into the .powers file for the power in question, but I haven't really dipped my toes into that connection yet)

Another set of fields are the default tints for a power. You will usually set these for the default version of it. They are PrimaryTint and SecondaryTint. They take a fairly standard three part RGB code with each part separated by a space. Another color related component is the Palette Field. This more or less tells decides the color palette you see for the power when in power customization. Most commonly you will just use "Additive" and "Subtractive" for bright and dark variants.

Alternate Animations

So, now that we have a vague idea of what a PFX file contains and what it's looking for, how do we use this information to make an alternate animation? Thankfully, this is actually super easy! All you have to do is place a field labeled CustomFX and a name contained in "" after the last line of the exiting fields. Place your altered Animation and FX fields after it, and follow them with an End. Tada! Alternate animation created. However, a quick (And very important!) note. If the name you put in the CustomFX field doesn't already exist in the game, you will have to regenerate your vars.attribute file or the game will not save your selection when you change your power to it's new alternate option. You can regenerate your vars by running mapserver with the properties -productionmode and -templates. As of this writing, this process will dump your new vars file under c:\CoH_Data\attributes. You'll need to manually move it to your data/server/db/templates folder and overwrite the existing vars.attribute file. If you have never done this process before it will break your cohdb SQL database so fair warning!

In the near future I will continue this article with more information about the contents of a .fx file, and information about the .part files that they heavily reference.