OFPEC Forum

Addons & Mods Depot => OFP - Addons & Mods Beta Testing => Topic started by: Terox on 10 Oct 2005, 22:33:16

Title: nearestobject start point of search
Post by: Terox on 10 Oct 2005, 22:33:16
If i had a tripwire for say a grenade trap or flaretrap
and i used a nearest object search as the condition for activating the grenade/flare etc

what point in the addon object is the reference starting point for the search

eg
If the tripwire was 30m long
does the nearestobject command use every point of the "tripwire" as a possible reference point or just say one of the ends or the centre
Title: Re:nearestobject start point of search
Post by: Pilot on 10 Oct 2005, 23:05:48
I'm pretty sure OFP finds the center of the model and uses that for the reference, unless there is a specified point in the model.  The point has a special name, but it's in Czech so I don't know it, nor do I have access to OFP right now to find out. :-\

-Pilot
Title: Re:nearestobject start point of search
Post by: Planck on 10 Oct 2005, 23:06:03
Just a guess here...... ;D

But I would say it searches from the centre of the 'tripwire'.

What your tripwire is I don't know, but if it is 30m long then I suspect it would begin its search 15 m from either end.   ;)

Bearing in mind that nearestobject is limited to a 50m radius also.


Planck
Title: Re:nearestobject start point of search
Post by: h- on 11 Oct 2005, 15:16:12
It's the center of the object which is defined by many things in the model...

Making a 'real' tripwire with just nearestObject is not going to happen though, you need far more complex stuff...
Title: Re:nearestobject start point of search
Post by: Terox on 11 Oct 2005, 17:31:26
It's the center of the object which is defined by many things in the model...

Making a 'real' tripwire with just nearestObject is not going to happen though, you need far more complex stuff...

can you explain more please
Title: Re:nearestobject start point of search
Post by: h- on 11 Oct 2005, 17:44:51
No... :(

Merely because I'm not in liberty as the stuff I've made with pipemines falls under FWW2 Mod NDA and although I'm a co-leader I'm not sure I can brake it...

EDIT:
The problem with using just nearestObject is that it will activate the mine only when the unit tripping the wire is close enough to the wire center...
Title: Re:nearestobject start point of search
Post by: Terox on 12 Oct 2005, 16:24:30
The problem with using just nearestObject is that it will activate the mine only when the unit tripping the wire is close enough to the wire center...

thats what i thought was happening and thats enough info to help me, thanks
Title: Re:nearestobject start point of search
Post by: Kyle Sarnik on 12 Oct 2005, 21:35:39
Not to mention that nearestobject to an object (not a position) will (unless a specified classname to search for is given) allways return the object itself. Its a pain really, for example of you use:

nearestobject [player,""]

It will return as player, no matter how many other objects are next to him, because think about it, the absolute closest object to the center of player would be player.  :-\ Sometimes OFP is too logical...  ::)