I was on Arma 3 discord yesterday, reporting that [[ https://community.bistudio.com/wiki/BIS_fnc_scriptedMove | `BIS_fnc_scriptedMove`]] doesn't work on Arma 3 despite having Arma 3 logo on it (in the biki page), one of the discord admins did indeed add a note that it wouldn't work because it was scripted fro Arma 2 multiplayer framework.
Of course I was in dire need of that function to work in arma 3, and it was REALLY EASY to fix it! I easily fixed it to work on Arma 3 by changing just two lines, so could this "working version" of the function be implmented on the next update? as it is easy to do.
Lets take a look at the source code of [[ https://community.bistudio.com/wiki/BIS_fnc_scriptedMove | `BIS_fnc_scriptedMove`]], : https://sqfbin.com/siyuxumavocacaferovu
Take a look at lines 39 and 63,
```
while {(abs _degs > abs _step) && BIS_scriptedMoveEnabled} do { //line 39
while {(_i <= _animLoops && !(isPlayer _guy)) && BIS_scriptedMoveEnabled} do { //line 63
```
We can see both of these lines have the `BIS_scriptedMoveEnabled` variable which must be set to `true` before we can use the command, I think it was placed here so that the loop (for the walking animation at line 63 and for turning the soldier towards waypoints on line 39) can be stopped at any time by doing `BIS_scriptedMoveEnabled = false;` **//BUT//**
I tried using `BIS_scriptedMoveEnabled = false;` while the function was running the walking animation, but the loop didn't stop anyways, so the `BIS_scriptedMoveEnabled ` is really useless and should just be removed from the while loop conditions at both line 39 and line 63
so line 39 and line 63 should be
```
while {(abs _degs > abs _step)} do { //line 39
while {(_i <= _animLoops && !(isPlayer _guy))} do { //line 63
```
This way when somebody tries to use `BIS_fnc_scriptedMove` they don't have to put `BIS_scriptedMoveEnabled = true;` before it, because BIS_scriptedMoveEnabled in this case is useless anyways due to the reasons mentioned above.
Now to the second and last part of this report:
Please take a look at line 64 of the function's source code:
```
_nic = [objNull, _guy, rPLAYMOVE, _walkAnim] call RE; //line 64
```
Thats why the discord admin I spoke with added this note to the biki page,
{F2703840}
```
This function is broken in Arma 3 as its code relies on Arma 2: Multiplayer Framework.
```
because of the usage of RE command in the function's source code, since RE command doesn't exist in Arma 3 (replaced by [[ https://community.bistudio.com/wiki/remoteExec | `RemoteExec` ]]) so the easy way I used to fix this is to simply just use [[ https://community.bistudio.com/wiki/playMove | `playMove` ]] **BECAUSE** playMove has global effect, so we are basically doing the same thing that RE was supposed to do in the original code (broadcast the animation globally so everyone on the arma 2 server back then can see the walking animation) but `playMove ` **//already has global effect so we don't need to//** `RemoteExec` **//that //**.
So we can just replace line 64 in the function's source code with:
```
_nic = _guy playMove _walkAnim; //and that will compensate for RE and make the function finally work for Arma 3!
```
So look dear poor feedback dev I know I speak like a stupid parrot putting an entire text wall just to explain why I replaced these lines, but we all know that I had to do this to be clear to everyone reading this so sorry if I wasted your time in unnecessary typing.
Well now lets just take a look at the function's source code before changing it and after changing it:
**Before any changes** (doesn't work on Arma 3) : https://sqfbin.com/siyuxumavocacaferovu
**After changes** (works on Arma 3) : https://sqfbin.com/fipopesalecujamojutu
**FORGOT TO MENTION:
**(in the after changes version , I changed lines 69 and 72 too, because at 69 the previous code was `waitUntil {speed _guy < 0.25};` but the condition was not true until the unit passes the last point by about 10 meters because the animation loop adds additional animations that run after the unit reaches the desired position, so the guy's speed only goes below 0.25 when he passes the point by 10 meters, so I changed line 69 to ` waitUntil {((_guy distance2d (_wps select ((count _wps) - 1))) < 0.8)};` basically select the last waypoint and when the unit is about 0.8 meters away from that point the condition will be true.
then we come to line 72 that I also changed, I added a semicolon at the end of `call _code` and then added another line below it, `_guy playmove "";` this additional line I added makes it so that the unit stops doing the moving animation after the previous ` waitUntil {((_guy distance2d (_wps select ((count _wps) - 1))) < 0.8)};` becomes true)
Thank you, and have a very safe and productive day (please include this in the next update).