OFPEC Forum

Editors Depot - Mission Editing and Scripting => OFP - Editing/Scripting General => Topic started by: ukloadtoad on 30 Aug 2004, 01:28:14

Title: adding Smoke Shells
Post by: ukloadtoad on 30 Aug 2004, 01:28:14
Help... I've checked the forums, but none of the stuff on there helped.  I'm trying to add Red smokeshells to a pilot.  I've put the 'addweapon "smokeshellred"' & 'addmagazine "smokeshellred"' in the INIT field, but when I try the mission the smoke shells show up with 0.  I've tried adding the mag first so it loads automatically, but that doesn't help either.  
Does anyone have any advice?
Title: Re:adding Smoke Shells
Post by: ACF on 30 Aug 2004, 01:50:33
Apologies if you can already suck eggs but:

this AddWeapon "SmokeShellRed"

. . . would be the correct syntax.  The 'this' is the unit whose init field you're putting the command in.  If the unit was named something you could use:

something AddWeapon "SmokeShellRed"

. . . as an init command or from anywhere else.

What you need to do first is remove an existing mag to make room for the smoke grenade.  Don't know what a pilot's loadout is off the top of my head, but to swap a frag for smoke you'd use:

this RemoveMagazine "HandGrenade"; this AddWeapon "SmokeShellRed"

You don't need to add a weapon as grenades are fired from a Throw.

Don't just rely on the forums, have a dig around in the Editor's Depot for scripting tutorials - it's how we all start. And grab yourself a copy of the BIS/Official Command Reference to start see what other things you can do.
Title: Re:adding Smoke Shells
Post by: General Barron on 30 Aug 2004, 03:46:32
Correction:

Quote
this RemoveMagazine "HandGrenade"; this AddWeapon "SmokeShellRed"

Should be:

this RemoveMagazine "HandGrenade"; this AddMagazine "SmokeShellRed"

Grenades/smoke grenades/mines/satchel charges/etc are kinda unique when you give them to units. All units already have the "weapon" that use these items, so you just have to add them in like magazines.