OFPEC Forum

Editors Depot - Mission Editing and Scripting => OFP - Editing/Scripting General => Topic started by: DaveH123 on 24 Dec 2002, 08:20:46

Title: Camcreated ammo crates w/weapons?
Post by: DaveH123 on 24 Dec 2002, 08:20:46
I've been able to create ammo crates from CamCreate with weapons and magazines added.  However, when I get close to the crate during play I don't get any option of grabbing any of the items in the crate.  What am I doing wrong?  Sample code follows:


...
TitleText ["Box being created","PLAIN DOWN"]
_tgtPos = getmarkerpos "tgt"
_x = _tgtPos select 0
_y = _tgtPos select 1

myAmmo = "HeavyReammoBoxEast" CamCreate [_x,_y,1]
ClearWeaponCargo myAmmo
ClearMagazineCargo myAmmo
myAmmo AddWeaponCargo ["AT4Launcher",1]
myAmmo AddWeaponCargo ["AT4Launcher",1]
myAmmo AddWeaponCargo ["RPGLauncher",1]
myAmmo AddMagazineCargo ["AT4Launcher",4]
myAmmo AddMagazineCargo ["RPGLauncher",20]
myAmmo AddMagazineCargo ["AK74",20]
exit

...

Any help would be appreciated.

Thanks ???
Title: Re:Camcreated ammo crates w/weapons?
Post by: CrashnBurn on 24 Dec 2002, 12:27:40
replace camcreate with createvehicle
Title: Re:Camcreated ammo crates w/weapons?
Post by: DaveH123 on 24 Dec 2002, 17:20:01
That worked.  Thanks a lot.  

At first it didn't seem like it was working.  I'd run up to the box and the command menu would show up without the option of taking weapons.  After running over the box a few times the command menu showed up with the option to take weapons.  I'll settle for that.

Again thanks. :)
Title: Re:Camcreated ammo crates w/weapons?
Post by: Terame on 26 May 2003, 01:47:30
Noob editor questions for this script...

What would I name it?
What is the init command to enter?

Example of what I tried....
called the file "BAScrate.sqs"
[] exec "BAScrate.sqs" was placed in the waypoint init field


Thanks in advance guys


I've been able to create ammo crates from CamCreate with weapons and magazines added.  However, when I get close to the crate during play I don't get any option of grabbing any of the items in the crate.  What am I doing wrong?  Sample code follows:


...
TitleText ["Box being created","PLAIN DOWN"]
_tgtPos = getmarkerpos "tgt"
_x = _tgtPos select 0
_y = _tgtPos select 1

myAmmo = "HeavyReammoBoxEast" CamCreate [_x,_y,1]
ClearWeaponCargo myAmmo
ClearMagazineCargo myAmmo
myAmmo AddWeaponCargo ["AT4Launcher",1]
myAmmo AddWeaponCargo ["AT4Launcher",1]
myAmmo AddWeaponCargo ["RPGLauncher",1]
myAmmo AddMagazineCargo ["AT4Launcher",4]
myAmmo AddMagazineCargo ["RPGLauncher",20]
myAmmo AddMagazineCargo ["AK74",20]
exit

...

Any help would be appreciated.

Thanks ???