Forum Jump :

Author Message


Posts: 1589
Rank:


Level: Member

Country: pf
Location: Tahiti
Occupation: too many Arma
Age: 59
In-game name: Kobayashi Maru

 
#191172 Posted at 2016-08-08 22:04        
     
Not really easy!

Name your target, example tgt1
in init field of the target:
["freezeTgt","onEachFrame", {tgt1 animate ["Swivel_6rpm_rot",0.5]}] call Bis_fnc_addStackedEventHandler;
in your trigger (activation as you want), make it repeatable, and:
on activation field:
["freezeTgt","onEachFrame"] call Bis_fnc_removeStackedEventHandler;
on deactivation field:
["freezeTgt","onEachFrame", {tgt1 animate ["Swivel_6rpm_rot",0.5]}] call Bis_fnc_addStackedEventHandler;

Explanation:
Without any BI documentation, you have to use the animate command (animateSource doesn't work). You have to counter the macro embedded with the object's configClass. Do it on each frame or inside a while {true} loop; sleep sometime

For a swilvel target, there are 9 different speeds! But at this time, I don't know how do they work.
You can find the name of these animations:
write in debug console (in one of the watch line: animationNames tgt1. You can see all possible rpm.

To find the one I had to counter, I wrote in the debug console:
0 = [] spawn {
  while {true} do {
   _an = [];
   {_an pushBack (tgt1 animationPhase _x)} forEach animationNames tgt1;
   hintSilent format  ["%1", _an];
   sleep 1
  }
}
This way, you can see which animation is active: here "Swivel_6rpm_rot".

PLEASE CONTACT ME ON BI FORUMS FOR ANY SCRIPT / MOD QUESTION. TKS