OFPEC Forum

Editors Depot - Mission Editing and Scripting => OFP - Editing/Scripting General => Topic started by: minimilo on 06 May 2004, 18:42:09

Title: editing weapons
Post by: minimilo on 06 May 2004, 18:42:09
when i place ammo crates, how do i make certain weapons and ammo appear in them, (what is the code, and wot box do i put it in??)
cheers
Title: Re:editing weapons
Post by: dmakatra on 06 May 2004, 18:43:41
Check out the commands addmagazinecargo and addweaponcargo in your comref. :)

:beat: *Gets Shot* :beat:
Title: Re:editing weapons
Post by: minimilo on 06 May 2004, 18:51:05
soz bout dis im kinda new, what is comref, also, can i give a soldier a weapon just like ammo crates,
cheers
Title: Re:editing weapons
Post by: j-man on 06 May 2004, 19:12:27
to add a weapon to a ammo box, put this into it's init field:

Code: [Select]
this addweaponcargo ["M16",5]; this addmagazinecargo ["M16",5]
this will add 5 M16's and 5 M16 mags.

To add a weapon to a soldier, use this:

Code: [Select]
removeallweapons this; this addmagazine "M16"; this addmagazine "M16"; this addmagazine "M16"; this addmagazine "M16"; this addweapon "M16
this will remove all of the soldiers previous weapon, and then add 4 M16 mags and a M16 gun.

The comref is the official command reference. This is a list of all the scripting commands that can be used in the game. I siggest looking in the editors depot for tutorial on scripting and mission editing.
Title: Re:editing weapons
Post by: Wadmann on 06 May 2004, 19:17:28
Hey minimilo!

    Check out this page (http://www.ofpec.com/editors/browse.php?browsewhat=2&category=2_8) and you will see an ammocrate filler script. You can also do this manually. Look on this page (http://www.ofpec.com/editors/comref.php?letter=A) and scroll down to "addweapon" and "addmagazine". Be sure to read the comments under these commands as they contain some useful info.

                                                                      Wadmann
Title: Re:editing weapons
Post by: minimilo on 06 May 2004, 19:55:40
thnx ppl
Title: Re:editing weapons
Post by: minimilo on 06 May 2004, 20:04:13
ive put in what it says, an "unknown operator" cums up
Title: Re:editing weapons
Post by: j-man on 06 May 2004, 20:25:18
What exactly have did you put in ???

EDIT

if you put in what I said, then it's wrong. I made a mistake while typing  it. Here's how it should look:

Code: [Select]
removeallweapons this; this addmagazine "M16"; this addmagazine "M16"; this addmagazine "M16"; this addmagazine "M16"; this addweapon "M16"