Home   Help Search Login Register  

Author Topic: NearestObject Question  (Read 526 times)

0 Members and 1 Guest are viewing this topic.

Suicide

  • Guest
NearestObject Question
« 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 " ???

Suicide

  • Guest
Re:NearestObject Question
« Reply #1 on: 23 May 2004, 19:39:09 »
NoBody Knows  :-\ ???

Offline h-

  • OFPEC Site
  • Administrator
  • *****
  • Formerly HateR_Kint
    • OFPEC
Re:NearestObject Question
« Reply #2 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
Project MCAR   ---   Northern Fronts   ---   Emitter 3Ditor
INFORMATIVE THREAD TITLES PLEASE. "PLEASE HELP" IS NOT ONE..
Chuck Norris can divide by zero.

Suicide

  • Guest
Re:NearestObject Question
« Reply #3 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  :-\ ???

Offline h-

  • OFPEC Site
  • Administrator
  • *****
  • Formerly HateR_Kint
    • OFPEC
Re:NearestObject Question
« Reply #4 on: 23 May 2004, 21:03:17 »
As far as I know, yes, you need to have it separately for all different types...
Project MCAR   ---   Northern Fronts   ---   Emitter 3Ditor
INFORMATIVE THREAD TITLES PLEASE. "PLEASE HELP" IS NOT ONE..
Chuck Norris can divide by zero.

Offline General Barron

  • Former Staff
  • ****
  • Semper Fi!
Re:NearestObject Question
« Reply #5 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
HANDSIGNALS COMMAND SYSTEM-- A realistic squad-control modification for OFP
kexp.org-- The best radio station in the world, right here at home! Listen to John Richards!