OFPEC Forum
Editors Depot - Mission Editing and Scripting => OFP - Editing/Scripting General => Topic started by: B-2-0 on 20 May 2003, 13:13:55
-
Ok, i have been up all night trawling the forums and trying to get this to work, i'm more stressed than Saddam Hussain's insurance company and i'm in need of a problem fix ASAP!!
*Realises the keys won't take much more of this punishment and takes a deep breath*
Sit rep: East ammo crate, West ammo crate........East ammo crate script, West ammo crate script........i place East crate with command [] exec "AmmoE.sqs" in init field, works fine........i delete that crate........i place West ammo crate with command [] exec "AmmoW.sqs" in init field, works fine........i replace the East ammo crate and init command and i only get the East crate with weapons in........West crate has M-16 mags and grenades.... >:(....HELP!!!
Here are the scripts:
;---------------------------------------------------------------------
;AmmoE.sqs
;Clear Ammo Crate
clearWeaponCargo this;
clearMagazineCargo this;
;AK-103
this addweaponcargo ["kegak103", 100];
this addmagazinecargo ["KEGak103Mag", 500];
;AK-107
this addweaponcargo ["kegak107", 100];
this addmagazinecargo ["KEGak107Mag", 500];
;RPK-74
this addweaponcargo ["kegrpk74", 50];
this addmagazinecargo ["KEGrpk74Mag", 300];
;------------------------------------------------------------------------
;------------------------------------------------------------------------
;AmmoW.sqs
;Clear Ammo Crate
clearWeaponCargo this;
clearMagazineCargo this;
;M4 ACOG Des
this addweaponcargo ["BAS_M4desACOG", 100];
this addmagazinecargo ["BAS_M4Mag", 500];
;M4 ACOG Des Silenced
this addweaponcargo ["BAS_M4desACOGS", 100];
this addmagazinecargo ["BAS_M4SMag", 500];
;M4 ACOG Des Masterkey
this addweaponcargo ["BAS_M4desMKACOG", 100];
this addmagazinecargo ["BAS_M4Mag", 500];
this addmagazinecargo ["BAS_MKshell", 500];
;-------------------------------------------------------------------------
Where am i going wrong ???
I thought maybe it was the ammount of weapons and mags but i get the same result with 1 gun and 5 mags in each box :-\
Just so you know....i intend to have 3 crates for each side so your solution must be workable with multiple crates on the same side running the same script!
I have also tried it without the clear ammo crate part to no avail........I have a feeling this is wrong too as i still get M-16 mags and nades :-\
Please, please, please help me!!!!
Please :)
-
Haven't looked in detail, but try to add :
_myammocrate=_this select 0
at the beginning of both scripts, and give a name to each of your ammo crates.
In the init field, type :
[_myname1] exec "AmmoW.sqs", etc.
Hope it'll work.
-
I just created a quick test on Desert Island with a slight variance of your code and it worked fine.
AmmoCrateWest i named Ammo1
AmmoCrateEast i named Ammo2
-------------------------------------------------------------------------------------------
then in Ammo1 Init Field
"RemoveAllWeapons Ammo1" ; Ammo1 exec "AmmoWest.sqs"
-------------------------------------------------------------------------------------
"AmmoWest.sqs"
clearWeaponCargo this;
clearMagazineCargo this;
;M4 ACOG Des
this addweaponcargo ["BAS_M4desACOG", 100];
this addmagazinecargo ["BAS_M4Mag", 500];
;M4 ACOG Des Silenced
this addweaponcargo ["BAS_M4desACOGS", 100];
this addmagazinecargo ["BAS_M4SMag", 500];
;M4 ACOG Des Masterkey
this addweaponcargo ["BAS_M4desMKACOG", 100];
this addmagazinecargo ["BAS_M4Mag", 500];
this addmagazinecargo ["BAS_MKshell", 500];
-----------------------------------------------------------------------------------
then in Ammo2 Init Field
"RemoveAllweapons Ammo2" ; Ammo2 exec "AmmoEast.sqs"
------------------------------------------------------------------------------------
AmmoEast.sqs
clearWeaponCargo this;
clearMagazineCargo this;
;AK-103
this addweaponcargo ["kegak103", 100];
this addmagazinecargo ["KEGak103Mag", 500];
;AK-107
this addweaponcargo ["kegak107", 100];
this addmagazinecargo ["KEGak107Mag", 500];
;RPK-74
this addweaponcargo ["kegrpk74", 50];
this addmagazinecargo ["KEGrpk74Mag", 300];
-------------------------------------------------------------------------
Works fine i can take all the weapons from both crates and Mags.
-
No, i get --[_CrateW|#|] Error local variable in global space-- when i add that to the init field! :-[
[Edit] Oh, i'll try that out!
:)Thanks!
-
When i enter this into Ammo1 init field-
"RemoveAllWeapons Ammo1" ; Ammo1 exec "AmmoWest.sqs"
I get-
"RemoveAllWeapons Ammo1" |#|; Ammo1 exec "AmmoWest.sqs" type string, expected nothing
???
-
I may not have been clear :
[_myname1] exec "AmmoW.sqs"
What I meant was, just name your crate (e.g. cratewest1), and put the name in the [].
[cratewest1] exec "AmmoW.sqs"
If you've found a solution, don't forget to SOLVE the topic !
-
Strange it worked fine for me. LOL well it did , Ive just checked it again and now all the Ammo and Weapons have jumped into 1 Crate !! :o
Must be a bug with the Addons.
-
You sure the syntax is correct....i am new to scripting as u can probably tell!! :)
-
Nope, it's not an addon bug....i just tried it with the M4ACOG and the M4ACOGdes....still missing from 1 crate and the crates aren't clearing of M-16 and grenades either! :-\