OFPEC Forum

Editors Depot - Mission Editing and Scripting => OFP - Editing/Scripting General => Topic started by: Grendel on 25 May 2005, 22:50:37

Title: "throw" action issues
Post by: Grendel on 25 May 2005, 22:50:37
ARGHHH!  The action command and its insolent syntax issues >:(

Does anyone know the proper syntax to have a unit throw a normal BIS standard hand grenade?

I have used _unit action ["throw","smokeshell","smokeshell"] to successfully throw smoke, but when I tried to use it to throw a grenade, I have nothing but problems.

I have tried interchanging "handgrenade" and "grenadehand" and when I use the fired eventhandler I got NOID handgrenade (????) and tried using that.

I'm hoping someone has already figured this out so i dont ruin my nice monitor by shoving a brick through it, although I could find no info on it under the sticky topic.

Thanks

-Grendel
Title: Re:"throw" action issues
Post by: Planck on 25 May 2005, 23:00:38
I would have thought that:

_unit action ["throw","grenadehand","grenadehand"]

would have worked, as that is the class name for the hand grenade.

Never tried it myself though.



Planck
Title: Re:"throw" action issues
Post by: h- on 25 May 2005, 23:11:39
_unit fire ["throw","handgrenade"]
Title: Re:"throw" action issues
Post by: ACF on 25 May 2005, 23:54:44
A curiosity:  the unit Fire weaponnamestring syntax also works if you use:

unit Fire "throw"

This does mean he will chuck smoke grenades as well if he has them.
Title: Re:"throw" action issues
Post by: Sui on 26 May 2005, 10:35:23
It will depend which 'throw' magazine is selected.

OFP uses grenades (both fragmentation and smoke) as magazines, and has 'throw' as the weapon. If you had smokeshell selected, he would throw that.

The throw command goes:
Muzzle, Mode, Magazine

However a lot of weapons can be fired by just:
Muzzle, Magazine

So Hater_Kint's solution will get the job done ;)
Title: Re:"throw" action issues
Post by: Grendel on 26 May 2005, 17:42:09
Thanks for the help everyone...

Just a little intel bit, this helped impliment another inovative addition to OFP...The M86 Pursuit Deterent Munition (it is a real world item BTW-and a nasty little one at that)! As always from me, no separate addons needed, just some little scripts!

thanks again

-grendel