Vehicle Loot Spawns

Vehicle Loot Spawns

« posted: Mar 19, 2015, 04:06 PM »
Hello I've just set up a an arma 3 server which is running the @mas18 mod. I've been able to implement the weapons into the the gun store without too much trouble but now I'm stumped with how to add them to the vehicle loot tables.

I've added some weapons to the servervars.sqf but they just dont show up inside vehicles at all,

So what I've added looks like this

 
Code: [Select]
//Random Weapon List - Change this to what you want to spawn in cars.
vehicleWeapons =
[
// "hgun_P07_F",
// "hgun_Rook40_F",
// "hgun_ACPC2_F",
// "arifle_SDAR_F",
// "SMG_01_F", // Vermin .45 ACP
// "SMG_02_F", // Sting 9mm
// "hgun_PDW2000_F",
"arifle_TRG20_F",
"arifle_TRG21_F",
"arifle_TRG21_GL_F",
"arifle_Mk20C_F",
"arifle_Mk20_F",
"arifle_Mk20_GL_F",
"arifle_Katiba_F",
"arifle_Katiba_C_F",
"arifle_Katiba_GL_F",
"arifle_MXC_F",
"arifle_MX_F",
"arifle_MX_GL_F",
"arifle_MX_SW_F",
"arifle_MXM_F",
"srifle_EBR_F",
"LMG_Mk200_F",
"LMG_Zafir_F",
"arifle_mas_hk416",
"arifle_mas_hk416_v",
"arifle_mas_hk416_d",
"arifle_mas_hk416_m203",
"arifle_mas_hk417c",
"arifle_mas_hk417c_v",
"arifle_mas_hk417c_d",
"arifle_mas_hk417c_m203",
"arifle_mas_m4",
"arifle_mas_m4_v",
"arifle_mas_m4_d",
"arifle_mas_m4_m203",
"arifle_mas_m4c",
"arifle_mas_m4c_v",
"arifle_mas_m4c_d",
"arifle_mas_m4c_m203",
"arifle_mas_m16",
"arifle_mas_l119",
"arifle_mas_l119_v",
"arifle_mas_l119_d",
"arifle_mas_l119_m203",
"arifle_mas_g36c",
"arifle_mas_mk16",
"arifle_mas_mk16_gl",
"arifle_mas_mk16_l",
"arifle_mas_mk16_l_gl",
"arifle_mas_mk17",
"arifle_mas_mk17_gl",
"arifle_mas_arx",
"arifle_mas_arx_gl",
"arifle_mas_arx_l",
"arifle_mas_arx_l_gl",
"arifle_mas_g3",
"arifle_mas_g3_m203",
"arifle_mas_g3s",
"arifle_mas_g3s_m203",
"arifle_mas_fal",
"arifle_mas_fal_m203",
"arifle_mas_m14"
];

Is there any other files I need to edit or is this all I should have to change to put them in? I've also tried removing the base weapon spawns and just adding 1 of the Mas weapons to force that one to spawn but still had no luck.

Any help will be much appreciated
  • Offline CREAMPIE
  • Armaholic
  • Veteran
  • ******
  • Posts: 1077
  • ^_^;;

Re: Vehicle Loot Spawns

« Reply #1 posted: Mar 19, 2015, 04:25 PM »
looks okay .... just check your RPT for errors, you might have done something else in the servervars.sqf and broken it ..

RPT will give you the issue on server startup - note the file and line number then check it to make sure it's fine.

I've done this and it was working okay.


- from the grassy knoll -

Re: Vehicle Loot Spawns

« Reply #2 posted: Mar 19, 2015, 06:04 PM »
Thanks for the quick reply, Hmm I see so you dont need to add them anywhere else? I havent touched the Vars file apart from that list of code and the base weapons still spawn just not the mas weapons.

After digging through my server report I'm getting this on repeat

Code: [Select]
2015/03/19, 13:01:52 Error in expression <eapon, 1];
_car addMagazineCargoGlobal [_mag, 2 + floor random 3];

_car addItem>
2015/03/19, 13:01:52   Error position: <_mag, 2 + floor random 3];

_car addItem>
2015/03/19, 13:01:52   Error Undefined variable in expression: _mag
2015/03/19, 13:01:52 File mpmissions\A3Wasteland_v1.1.Stratis\server\spawning\randomWeapon.sqf, line 66
2015/03/19, 13:01:52 Warning Message: No entry 'bin\config.bin/CfgWeapons.arifle_mas_mk17'.

Looking at the randomweapon.sqf it is referring to this string of code

Code: [Select]
// A3W_vehicleloot
//Add guns and magazines, note the Global at the end
//add a probability of 50% of a vehicle getting a gun or some more additional loot instead
switch (["A3W_vehicleLoot", 1] call getPublicVar) do
{
case 1:
{
_random = random 1;

// If building loot is turned off, give everything, otherwise 50/50 chance between gun or items
if (_random < 0.5 || !_buildingLootOn) then
{
_car addWeaponCargoGlobal [_weapon, 1];
_car addMagazineCargoGlobal [_mag, 2 + floor random 3];
};
if (_random >= 0.5 || !_buildingLootOn) then
{
_car addItemCargoGlobal [_additionTwo, 1];
if (_nightTime) then { _car addMagazineCargoGlobal [_additionThree, 1] };
};

_car addItemCargoGlobal [_additionOne, 1];
};
case 2:
{
_car addWeaponCargoGlobal [_weapon, 1];
#########_car addMagazineCargoGlobal [_mag, 2 + floor random 3];#################################

_car addItemCargoGlobal ["FirstAidKit", 1];
_car addItemCargoGlobal [_additionOne, 1];
_car addItemCargoGlobal [_additionTwo, 1];
if (_nightTime) then { _car addMagazineCargoGlobal [_additionThree, 1] };
};
case 3:
{
_car addWeaponCargoGlobal [_weapon, 1];
_car addMagazineCargoGlobal [_mag, 2 + floor random 3];

// 2nd weapon
_weapon = vehicleWeapons call BIS_fnc_selectRandom;
_mag = ((getArray (configFile >> "CfgWeapons" >> _weapon >> "magazines")) select 0) call getBallMagazine;
_car addWeaponCargoGlobal [_weapon, 1];
_car addMagazineCargoGlobal [_mag, 2 + floor random 3];

_car addItemCargoGlobal ["FirstAidKit", 2];
_car addItemCargoGlobal [_additionOne, 2];
_car addItemCargoGlobal [_additionTwo, 2];
if (_nightTime) then { _car addMagazineCargoGlobal [_additionThree, 1] };
};
};

The line with the hashes is which it's referring to. It also mentions a cfgweapons do I need to edit that file?
  • Offline CREAMPIE
  • Armaholic
  • Veteran
  • ******
  • Posts: 1077
  • ^_^;;

Re: Vehicle Loot Spawns

« Reply #3 posted: Mar 20, 2015, 06:30 AM »
okay a silly question here ...


You should ONLY have to add the classes to the servervars.sqf to get them to spawn in with vehicles.

Are you launching your server with the -mod=@mas parameter ? if you aren't then the server won't "recognize" these class names and throw those kinda errors in the RPT.

Have a look and let me know ..

That's usually a common issue.

- from the grassy knoll -

Re: Vehicle Loot Spawns

« Reply #4 posted: Mar 20, 2015, 10:39 PM »
Yeah it's definitely in the launch parameters and they do work in the gunstore so the server is detecting them okay, so I'm completely stumped here.

Edit 1: Going to replace my current file with the default and readd all the weapons, hopefully this will sort it in the case of an accidental edit somewhere

Edit 2: Still no luck even with doing the fresh servervars.sqf, base arma weapons spawn but the mas ones leave empty vehicles with just scopes in them
  • Offline CREAMPIE
  • Armaholic
  • Veteran
  • ******
  • Posts: 1077
  • ^_^;;

Re: Vehicle Loot Spawns

« Reply #5 posted: Mar 21, 2015, 07:34 AM »
Here's an older version of my chernarus mission file with random MAS 1.8 weapons inside vehicles.

https://github.com/CRE4MPIE/ArmA3_Wasteland.Chernarus


- from the grassy knoll -

Re: Vehicle Loot Spawns

« Reply #6 posted: Mar 21, 2015, 05:40 PM »
Thanks, tried copying your Vars file and still having the same issue, replaced my randomweapons.sqf with yours as well to see if that would fix it, still not working :(

Going try adding them to building loot spawns see if the issue is just localized to vehicle spawning.

Edit: After adding them to building spawns mas weapons still didn't spawn and also I'm unable to spawn them in using infistar admin tools, I can select them but when I press spawn nothing spawns.

It's almost like the server isnt reading the @mas18 correctly, but it's strange that I can buy them no problem from the gun store itself.

The full error in the rpt is this:

Code: [Select]
2015/03/21, 11:55:08 Warning Message: No entry 'bin\config.bin/CfgWeapons.arifle_mas_mk16_l_gl'.
2015/03/21, 11:55:08 Warning Message: No entry '.scope'.
2015/03/21, 11:55:08 Warning Message: '/' is not a value
2015/03/21, 11:55:08 Warning Message: Error: creating weapon arifle_mas_mk16_l_gl with scope=private
2015/03/21, 11:55:08 Warning Message: No entry '.displayName'.
2015/03/21, 11:55:08 Warning Message: '/' is not a value
2015/03/21, 11:55:08 Warning Message: No entry '.nameSound'.
2015/03/21, 11:55:08 Warning Message: '/' is not a value
2015/03/21, 11:55:08 Warning Message: No entry '.type'.
2015/03/21, 11:55:08 Warning Message: '/' is not a value
2015/03/21, 11:55:08 Warning Message: No entry '.picture'.
2015/03/21, 11:55:08 Warning Message: '/' is not a value
2015/03/21, 11:55:08 Warning Message: No entry '.Library'.
2015/03/21, 11:55:08 Warning Message: No entry '.libTextDesc'.
2015/03/21, 11:55:08 Warning Message: '/' is not a value
2015/03/21, 11:55:08 Warning Message: No entry '.model'.
2015/03/21, 11:55:08 Warning Message: '/' is not a value
2015/03/21, 11:55:08 Warning Message: No entry '.simulation'.
2015/03/21, 11:55:08 Warning Message: '/' is not a value
2015/03/21, 11:55:08 Warning Message: No entry '.fireLightDuration'.
2015/03/21, 11:55:08 Warning Message: '/' is not a value
2015/03/21, 11:55:08 Warning Message: No entry '.fireLightIntensity'.
2015/03/21, 11:55:08 Warning Message: '/' is not a value
2015/03/21, 11:55:08 Warning Message: No entry '.fireLightDiffuse'.
2015/03/21, 11:55:08 Warning Message: Size: '/' not an array
2015/03/21, 11:55:08 Warning Message: Size: '/' not an array
2015/03/21, 11:55:08 Warning Message: No entry '.fireLightAmbient'.
2015/03/21, 11:55:08 Warning Message: Size: '/' not an array
2015/03/21, 11:55:08 Warning Message: Size: '/' not an array
2015/03/21, 11:55:08 Warning Message: No entry '.weaponLockDelay'.
2015/03/21, 11:55:08 Warning Message: '/' is not a value
2015/03/21, 11:55:08 Warning Message: No entry '.weaponLockSystem'.
2015/03/21, 11:55:08 Warning Message: '/' is not a value
2015/03/21, 11:55:08 Warning Message: No entry '.cmImmunity'.
2015/03/21, 11:55:08 Warning Message: '/' is not a value
2015/03/21, 11:55:08 Warning Message: No entry '.weight'.
2015/03/21, 11:55:08 Warning Message: '/' is not a value
2015/03/21, 11:55:08 Warning Message: No entry '.lockingTargetSound'.
2015/03/21, 11:55:08 Warning Message: Size: '/' not an array
2015/03/21, 11:55:08 Warning Message: No entry '.lockedTargetSound'.
2015/03/21, 11:55:08 Warning Message: Size: '/' not an array
2015/03/21, 11:55:08 Warning Message: No entry '.detectRange'.
2015/03/21, 11:55:08 Warning Message: '/' is not a value
2015/03/21, 11:55:08 Warning Message: No entry '.muzzles'.
2015/03/21, 11:55:08 Warning Message: Size: '/' not an array
2015/03/21, 11:55:08 Error in expression <eapon, 1];
_car addMagazineCargoGlobal [_mag, 2 + floor random 3];

_car addItem>
2015/03/21, 11:55:08   Error position: <_mag, 2 + floor random 3];

_car addItem>
2015/03/21, 11:55:08   Error Undefined variable in expression: _mag
2015/03/21, 11:55:08 File mpmissions\A3Wasteland_v1.1.Stratis\server\spawning\randomWeapon.sqf, line 66