Jump to content
thy_

[SOLVED] How to ignore with no errors on screen an inexistent object inside an array?

Recommended Posts

Hi there. 

 

Kind of basic stuff but my brain today is not hooking me up: I need to verify possible inexistent objects in an array:

// Soldiers that Editor has been dropped and named through the Eden:
_targetsOnEden = [varname_1, varname_2];

// Loop for check if some soldier doesn't exist:
{
    if ( _x isEqualTo objNull ) exitWith { systemChat "One or more soldiers don't exist" };

} forEach _targetsOnEden;

 

But the error prints out saying "Error undefined variable in expression: _x" for some reason.

 

All I need is to print that systemChat out without any game errors on screen.

 

 

 

 

Share this post


Link to post
Share on other sites
if ( isNil "_x" || { isNull _x } ) then

 

  • Thanks 1

Share this post


Link to post
Share on other sites

I am on the road now. Sunday or Monday i will check it out! Thanks, @Larrow!

Share this post


Link to post
Share on other sites
On 9/2/2023 at 11:48 AM, Larrow said:

if ( isNil "_x" || { isNull _x } ) then

 

 

That's it! Thanks 😉

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

×