Jump to content
Sign in to follow this  
GeneralCarver

Help-Object Null Variable Troubles

Recommended Posts

I am attempting to make my own Engineer Script for ArmA and ArmA 2 which allows an engineer to do several tasks not by default in the game. One, obviously, is to repair vehicles.

I would like to add an action to a vehicle for the engineer to activate and repair it, if its damaged. This requires using the nearestobjects command to search and find the vehicle types the script supports.

This concept works when it finds vehicles. However, the trouble comes when the command returns nothing (when there is nothing around). It will assign an null-object value to a variable.

I am unable to develop a script which can tell if the variable is a null object or not. I have tried the ObjNull, isNil,...all those commands, and still no luck.

So, does anyone know if it is possible to determine if a variable has no value assigned to it?

Share this post


Link to post
Share on other sites

nearestObjects return an array. If no objects were detected then the array is empty.

You can use the count command to get the array size.

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  

×