Jump to content
Neviothr

[Solved] Is anything wrong with these two scripts?

Recommended Posts

I'm trying to use DAC and whenever I preview the mission I created in the editor, I get the following error (taken from .rpt):

And yes I've posted this issue in DAC's thread, but no answer there so far.

Error in expression <ue;_dist = 100000;_wn = 1;

_tempList = List _zone;

if(count _tempList > 0) the>
Error position: <List _zone;

if(count _tempList > 0) the>
Error list: Type Script, expected Object

I've narrowed it down to dac_find_wplog.sqf and dac_find_polylog.sqf, which both have (what I assume is) the problematic code.

 

DAC_find_wplog.sqf:

private ["_zone","_tempList","_posArray","_ln","_log","_checkwp","_wn","_action","_dist","_wn"];

_zone = _this select 0;_posArray = [];_ln = 0;_log = objNull;_checkwp = [];_wn = 1;_action = true;_dist = 100000;_wn = 1;

_tempList = List _zone;

if(count _tempList > 0) then
{
	{
		if((format["%1",typeof _x] == "Logic")
		&& (format["%1",direction _x] == "90")
		&& ((count waypoints _x) > 2)) then
		{
			if(format["%1",_x getVariable "Link"] != "<NULL>") then
			{
				if((_x getVariable "Link") == _zone) then
				{
					_log = _x;_dist = 0;
				}
				else
				{
					if((getwppos[_x,0] distance _zone) < _dist) then
					{
						_log = _x;_dist = (getwppos[_x,0] distance _zone);
					};
				};
			}
			else
			{
				if((getwppos[_x,0] distance _zone) < _dist) then
				{
					_log = _x;_dist = (getwppos[_x,0] distance _zone);
				};
			};
		};
	}foreach _tempList;
	if(!(isNull _log)) then
	{
		while{(((getwppos[_log,_wn]) select 0)+((getwppos[_log,_wn]) select 1) != 0)} do
		{
			_checkwp = getwppos[_log,_wn];
			_posArray set [count _posArray,[_checkwp select 0,_checkwp select 1]];
			_wn = _wn + 1;
		};
	};
};
_posArray

 

DAC_find_polylog.sqf:

private ["_zone","_tempList","_posArray","_ln","_log","_checkwp","_wn","_action","_dist","_wn"];

_zone = _this select 0;_posArray = [];_ln = 0;_log = objNull;_checkwp = [];_wn = 1;_action = true;_dist = 100000;_wn = 1;

_tempList = List _zone;

if(count _tempList > 0) then
{
	{
		if((format["%1",typeof _x] == "Logic")
		&& (format["%1",direction _x] == "180")
		&& ((count waypoints _x) > 2)) then
		{
			if(format["%1",_x getVariable "Link"] != "<NULL>") then
			{
				if((_x getVariable "Link") == _zone) then
				{
					_log = _x;_dist = 0;
				};
			}
			else
			{
				if((getwppos[_x,0] distance _zone) < _dist) then
				{
					_log = _x;_dist = (getwppos[_x,0] distance _zone);
				};
			};
		};
	}foreach _tempList;
	if(!(isNull _log)) then
	{
		while{(((getwppos[_log,_wn]) select 0)+((getwppos[_log,_wn]) select 1) != 0)} do
		{
			_checkwp = getwppos[_log,_wn];
			_posArray set [count _posArray,[_checkwp select 0,_checkwp select 1]];
			_wn = _wn + 1;
		};
	};
};
_posArray

 

Thank you in advance.

Share this post


Link to post
Share on other sites

The error is simple: "Error list: Type Script, expected Object", so the function 'list' requires an Object but get's a script instead.

 

So the issue is before these files, and caused by the script(s) which are calling them.

 

 

Since 'list' works with trigger objects, it's probably something where the trigger doesn't exists or a wrong value is returned elsewhere.

 

 

To answer your question; there's nothing wrong with these scripts (regarding the error), and the error is caused elsewhere.

  • Like 1

Share this post


Link to post
Share on other sites

The error is simple: "Error list: Type Script, expected Object", so the function 'list' requires an Object but get's a script instead.

 

So the issue is before these files, and caused by the script(s) which are calling them.

 

 

Since 'list' works with trigger objects, it's probably something where the trigger doesn't exists or a wrong value is returned elsewhere.

 

 

To answer your question; there's nothing wrong with these scripts (regarding the error), and the error is caused elsewhere.

 

Thanks for the input, I'll look elsewhere for any errors.

Share this post


Link to post
Share on other sites

Never mind, this ended up being a problem with the DAC parameters inside the trigger.

The handle can't have the same name as the zone, FYI.

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

×