Would it be possible to make the `animate` and `animationPhase` commands take animation indices in addition to the names? (i.e. `obj animationPhase index`)
Based on a quick test I made, it seems that animations are stored as arrays internally, because the performance of `animationPhase` seems to vary linearly with the index of the animation in `animationNames` array.
If I'm right, it means the game searches for the animation name first before returning the phase, which is a bit wasteful since object animations don't change indices.
If so, using indices means the command works faster, which could save me a lot of performance since I'm using `animationPhase` every frame for many objects and each have many animations.
Sample codeA command that returns **all** animation phases in the same order as `animationNames` array would be extremely helpful (same as doing: `animationNames _obj apply {_obj animationPhase _x};` which is very slow in SQF)
```
animationsPhase _obj;
```
returns an array of numbers:
```
_phases = [];[0, 1, 0, 1, ...];
{
_phases pushBack (_obj animationPhase _forEachIndex);
} forEach animationNames _obj;
```
which should be faster than```
In addition would it be possible to make the `animate` and `animationPhase` commands take animation indices in addition to the names? (i.e. `obj animationPhase index`)
Based on a quick test I made, it seems that animations are stored as arrays internally, because the performance of `animationPhase` seems to vary linearly with the index of the animation in `animationNames` array.
If I'm right, it means the game searches for the animation name first before returning the phase, which is a bit wasteful since object animations don't change indices.
If so, using indices means the command works faster, which could save me a lot of performance since I'm using `animationPhase` every frame for many objects and each have many animations.
Sample code:
```
_phases = [];
{
_phases pushBack (_obj animationPhase _forEachIndex);
} forEach animationNames _obj;
```
In addition, a command that returns **all** animation phases in the same order as `animationNames` array would be extremely helpfulwhich should be faster than:
```
animationsP_phase _obj;s = [];
```{
returns an array of numbers:
``` _phases pushBack (_obj animationPhase _x);
[0, 1, 0, 1, ...];} forEach animationNames _obj;
//same as doing: animationNames _obj apply {_obj animationPhase _x};```
```