OFPEC Forum

Editors Depot - Mission Editing and Scripting => OFP - Editing/Scripting General => Topic started by: sharkyjoe on 29 Mar 2005, 23:37:27

Title: Check To See If Any Group Memeber Has Weapon
Post by: sharkyjoe on 29 Mar 2005, 23:37:27
Three West guys and Ammocrate filled with Strela Launchers inside trigger area.I have a trigger that needs to fire when any member in group has a weapon 9k32launcher.
 Right now i have the trig. set to West- Present-Once
Condition: grp1 hasweapon "9k32launcher".
I get an- Error hasweapon:  type group; expect object.
Looked in Comref and said Object or group if ya pass group leader is considered.
Also tried the Group Trigger -Vech, Grp leader, anybody.
this and in this list  hasweapon 9k32launcher --in Condition Line.
Ran out of ideas
Title: Re:Check To See If Any Group Memeber Has Weapon
Post by: Raptorsaurus on 30 Mar 2005, 00:10:44
Try this (I cannot check it as I am at work but I think it will work):

{_x hasweapon "9k32launcher"} count units grp1 > 0
Title: Re:Check To See If Any Group Memeber Has Weapon
Post by: sharkyjoe on 30 Mar 2005, 00:35:35
Yep Worked like a charm.
Ok the _x is a locall variable
has weapon "9k32launcher" and Grp1-figured that out
the rest of it { } count units > 0
How did ya come up with that - no arguement here it works great but i liked to know for future reference.

Thank You Very Much Raptorsaurus  ;D
What?!?You Don't have OFP On your computer at work?? I thought Everbody did. No just kidding, I dont either.

Title: Re:Check To See If Any Group Memeber Has Weapon
Post by: macguba on 30 Mar 2005, 02:54:30
Check the count command in the comref.
Title: Re:Check To See If Any Group Memeber Has Weapon
Post by: sharkyjoe on 31 Mar 2005, 06:34:48
Hmm I See  :o , but I don't think I would have come up with that Scripted line in a in a year. I have lots to learn. Thanks Everyone. :)