OFPEC Forum
Editors Depot - Mission Editing and Scripting => OFP - Editing/Scripting General => Topic started by: John on 17 Jul 2006, 22:22:09
-
I think I have to remove all the other wapons first dont I?...and how do I do that?
-
Hardly necessary :)
Adding ammo/weapons to crates or vehicles :
addweaponcargo
and for magazines
addmagazinecargo
Format is :
<unit> addweaponcargo ["Weapon", #]
So, for instance
AmmoCrate addweaponCargo ["AK74", 5]; AmmoCrate addmagazinecargo ["AK74", 30]
Shadam. For full list of official weapon/magazine names, refer to the http://www.ofpec.com/COMREF/weapons.html list found there. :)
Good luck!
/Wolfrug out.
-
not working.....i add what you say and then get near to the ammo crate....and it only says take m16 and take hand grenade....and not what I have added....dont you have to remove what it has to begin with
-
You don't have to remove what's already in the crate, I think that something went wrong and only the default M16 is present.
If you wish to clear the crate, type in its init:
removeAllWeapons this; clearMagazineCargo this;
To add an AK74 type:
this addweaponCargo ["AK74",1]; this addmagazinecargo ["AK74",1]
Hope that this works.
-
but this script in oyur mission folder and adjust it do your needs.
in the init line of your crate you put:
[this] exec ammo1.sqs
; *****************************************************
; ammo2: Loadout for AssaultTeam
; Contains Magazines from :
; CORE
; *****************************************************
; EXAMPLE:
; Type this code into the INITIALIZATION box of the crate.
; [this] Exec "ammo1.sqs"
; *****************************************************
clearmagazinecargo _this;
clearweaponcargo _this;
; Get the parameters given
_crate = _this Select 0
_crate AddWeaponCargo ["Steyr", 5]
_crate AddWeaponCargo ["M4ReflexSD", 5]
_crate AddWeaponCargo ["M4A1Acog", 5]
_crate AddWeaponCargo ["MK46", 5]
_crate AddWeaponCargo ["RPGLauncher", 5]
_crate AddWeaponCargo ["AALauncher", 5]
_crate AddMagazineCargo ["SteyrMag", 10]
_crate AddMagazineCargo ["M4ReflexSDMag", 10]
_crate AddMagazineCargo ["M4A1SilencedMag", 30]
_crate AddMagazineCargo ["M4A1Mag", 20]
_crate AddMagazineCargo ["MK46Mag", 20]
_crate AddMagazineCargo ["GrenadeLauncher", 30]
_crate AddMagazineCargo ["RPGLauncher", 20]
_crate AddMagazineCargo ["AALauncher", 10]
_crate AddMagazineCargo ["PipeBomb", 20]
_crate AddMagazineCargo ["Mine", 20]
EXIT
-
Think this version of your script is quicker...
; *****************************************************
; ammo2: Loadout for AssaultTeam
; Contains Magazines from :
; CORE
; *****************************************************
; EXAMPLE:
; Type this code into the INITIALIZATION box of the crate.
; this Exec "ammo1.sqs"
; *****************************************************
clearmagazinecargo _this;
clearweaponcargo _this;
; Get the parameters given
_This AddWeaponCargo ["Steyr", 5]
_This AddWeaponCargo ["M4ReflexSD", 5]
_This AddWeaponCargo ["M4A1Acog", 5]
_This AddWeaponCargo ["MK46", 5]
_This AddWeaponCargo ["RPGLauncher", 5]
_This AddWeaponCargo ["AALauncher", 5]
_This AddMagazineCargo ["SteyrMag", 10]
_This AddMagazineCargo ["M4ReflexSDMag", 10]
_This AddMagazineCargo ["M4A1SilencedMag", 30]
_This AddMagazineCargo ["M4A1Mag", 20]
_This AddMagazineCargo ["MK46Mag", 20]
_This AddMagazineCargo ["GrenadeLauncher", 30]
_This AddMagazineCargo ["RPGLauncher", 20]
_This AddMagazineCargo ["AALauncher", 10]
_This AddMagazineCargo ["PipeBomb", 20]
_This AddMagazineCargo ["Mine", 20]
EXIT
As this version doesnt need the initial array line.
-
you could just put in the init. field of the crate : this addWeaponCargo "WEAPONNAME , #"; this addMagazineCargo "MAGAZINENAME, #" this will put the specified weapons in the crate alongside the default loadout. The remove weapon script can go before the addweapon part t orem,ove default weapons. If you are adding satchel charges the weapon name is pipebomb.
-
If you wish to clear the crate, type in its init:
removeAllWeapons this; clearMagazineCargo this;
clearWeaponsCargo this, not removeAllWeapons this. :)
I'd use the init line as I reckon a script is a bit of an overkill. Just post what you wrote in the init line and we'll sort it out for you. :)