From Valve Developer Community
Revision as of 02:36, 8 November 2007 by Beeswax (talk | contribs)

(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search

$sequence options

activity (activity_name) (weight)
  • This command binds the sequence to an activity name. An activity name is an alias for one or more sequences that the code can use.
  • The advantage to using activities is that the modeler can bind multiple sequences to one activity name, thus getting some variation in the animations the model plays without programmer intervention. For example, the modeler could create three idle animations and bind them all to ACT_IDLE. The programmer only has to write code saying to play ACT_IDLE, and one of the three idle sequences will be chosen.
  • The second parameter, activity_name, must be an activity in the programmer's activity tables (in ai_activity.cpp and activitylist.cpp).
  • The third parameter, weight, controls how often this sequence will be chosen versus other sequences bound to the same activity name. Sequences with higher weights will be chosen more often. For example, if you had a sequence called "idle1" with a weight of 1 and a sequence called "idle2" with a weight of 2, then "idle2" would have twice the chance of being played when the model is told to play ACT_IDLE.
  • If you only have one sequence for an activity, you can set the weight to -1 for a slight preformance boost.
  • The sequence is automatically added at the end of the bone setup during playback, after all other sequences have been composited together. These sequences are usually "delta" sequences, but they don’t have to be. If the model has multiple autoplay sequences, they’re added in the order they appear in the QC file.
  • The easiest way to think of these are that they’re just fancy bonecontrollers, but ones that have multiple bones. Autoplay sequences are only played at a cycle/frame index of 0.
addlayer (sequence)
  • Automatically composites another sequence on top of the current sequence, before it’s composited on top of the current bone setup. The cycle index of this new sequence is the same as the current sequence.
blendlayer (sequence) (start) (peak) (tail) (end) [spline] [xfade]
  • Similar to addlayer, but the layer is only composited over the specified frames. The "spline" option coverts the linear fade in (start to peak) and fade out (tail to end) to a spline curve.
  • The compliment to the "subtract" command, this tells the animation compositing system to "add" this sequence on top of the current bone setup instead of overriding each bones’ animation based on the typical cross-fade weighting scheme.
  • The compliment to the "presubtract" command, this tells the animation compositing system to add the current bone setup on top of a different frame of reference instead of overriding each bones’ animation based on the typical cross-fade weighting scheme.
  • Remove all blending when transitioning to this animation. This is useful for reaction animations that are the result of sudden and violent changes in the models state such as flinching for creatures or shooting for weapons.
  • Ignore the cycle clock, play the sequence off of the real-time system clock. Useful when adding layers that need to not be cycle locked to their parent sequence.
fadein (time)
  • Override default 0.2 second blend with specified time when transitioning to this animation.
fadeout (time)
  • Override default 0.2 second blend with specified time when transitioning from this animation.
blendwidth (width)
  • Instead of just 1x1, 2x1, 3x1, 2x2, and 3x3 blends, by blending width, you can now have any size rectangular blends such as 7x1, 3x4, 2x9, etc.
blend (name) (min) (max)
  • You can have up to 8 unique parameters.
node (name)
  • Tags the sequence as belonging to a point on the sequence transition graph table. This is for animations which don’t change graph state, such as looping animations. Multiple sequences can be at the same entry in the graph table, at which point they won’t need transition animations be move between each other. Alternatively, you can have them at different points and expressly skip transitions (see $skiptransition). Sequences with no declaration are assumed at the root node and the transition graph assumes any sequence can move from the root node or to the root node without a intermediate transition.
transition (from) (to)
  • This specifies that the animation enters from one point on the node graph and exits at another point. This is used to play transitional sequences such as walk_to_stand, run_to_crouch, etc.
rtransition (name1) (name2)
  • Same as transition, but flags the sequence as able to be run in reverse order. This was used by the tentacle in HL1 but I don’t recommend it be used expect in special cases.
exitphase (phase)
  • When transitioning between looping animations, such as "stand_to_run", this tells the movement system where to start the next sequence, assuming it’s looping. It’s also assumed that you’ve made all the sequences that share the next node to be phase matched (see startloop).
$skiptransition (name1) (name2) [(name3) ...]
  • This adds a rule to the transition graph to allow direct movement between all the named nodes. This is useful for transitions between unique named nodes that that may not require any specific intermediate animation. This is how to avoid the transition graph from forcing "walk" to "run" to instead be a "walk" to "stand" to "run" transition.
keyvalues { [stuff] }
  • Add a keyvalue block (see $keyvalues) to a specific sequence.