OFPEC Forum

Editors Depot - Mission Editing and Scripting => OFP - Editing/Scripting General => Topic started by: Suicide on 23 May 2004, 17:05:53

Title: NearestObject Question
Post 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 " ???
Title: Re:NearestObject Question
Post by: Suicide on 23 May 2004, 19:39:09
NoBody Knows  :-\ ???
Title: Re:NearestObject Question
Post by: h- on 23 May 2004, 20:24:17
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
Title: Re:NearestObject Question
Post by: Suicide on 23 May 2004, 20:42:31
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  :-\ ???
Title: Re:NearestObject Question
Post by: h- on 23 May 2004, 21:03:17
As far as I know, yes, you need to have it separately for all different types...
Title: Re:NearestObject Question
Post by: General Barron on 23 May 2004, 23:54:08
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