Jump to content
EddiePrice

LARS unitPlayMP.sqf

Recommended Posts

Hi all,

 

Just been finalising a mission and run into a problem. I've been using LARS unitplay for some time but since the patch the other day I'm getting the following error message and the script is not terminating:

 

Error in expression < _data select 10; (_endParams select 0) setvariable [_endParams select 1,true];
Error position: <setvariable [_endParams select 1,true];
Error Reserved variable in expression
 
Seems to be a problem with terminating the script as seen here:
 
	//--- Terminate when the recording is finished or when the object is disabled
	if (_step >= _recordingCount - 2 || (!_ignoreDisabled && (!alive _object || !canmove _object)) || _object getvariable ["BIS_fnc_unitPlay_terminate",false]) exitwith {

		//--- Terminate
		_handler = _data select 11;
		removemissioneventhandler ["loaded",_handler];
		missionnamespace setvariable [_dataVar,nil];
		[ missionNamespace getVariable format [ "unitPlayOEF_%1", netId _object ], "onEachFrame" ] call BIS_fnc_removeStackedEventHandler;
		missionNamespace setVariable [ format [ "unitPlayOEF_%1", netId _object ], nil ];

		_endParams = _data select 10;
		(_endParams select 0) setvariable [_endParams select 1,true];
	};

If anyone could help I'd really appreciate it - even a quick fix like a manual terminate or the script or something.

 

Thanks.

Share this post


Link to post
Share on other sites

not sure if this will change anything but ye you can test it if you want to

//--- Terminate when the recording is finished or when the object is disabled
	if (_step >= _recordingCount - 2 || (!_ignoreDisabled && (!alive _object || !canmove _object)) || _object getvariable ["BIS_fnc_unitPlay_terminate",false]) exitwith {

		//--- Terminate
		_handler = _data select 11;
		removemissioneventhandler ["loaded",_handler];
		missionnamespace setvariable [_dataVar,nil];
		[ missionNamespace getVariable format [ "unitPlayOEF_%1", netId _object ], "onEachFrame" ] call BIS_fnc_removeStackedEventHandler;
		missionNamespace setVariable [ format [ "unitPlayOEF_%1", netId _object ], nil ];

		_endParams = _data select 10;
                _setvar = _endParams select 0;
		_setvar setvariable [_endParams select 1,true];
	};

Share this post


Link to post
Share on other sites

Change the last part to look like this..

		_endParams = _data select 10;
		if !( _endParams select 1 isEqualTo "" ) then {
			(_endParams select 0) setvariable [_endParams select 1,true];
		};

Its because I presume you are not supplying any variable to be set when the playback finishes and so its trying to set a variable called "" in missionNamespace which is not allowed.

I have also updated the original post with this fix.

 

As for your other problem with the script that you DMed me about it not playing back multiple vehicles, I cannot reproduce this, I tested multiple play backs on a dedicated without error.

Share this post


Link to post
Share on other sites

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now

×