Welcome, Guest Thursday 24th April 2014, 14:54:52
   Home   Help Search Login Register  

OFPEC Forum

Author Topic: nearestObject "weapon" possible?  (Read 316 times)
0 Members and 1 Guest are viewing this topic.
laggy
*
Offline Offline


"Behold a pale horse"


« on: 07 Aug 2009, 19:24:57 »

Hello all,

In a mission I want a trigger to recognize when a weapon (dropped by player) is near a unit.
So far I haven't succeeded.
Does anyone know if it is possible?
Is a weapon model even recognized as an object?
This is what I have, and it doesn't work.

Condition: nearestObject [myUnit, "m16a4"] distance myUnit <= 3

If I do: nearestObject [myUnit, "weaponholder"] distance myUnit <= 3

The trigger fires as soon as you open gear menu, which is not OK for my idea.

Thanks in advance my fellow colleagues,

Laggy
« Last Edit: 07 Aug 2009, 19:30:23 by laggy » Logged

And I looked and beheld a pale horse and his name that sat on him was Death and Hell followed with him.
Planck
Honoured
Former Staff
****
Offline Offline


I'm never wrong ....I'm just not always right !


« Reply #1 on: 07 Aug 2009, 19:27:35 »

Try "Weaponholder", not sure if it will work though, worth a try.


Planck
Logged

I know a little about a lot, and a lot about a little.
laggy
*
Offline Offline


"Behold a pale horse"


« Reply #2 on: 07 Aug 2009, 19:28:51 »

Tried that while you answered, no luck  No

Well it works, but not as I want to, see first post.
« Last Edit: 07 Aug 2009, 19:47:31 by laggy » Logged

And I looked and beheld a pale horse and his name that sat on him was Death and Hell followed with him.
jones
*
Offline Offline


« Reply #3 on: 08 Aug 2009, 00:49:19 »

I don't think what you want to do is possible. I tested it in a loop and had to use weaponholder to detect the weapon and the model comes back as "dummyweapon".

Code I used
Code:
while {true} do{
_mypos = position player;
_weapons = _mypos nearObjects ["weaponholder", 10];
_HMMWV = _mypos nearObjects ["HMMWV", 10];
_weapondis = _mypos distance _weaponpos;
Hintsilent format ["Mypos %1\n Rifles %2\n HMMWV %3", _mypos, _weapons,_HMMWV];

};
Logged
laggy
*
Offline Offline


"Behold a pale horse"


« Reply #4 on: 08 Aug 2009, 08:11:49 »

Thanks jones,

Yeah, it seems like nearestObject doesn't recognize weapon models, too bad.
I have found a workaround, but the solution I wanted, would have been better.

Laggy
Logged

And I looked and beheld a pale horse and his name that sat on him was Death and Hell followed with him.
nominesine
Intel Depot
Administrator
*****
Offline Offline


I'm NOT back!


WWW
« Reply #5 on: 11 Aug 2009, 13:09:34 »

the model comes back as "dummyweapon".

I'm not sure what you're trying to do here laggy, but if the aforementioned script returns "dummyweapon", wouldn't it then be possible to check the distance between the unit and the nearest "dummyweapon"?!?

 Don't Know
Logged

OFPEC | Intel Depot
RETARDED Ooops... Retired!
Pages: [1]   Go Up
  Send this topicPrint  
 
Jump to: