OFPEC Forum

Editors Depot - Mission Editing and Scripting => OFP - Editing/Scripting General => Topic started by: ivabigmole on 11 Aug 2005, 23:04:58

Title: need help
Post by: ivabigmole on 11 Aug 2005, 23:04:58
hi i need heelp on editing the loadout of a unit like say i wanted to change a units weapons like get a civilian to have a m21 sniper i need help ive looked through the site and cant find any thing to help so can someone help me
Title: Re:need help
Post by: nominesine on 11 Aug 2005, 23:34:52
I would start looking in the editors depot. It has many useful tutorials and also a FAQ (like the one you just asked in your example). The answer to your specific question is found in the Official Command Reference Guide (A.K.A Comref). And the easy way is...

this addMagazine "m21Mag"; this addWeapon "m21"

If you write that in the init line of your civ he will start with the m21 rifle and one magazine.
Title: Re:need help
Post by: ivabigmole on 11 Aug 2005, 23:37:13
would that work with say a m16 soldure so he has a m21 sniper instead of a m16
Title: Re:need help
Post by: pazuzu on 12 Aug 2005, 02:27:28
It will work on any unit as long as you put "removeallweapons this" in the init of the unit before you give them a new weapon.
Title: Re:need help
Post by: macguba on 12 Aug 2005, 10:21:13
As nominesine correctly implies, always add a magazine before adding the weapon so that the weapon is loaded at the start of the mission.

Oh, and

Welcome to the forum!
Title: Re:need help
Post by: ivabigmole on 14 Aug 2005, 16:58:10
Tnks every1 4 helping me u av been a lot of help now finialy i can create missions with my fav pep E.G blackops with snippers TNKS  ;D