OFPEC Forum
Editors Depot - Mission Editing and Scripting => OFP - Editing/Scripting General => Topic started by: Suicide on 23 May 2004, 17:05:53
-
Hi,
It's Possible With The NearestObject Command To Have Only Soldiers And Véhicles In Returns ??? If Yes, What I Have To Write In " Type " ???
-
NoBody Knows :-\ ???
-
If you want a soldier to be 'nearestObjected' you put the type of the soldier in the "type", i.e. "SoldierWB" (basic western soldier)...
The types of different units are in the config.cpp (there are the BIS released commented configs somewhere in the Ed Depot (probably)), or you can have them by using the command typeOf...
You can have the typeOf shown in the screen with
hint format ["%1",typeOf unitname]
Either in scripts or triggers...
No guarantees on the syntaxes though :P
-
Thanks For Reply ;)
But There Is No Way For Have All Soldiers Type In Only One Word ??? I Have To Set One NearestObject For Each Type :-\ ???
-
As far as I know, yes, you need to have it separately for all different types...
-
You can use this function here to find the nearestObject out of an array of types:
http://ofpec.com/editors/funcref.php?filter_func=43
However, if you only want to find people or vehicles with people in them, then you are better off NOT using nearestobject (which only has a range of 50 meters), and instead using a trigger. Check out this function here:
http://ofpec.com/editors/funcref.php?filter_func=48