OFPEC Forum

Editors Depot - Mission Editing and Scripting => OFP - Editing/Scripting General => Topic started by: Hertog Jan on 14 Jun 2005, 12:51:19

Title: grenadelaunchers
Post by: Hertog Jan on 14 Jun 2005, 12:51:19
Hello,

I wanted to know how to make the AI fire off their grenadelauncher just like some mission in Resistance (Don't know the name, but you have to secure a town with a tankplatoon, grenadelaunchers are set up in the forests)

I looked in the editors depot but I couldn't find anything, only how to plant satchels etc.

The command UNITNAME fire["fire","Grenadelauncher"] didn't work....

So the idea is to create some sort of small artillerybarrage from grenades
Title: Re:grenadelaunchers
Post by: Hauk on 14 Jun 2005, 13:36:57
Code: [Select]
UNITNAME fire["fire","Grenadelauncher"]
If thats the code you used, then its wrong. It should be this

Code: [Select]
UNITNAME fire ["fire","Grenadelauncher"]
Always a space after "fire" ;)

Hauk
Title: Re:grenadelaunchers
Post by: Blanco on 14 Jun 2005, 13:39:16
Wrong.

West units :

Code: [Select]
myunit Fire ["M203Muzzle","GrenadeLauncher", "GrenadeLauncher"]
East units :

Code: [Select]
myunit fire ["GrenadesMuzzle","GrenadeLauncher","GrenadeLauncher"]
Make a whole group of grenadiers fire their nades :

1- initialise your group

Code: [Select]
grengroup = group this
2- fire command for the group

EAST
Code: [Select]
{_x fire ["GrenadesMuzzle","GrenadeLauncher","GrenadeLauncher"]} foreach units grengroup
WEST
Code: [Select]
{_x fire Fire ["M203Muzzle","GrenadeLauncher", "GrenadeLauncher"]}foreach units grengroup
Title: Re:grenadelaunchers
Post by: 456820 on 14 Jun 2005, 16:10:55
yep blancos right i used that code in a mission not long ago and worked great the only problem getting them the right distacne from the target wich is a pain in the arse
Title: Re:grenadelaunchers
Post by: Hertog Jan on 15 Jun 2005, 20:30:01
The unitcommand worked perfectly, but when I tried the group command I got the message unknown operator... and I copied the command from here...

Also I want to know if it's possible to make them fire at a specified target such as a car or something..

And should I replace m203muzzle with MM1muzzle if I want to use the MM1 GrenadeLauncher?

So it would look like this:
Myunit fire ["mm1Muzzle","MM1",MM1"]
Title: Re:grenadelaunchers
Post by: Planck on 15 Jun 2005, 20:43:34
The MM-1 doesn't have a 'muzzle'

It just has the classname "MM1" and magazine name is "MM1Magazine"


Planck