Triggered animation is an addition to previously introduced animationBones.
They can be used in any tank parts, including chassis, hull, turret, gun.
It adds a set of new bones with any name that starts with 'actuator' and doesn't contain '_'
'_' is used to seperate boneName from boneParameters
for example 'actuator1'  or 'actuatorSpade' 

This feature allows a pre-defined skinned animation to be triggered by one of the following conditions:
# hotkey, default INSERT to execute animation, DELETE to reverse the animation, 
# onKeyShoot, triggers whenever hotkey <hotkey_fire_secondary> is pressed (BACKSLASH by default). This trigger is
  intended to animate recoil for secondary gun(s) since the same key is used to trigger the firing effect group.
  Check instruction_on_additional_gunFire_animation.txt for playing secondary gun(s) firing effect.
# onStop, triggers if own tank is stationary for more than a specified length of time (default is 3 sec)
# onShoot, triggers whenever own tank fires a shot.
# onEngineStart, triggers once per match when engine RPM goes higher than idle (20% of maximum) for the 1st time.
  If used on a non-player vehicle, moving part will be initialized to its 'end-matrix' state as if the action 
  is already completed.
# onBrake, triggers when brake or handbrake is applied.
# onReverse, triggers when tank starts reversing by its own power. 
# onLeft, triggers when tank attemps to turn left.
# onRight, triggers when tank sttempts to turn right.
# onRandom, perodically throw a dice to decide if actuator should change its state.

Aside from triggers, if '_disabled' is appended after actuator name, current bone is marked as disabled (static)

Setup is similar to instruction_on_new_animationBone.txt

Animations defined in this feature always come in pairs, the forward animation and reversed animation. 

------------------------------------------------------------------------------------------------------------
[how to use]
1.  Rebuild gun/turret/hull model normally in 3dsmax as if you are exporting a standard gun/turret/hull remodel for WoT.
    That means aligning your geometry properly, insert all the essential nodes (for gun it's [Gun, G, HP_gunFire]),
    add 'skin' modifier to any skinned parts, assign binding weights accordingly, etc.
    It may be a good practice to link 'Gun' node to root node 'nodes_01' which seems to be the general
    practice for all recent stock WoT models.
2.  add new dummy helpers with their names starting with 'actuator' but doesn't contain '_'. Place them 
    at initial position/orientation of your intended animation sequence. These nodes will serve as animation
    bones to be used in skin modifier.
    examples of valid names: actuator1 actuatorSpade
#   be careful where you link these nodes into. The hierarchy matters. If it's placed under 'Gun' node, this
    bone will elevate with barrel. If placed under 'static_joint_hull', its animation will be relative to hull. etc.
3.  add new dummy helpers with the same name as step2 but ends with '_end'. 
    These nodes are used to mark end-frame position/orientation/scaling of bones created in step2, so should
    be placed at the final position of your intended animation sequence, with orientation/scaling matching
    desired final state. They should be in the same hierarchy level as the actual bone node created in step2. 
    When an animation is triggered, animation bone in step2 will translate/rotate/scale to mimic the state
    of the node created here at step3
    example of valid names: actuator1_end  actuatorSpade_end
4.  if you want skinned animation, add "skinned" modifier to model mesh with bones created in step2, set binding weights as normally would.
    if you do not want skinned animation(for example you want to use glow.fx which do not have a skinned shader variant, 
    or it's simple rigid movement animation that could do w/o skinning it), then leave it as it is.
5.  export normally. Replace primitiveGroup definition in visual file with WoT standard shaders as your normally 
    would for normal wot remodel.

    [Important!!] when choosing visual type during export, no matter if you are working on static object like hull or 
skinned object like gun, always choose "animated, skinned(Bones, rigged)". Because only in this format the realtime 
manipulation of bone by UML can be registered, probably due to BigWorld engine optimization routine.

6.  Manually edit bone name in the final visual file to store additional control information. detail in the next section.
------------------------------------------------------------------------------------------------------------
An example of linked actuator nodes hierarchy in 3dsmax project file

nodes_01
|           \             \                 \	  
Gun     actuator1    actuator1_end     static_joint_hull
|                                      /          \
G		                  actuator2 actuator2_end
|                                  /    \
HP_gunFire                actuator3   actuator3_end

------------------------------------------------------------------------------------------------------------
[In the next section, bonename will be assumed to be 'actuator1' and end-matrix node 'actuator1_end']
Any animation created with actuator is paired. The forward animation will transit actuator1 to mimic actuator1_end
while the reversed animation will move backward from the state of actuator1_end to mimic the initial state of actuator1

------------------------------------------------------------------------------------------------------------
[to pass parameters to game via changing node name in gun*.visual or gun*.visual_processed]

This step is done by editing visual/visual_processed file after project file's been exported into [.model+.primitives+.visual]. 
Instructions in this section is not meant for editing 3dsmax project file.

To config animation, one should look for the following patter in your exported gun visual file:
<node> 
    <identifier> actuator1 </identifier>
    ...
</node>
<node> 
    <identifier> actuator1_end </identifier>
    ...
</node>

To config forward animation, change the name 'actuator1' according to following rules:
  1. select a trigger. 
      #default is trigger by hotkey. No editing required. Forward animation will be played when ForwardAnimationHotkey 
       (INSERT by default) is pressed while reverse animation will be triggered by ReverseAnimationHotkey (DELETE by default)
      #trigger both forward and reverse animation by firing a shot, append '_onShoot' to the end of original bonename.
       For example, 'actuator1_onShoot'
       Note: play both forward and reverse simultaneously may sounds meaningless, but each can have a 'delay' 
             parameters to space them out. more in the following sections.
      #trigger both forward and reverse animation when <hotkey_fire_secondary>(BACKSPACE by default) is pressed, append 
       '_onKeyShoot' to the end of original bonename.
       Check instruction_on_additional_gunFire_animation.txt for details on gunFire effect group.
       For example, 'actuator1_onKeyShoot'
       Note: play both forward and reverse simultaneously may sounds meaningless, but each can have a 'delay' 
             parameters to space them out. more in the following sections.
      #triggers forward animation if own tank remains stationary for more than a specified duration. Play reverse
       animation if owntank starts moving again. Append '_onStop' to the end of the original bonename, for example 'actuator1_onStop'. 
       Default timeout is 3 second. A different timeout can be set by appending the timeout measured in millisecond immediately after '_onStop'
       For example 'actuator1_onStop5000'  will set the onStop trigger with a 5-second timeout.
      #triggers once per match when own tank first started moving. Never play reverse animation. Append '_onEngineStart'
       to the end of the original bonename.
      #triggers when own tank attemps to brake. This includes pressing 'SPACE', release 'W' during forward movement, or press 'S'
       during forward movement. Play reverse animation when previous brake conditions are no longer met and tank started moving again.
       Append '_onBrake' to the end of the original bonename. Default time length is 1 millisecond(instant).
       This trigger relies on user input so it won't work during replay.
      #triggers when own tank attempts reverse. Play reverse animation when reverse command is no longer present.
       Append '_onReverse' to the end of the original bonename. Default time length is 1 millisecond(instant).
       This trigger relies on user input so it won't work during replay.
      #triggers when 'A' or 'D' is pressed. Play reverse animation when these keys are released.
       Hull rotation initiated by mouse aiming rather than keyboard event are not captured at the moment.
       Append '_onLeft' or '_onRight' to the end of the original bonename. Default time length is 1 millisecond.(instant).
       This trigger relies on user input so it won't work during replay.
      #perodically throw a dice to decide if actuator should change its state.
       ##Append '_onRandom' to add current actuator to default randomGroup.
         This cluster also serves as randomGroup identifier so long as it begins with '_onRandom'
         For example, 'actuatorTest_onRandom2' will add actuatorTest to a different randomGroup called 'onRandom2'
         All actuators assigned to the same group will be synced. If the dice says this group should flip state, all
         actuators in this group will actuate.
       ##Default interval between dice thrown is 12 seconds. To specify an interval, append '_coolDownXXX' to the end of bonename.
         XXX is time measured in millisecond.
       ##Default chance of a success thrown is 0.5. To specify a different rate, append '_hitRateXXX' to the end of bonename.
         XXX is a float 0.0 ~ 1.0
       For example, 'actuator1_onRandom_coolDown5000_hitRate0.2' will added actuator1 to default randomGroup. A dice 
       will be thrown for this group every 5 seconds with a chance of 20% to toggle current actuator state. 
      
      
  2. select a delay if necessary. Append '_delayxxx' to the end of bonename where xxx is time measured in millisecond.
     For example, 'actuator1_onShoot_delay1000' will play forward animation 1 second after owntank fired a shot.
     'actuator1_delay2000' will play forward animation 2 seconds after ForwardAnimationHotkey is pressed.
  3. select how fast the animation should play if necessary. Default is 1 second. It defines total length of forward
     animation. A shorter time means faster movement. Append '_timexxx' to the end of bonename where xxx is time
     measured in milliseconds.
     For example, 'actuator1_onShoot_delay1000_time2000' will starts moving 1 second after the shot is fired and
     will assume its end-matrix position 3 seconds after the shot is fired.
  4. The three parameters mentioned above are optional, and it doesn't matter which one is defined first so long
     as they are positioned after the actual boneName.
     'actuator1_onShoot_delay1000_time2000'  will have the same effect as 'actuator1_time2000_delay1000_onShoot'



To config reverse animation, change the name 'actuator1_end' according to the same rules as configuring forward animation
except that you don't need to select a trigger again. Their triggers are already defined by forward animations. You can't
trigger forward animation by hotkey then do a reverse animation when firing a shot.
For example to set up artillery spade, use forward animation bone 'actuator1_onStop5000_time2000' and end-matrix 'actuator1_end_time2000'


Note: You should only change the name of nodes that are actually used in binding skinned modifier and marking end 
      matrix, in this case 'actuator1' and 'actuator1_end'.
      You should NEVER change the nodes that are automatically created by exporter during model export, namingly 
      those with 'blendbone' in their identifiers.

------------------------------------------------------------------------------------------------------------
[Behaviour in hangar]
While actuators may be triggered by different events in arena, in hangar they are all commanded
by ForwardAnimationHotkey and ReverseAnimationHotkey. 
These hotkeys can be changed in ownModel.xml
A list of valid hotkeys can be found in hotkeys.txt

------------------------------------------------------------------------------------------------------------
[How to place end-matrix accurately]
With an actuator linked to another actuator it's sometimes difficult to place end-matrix intuitively.
Here's an easy workaround.
1. link actuatorFoot as a child node of actuatorLeg
2. Bind leg and foot geometry to both actuator bones.
3. at frame0 create keyframe for both actuators
3. goto frame 10, create keyframe for actuatorLeg and move/rotate it as desired. Frame10 will be the end frame.
4. you'll notice foot geometry and actuatorFoot are also moved by actuatorLeg. Now create a keyframe for actuatorFoot
   at frame10 as well, move/rotate as desired.
5. with timebar still at frame10, use ctrl+v to make a copy of actuatorLeg, rename as actuatorLeg_end
6. remove keyframe0 of actuatorLeg_end, then remove keyframe10 as well.
7. repeat step5&6 for actuatorFoot to obtain actuatorFoot_end
8. rewind timebar to frame0. You'll notice actuatorFoot_end rewind with actuatorLeg as well, but
   retained a different initial position/orientation than actuatorFoot.

------------------------------------------------------------------------------------------------------------
[Notice for onBrake onReverse onLeft onRight]
Default forward animation length is 1 millisecond(instant) for these four triggers.

Default reverse animation length is 1 millisecond(instant) only when its corresponding trigger are explicitly appended
to the end-matrix node name. You can also explicitly assign a timelength, otherwise 1 second default might be used.
For example if brake nodename is 'actuatorLB_onBrake'
To achieve instant reverse trigger for un-brake event, use end-matrix node name 'actuatorLB_end_onBrake' or 'actuatorLB_end_time1'

Typical application for these triggers are tail lights. Create a mesh of tail light lens and place it inside tail lights 
so they're not visible in its initial position. Use 'shaders/std_effects/glow.fx' as shader.
Place end-matrix in such a way that it overlap or slightly outside static tail light lens.
So that when the event is triggered, the glowing lens mesh will jump to end-matrix as if the static tail light got lit up.

The glow shader is tricky to use without a working skinned variant. Check this instruction in the release package:
instruction_on_glow_shader.txt


------------------------------------------------------------------------------------------------------------
[modifier "blink"]
when '_blink' is appended to bone name, triggering a forward animation will not transite to end matrix then hold, 
but will spend half of the cycle time in start/end state alternatively.
cycle time is defined by '_timexxx' as usual. 
for example: actuatorRevRed_onReverse_blink_time1000