Jump to content
Sign in to follow this  
Lexen

At my wits end, Re: Crate filler

Recommended Posts

I searched. I tried damn near everything i've found.

Here's the whole lowdown -

Players spawn into a RHIB (boat) named "c". (which means I use the moveInCargo for the players). I have been trying to fill this boat with weapons so I don't have to plant a bunch of boxes on the beach. I've filled vehicles and crates with weapons well over a year now and have never had a problem. Since Sunday night, i've tried everything to get this to work and it just won't! I don't know what the problem is. The only difference I can see between then and now is that this boat has a name. Most of the vehicles i've used in the past have not had names.

I'm using mostly ACE weapons, with a few BIS things in there but again, it hasn't been a problem in the past.

Please take a look at my code and point out what i'm overlooking.

Thank you for any help.

In the boats init:

nul = [this] execVM "loadout.sqf";

The loadout script:

private ["_crate"];
_crate = _this select 0;

clearMagazineCargo _this;
clearWeaponCargo _this;


//weapons
		_crate addWeaponCargo["MAAWS",2];
		_crate addWeaponCargo["M136",15];
		_crate addWeaponCargo["M249_m145_EP1",5];
		_crate addWeaponCargo["ACE_TAC50_SD",5];
		_crate addWeaponCargo["VSS_vintorez",10];
		_crate addWeaponCargo["M110_NVG_EP1",10];
		_crate addWeaponCargo["SCAR_H_LNG_Sniper",5];
		_crate addWeaponCargo["SCAR_H_CQC_CCO_SD",10];
		_crate addWeaponCargo["M32_EP1",5];
		_crate addWeaponCargo["ACE_UMP45_AIM_SD",10];
		_crate addWeaponCargo["ACE_SOC_M4A1_SHORTDOT_SD",10];
		_crate addWeaponCargo["ACE_SOC_M4A1_AIM_SD",10];
		_crate addWeaponCargo["ACE_MP5SD",10];
		_crate addWeaponCargo["ACE_M4A1_AIM_GL_SD",10];
		_crate addWeaponCargo["ACE_M4A1_ACOG_SD",10];
		_crate addWeaponCargo["ACE_HK416_D10_SD",10];
		_crate addWeaponCargo["ACE_HK416_D10_COMPM3_SD",10];
		_crate addWeaponCargo["UZI_SD_EP1",10];
		_crate addWeaponCargo["M9_SD",15];
		_crate addWeaponCargo["ACE_USPSD",15];
		_crate addWeaponCargo["MK_48",3];


//magazines and Ordinance
		_crate addMagazineCargo["ACE_C4_M",20];
		_crate addMagazineCargo["MAAWS_HEAT",20];
		_crate addMagazineCargo["ACE_MAAWS_HE",20];
		_crate addMagazineCargo["ACE_100Rnd_556x45_T_M249",70];
		_crate addMagazineCargo["ACE_HuntIR_M203",20];
		_crate addMagazineCargo["ACE_5Rnd_127x99_S_TAC50",50];
		_crate addMagazineCargo["20Rnd_9x39_SP5_VSS",50];
		_crate addMagazineCargo["ACE_20Rnd_762x51_S_M110",80];
		_crate addMagazineCargo["ACE_20Rnd_762x51_S_SCAR",150];
		_crate addMagazineCargo["6Rnd_HE_M203",50];
		_crate addMagazineCargo["ACE_25Rnd_1143x23_S_UMP45",50];
		_crate addMagazineCargo["30Rnd_9x19_MP5SD",50];
		_crate addMagazineCargo["1Rnd_Smoke_M203",20];
		_crate addMagazineCargo["ACE_1Rnd_HE_M203",50];
		_crate addMagazineCargo["30Rnd_556x45_StanagSD",200];
		_crate addMagazineCargo["30Rnd_9x19_UZI_SD",30];
		_crate addMagazineCargo["15Rnd_9x19_M9SD",];
		_crate addMagazineCargo["ACE_12Rnd_45ACP_SD",];
		_crate addMagazineCargo["100Rnd_762x51_M240",50];
		_crate addMagazineCargo["HandGrenade_West",10];
		_crate addMagazineCargo["TimeBomb",12];
//Medical
		_crate addMagazineCargo["ACE_Morphine",100];
		_crate addMagazineCargo["ACE_Bandage",100];
		_crate addMagazineCargo["ACE_Epinephrine",50];
		_crate addMagazineCargo["ACE_LargeBandage",50];
		_crate addMagazineCargo["ACE_Medkit",100];


//Tools
		_crate addWeaponCargo["NVGoggles",8];
		_crate addWeaponCargo["ACE_Earplugs",30];
		_crate addWeaponCargo["ACE_Glasses_LHD_glasses",12];
		_crate addWeaponCargo["ACE_HuntIR_monitor",15];
		_crate addWeaponCargo["ACE_Rucksack_MOLLE_Green_Medic",10];
		_crate addWeaponCargo["ACE_Backpack_US",20];

Edited by Lexen

Share this post


Link to post
Share on other sites

You're referencing an array where an object is needed.

Change...

clearMagazineCargo _this;
clearWeaponCargo _this;

...to...

clearMagazineCargo _crate;
clearWeaponCargo _crate;

Running your game with -showscripterrors will point out these issues for you.

Still, that won't fill the boat for you. Odd - no ships of any kind are listed in Kylania's cargo capacity spreadsheet (http://www.kylania.com/ex/?p=105). It may be possible that the boats have zero capacity, in which case nothing will fit in them. You might be able to fake it by using attachTo with an ammo crate or something.

Share this post


Link to post
Share on other sites

Thank you!

I didn't know that there was a cargo capacity for each vehicle. We had a URAL with literally 20-50 of every ACE and BIS weapon, hundreds of magazines, mines, grenades, backpacks, launchers, etc... and it never gave us an issue. I do know that boats have some sort of capacity. There was stuff in the RHIB every time I got out to look.

We used to stick it on the "rifle ranges" we would build instead of having 30 weapon crates lying around.

Thanks for the link to the cargo capacity spreadsheet. Got it bookmarked and thanks again for the change. I'll make the change when I get home tonight.

:bounce3:

Edited by Lexen

Share this post


Link to post
Share on other sites

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now
Sign in to follow this  

×