OFPEC Forum

Editors Depot - Mission Editing and Scripting => OFP - Editing/Scripting General => Topic started by: shadow99 on 13 Jul 2004, 02:06:47

Title: Adding Weapons
Post by: shadow99 on 13 Jul 2004, 02:06:47
I'm really muddled on all this 'addWeapon' stuff. I think you have to remove a unit's weapons before giving him new ones.

Can someone explain to me how to create the following:
An Officer with a Law Launcher (3 Shells) and an M60 with 4 rounds. If it is possible to give grenades, throw up to 6 of them in as well.

Thank you.
Title: Re:Adding Weapons
Post by: m21man on 13 Jul 2004, 02:44:11
For starters, you can't carry an M60 and a rocket launcher :P ...

For an M16 with a LAW, it would be (Includes some extra details) :
Code: [Select]
removeallweapons player
player addmagazine "m16"
player addmagazine "m16"
player addmagazine "lawlauncher"
player addmagazine "lawlauncher"
player addmagazine "lawlauncher"
player addmagazine "lawlauncher"
player addweapon "m16"
player addweapon "lawlauncher"
player selectweapon (primaryweapon player)
?(player == (leader group player)): player addweapon "binocular"
exit

You only have ten ammo spaces to fill, so choose your magazines accordingly.
Title: Re:Adding Weapons
Post by: shadow99 on 13 Jul 2004, 05:38:42
Great, thanks. What are the rules though?

You can't carry a rocket launcher with automatics?
Title: Re:Adding Weapons
Post by: Roni on 13 Jul 2004, 05:48:28
I'm not sure what the "hard" rule is but I've found that you can't carry a LAW or AAW and a machinegun.  Not sure whetehr this is Weapon Class based or some ad hoc rule.



Roni
Title: Re:Adding Weapons
Post by: macguba on 13 Jul 2004, 12:12:32
There are 5 weapon slots for a soldier type unit

primary (eg M16)
secondary (eg LAW)
ammo (eg magazines, flares or grenades)
handgun + mags (eg Glock)
optics (eg binoculars)

Some types of unit have all four.   Some, like a medic, sniper or civilian do not have a secondary weapon slot.

In general each weapon can fit into only one slot.   Some weapons, like the M60 and PK, take up both primary and secondary slots.   Units without a secondary slot cannot carry them.

Hope that helps.