OFPEC Forum
Editors Depot - Mission Editing and Scripting => ArmA - Editing/Scripting General => Topic started by: Wiper on 29 Jul 2007, 20:41:27
-
Hi,
does anyone know how to retrieve non strategic island objects via class names in ArmA in a script ?
the old
nearestObject [obj/pos,"type"]
function should work better now in arma but cause i dont know the correct class names i still cant use it properly, f.e.
nearestObject [player,"road"]
nearestObject [player,"bush"]
nearestObject [player,"tree"]
all dont deliver anything useful.
On the other hand
_posarray nearObjects ["static",_rad];
_posarray nearObjects ["building",_rad];
both seem to deliver the same array results :-\
any ideas / knowledges where to find a reference or documentation how to properly retrieve ANY specific island objects for arma islands ?
-
This has been discussed at length and it not currently possible due to ArmA not having native string functions. At present the only way to determine the class of map objects is using their p3d name. If we had a fast string comparison function, and a list of substrings commonly used to name classes of p3d objects, this could be done.
-
As already said, it isn't easy, not least because trees, bushes and roads do not actually have classnames.
There is no config entry in any config that gives them a classname, they are .wrp placed objects and don't require classnames normally.
Currently it is only the p3d names as Mr P has said that might possibly be used to determine what an object is, but not all plants or roads have a common string in the names.
The best you can go for would maybe be around 20 strings for each type of object to compare with and as we don't have string functions it isn't really possible.
Planck
-
oh well,
thats just what i was afraid of to hear, particularily as we got all those neat and advanced scripting functns in arma now
however, many thanks for your kind answers lads !