Jump to content
Sign in to follow this  
KeyCat

How to test for <null-object>?

Recommended Posts

Using the nearestobject command to have the AI find some vehicles but wonder how I can test for <NULL-object> that is returned by nearestobject if nothing is found?

Tried following with no luck...

</span><table border="0" align="center" width="95%" cellpadding="3" cellspacing="1"><tr><td>Code Sample </td></tr><tr><td id="CODE">

_obj = nearestobject [(getpos (leader _group)), "UAZ"]

? (_obj == <NULL-object>) : goto "seekmore"

<span id='postcolor'>

/Christer (a.k.a KeyCat)

Share this post


Link to post
Share on other sites

Hi, try this

</span><table border="0" align="center" width="95%" cellpadding="3" cellspacing="1"><tr><td>Code Sample </td></tr><tr><td id="CODE">_obj = nearestobject [(getpos (leader _group)), "UAZ"]

?(isNull _obj): goto "seekmore"<span id='postcolor'>

Spinor

Share this post


Link to post
Share on other sites

Thanks a lot Spinor! Suspected it was simple and it was... Sometimes it's to easy to get stuck in a bad "brain loop" tounge.gif

/Christer (a.k.a KeyCat)

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
Sign in to follow this  

×