Both skeletal and vertex animated meshes can use anim notifies, however,
vertex anim notifies must be set up via UnrealScript when the model is
first imported into the package. Skeletal mesh anim notifies can be set
up at any time in the Animation Browser (do not modify default packages!).
Anim Notifies can be used to produce an action at a specific time frame of
animation. Vertex animated notifies can only be used to execute an UnrealScript
function, however the function itself could then be used to spawn an effect or
play a sound etc... The skeletal mesh notifications can be used to execute 8 different types of
effects or actions including playing sounds, spawning effects and executing UnrealScript functions. This
is especially useful when working with monsters as it allows us to spawn
projectiles and other effects when the monster plays the correct animation
sequence.
Anim notifies are commonly used to play sounds when feet "touch" the ground.
Monsters can also use this to make them more realistic.
To use anim notifies with Vertex Meshes you need to include the information with the model and animation files when they are first imported. When importing the files simply add the following lines after the #Exec MESH SEQUENCE commands. Vertex Mesh Import Commands
#Exec MESH NOTIFY parameters:
| MESH | The name of the mesh the sequence resides in, which we wish to add a notify for. | Optional: No |
| SEQ | The name of the sequence we want to create a notify for. | Optional: No |
| TIME |
This is where to place the notify. The range is 0 to 1. To find the correct value the math is:
Frame / TotalFrames So if you wanted to place a notify on frame 1.58 (of a 26 frame total animation) you would put 0.06. | Optional: No |
| FUNCTION | The name of the function that will be called for this notify. This function should exist within the actor that has this mesh when its drawtype is DT_Mesh. | Optional: No |
#Exec MESH NOTIFY MESH=MyMesh SEQ=Attack02 TIME=0.5 FUNCTION=FireProjectile
Anim notifies are set at specific times during the animations in the animation browser. These notifies call special events.
Notify Types Overview
|
Variable
|
Description
|
DataType
|
| EffectClass | Effect class type to spawn | Class (Actor) |
| Bone | Name of the bone to attach to, or spawn at (if any) | Name |
| OffsetLocation | Offset from the actor's location (or bone) | Vector |
| OffsetRotation | Offset from the actor's rotation (or bone) | Rotator |
| Attach | Whether or not to attach to the bone | Boolean |
| Tag | Tag to use on the effect (for later destroying) | Name |
| DrawScale | Scale of the effect | Float |
| DrawScale3D | Axis scale of the effect | Vector |
|
Variable
|
Description
|
DataType
|
| DestroyTag | Tag of the effect to destroy (set by AnimNotify_Effect) | Name |
| bExpireParticles | If effect is an emitter let all particle die before destroying | Boolean |
|
Variable
|
Description
|
DataType
|
| Sound | Name of the sound to be played | Sound |
| Volume | Volume of the sound | Float |
| Radius | Radius of the sound | Integer |
|
Variable
|
Description
|
DataType
|
| NotifyName | Name of the script function to call | Name |
|
Variable
|
Description
|
DataType
|
| SubAction | Matinee subaction to perform | MatSubAction (editinline) |
|
Variable
|
Description
|
DataType
|
| EventName | Name of the actor's tag that you wish to trigger | Name |
The remaining 2 notify types (LIPSinc and FireWeapon) can be ignored. They were most likely created specifically for some matinees.
For more information read this page. AnimNotifies - UDN
For this tutorial I will be using the Magdalena skeletal mesh and I will be making it call the FireProjectile function using an anim nofiy. Remember to rename and save your package to something unique or you will get version mismatch errors.
Adding a Notify
Open your desired animation file in the animation browser. Go to File>Open> open your new file. Next find the animation you want your monster/model to use when it fires its projectile. In this case for Magdalena I chose the "Gesture_Taunt01" animation.
Move the slider at the bottom until it is at the point when you want it to fire a projectile. In this case around frame 26 seems good. When this is at the correct place click on the Notify tab on the right of the window.

Click "Add" at the top, in the Notify tab. This will add a new notify at the current frame.
Expand the new Notify button, select AnimNotify_Script in the "New" section and hit "New" on the right hand side.
Under NotifyName put the name of the function in our monsters.uc file that we want it to call. In this case input "FireProjectile" without the quotation marks.
Ok, now save the file. Go to File>Save, hit Yes to overwrite. All that remains is to ensure the script for the monster has the correct function and that the animation that executes it is played at some point. For a monster, the animation would probably be played in RangdAttack(Actor A).
So now whenever that animation is played it will try to call the FireProjectile function at the frame we specified. If the function doesn't exist nothing will happen.//very simple rangedattack function simply showing the animation being played function RangedAttack(Actor A) { if ( bShotAnim ) { return; } bShotAnim=true; if ( Velocity == vect(0,0,0) ) { SetAnimAction('Gesture_Taunt01'); Controller.bPreparingMove = true; Acceleration = vect(0,0,0); } } function FireProjectile() {//spawn projectile }
