NG.Wildwire 3 Report post Posted December 20, 2016 Hello, does anyone know why my loot table, Keeps spawning Cup weapons with 100rnd Beta C mags? it is not added to the loot table. Share this post Link to post Share on other sites
NG.Wildwire 3 Report post Posted December 22, 2016 BUMP Share this post Link to post Share on other sites
kuplion 1785 Report post Posted December 22, 2016 Because when a weapon spawns, a random compatible mag' is also spawned. Share this post Link to post Share on other sites
NG.Wildwire 3 Report post Posted December 22, 2016 8 hours ago, kuplion said: Because when a weapon spawns, a random compatible mag' is also spawned. Is there a way to get rid of that? Share this post Link to post Share on other sites
kuplion 1785 Report post Posted December 23, 2016 8 hours ago, Crazy Mike said: ExileServer_system_lootManager_spawnLootInBuilding _magazineClassNames = getArray(configFile >> "CfgWeapons" >> _itemClassName >> "magazines"); if (count(_magazineClassNames) > 0) then { _magazineClassName = selectRandom _magazineClassNames; _numberOfMagazines = 0 + floor(random 4); //hi _lootHolder addMagazineCargoGlobal [_magazineClassName, _numberOfMagazines]; _spawnedItemClassNames pushBack _magazineClassName; }; That'll reduce the number of mags, but not remove/swap out the Beta C mags. Share this post Link to post Share on other sites
NG.Wildwire 3 Report post Posted December 24, 2016 yes i already have that, but my question is. how to remove the Beta C mags from spawning. those 100 round mags does not really fit in my server. Share this post Link to post Share on other sites
kuplion 1785 Report post Posted December 24, 2016 2 minutes ago, Crazy Mike said: you dont You can, it just needs to be scripted. Share this post Link to post Share on other sites
kuplion 1785 Report post Posted December 24, 2016 @NG.Wildwire, do you have the classnames for the unwanted mags there? Share this post Link to post Share on other sites
kuplion 1785 Report post Posted December 24, 2016 (edited) Here ya go: /** * ExileServer_system_lootManager_spawnLootInBuilding * * Exile Mod * exile.majormittens.co.uk * © 2015 Exile Mod Team * * Modified by [FPS]kuplion * * This work is licensed under the Creative Commons Attribution-NonCommercial-NoDerivatives 4.0 International License. * To view a copy of this license, visit http://creativecommons.org/licenses/by-nc-nd/4.0/. */ private["_building","_buildingConfig","_lootTableName","_localPositions","_lootConfig","_maximumNumberOfLootPositions","_maximumPositionCoverage","_maximumNumberOfItemsPerLootSpot","_numberOfPositionsToUse","_lootPositions","_spawnedItemClassNames","_lootWeaponHolderNetIDs","_lootPosition","_lootHolder","_numberOfItemsToSpawn","_n","_itemClassName","_cargoType","_magazineClassNames","_magazineClassName","_numberOfMagazines"]; _building = _this; _building setVariable ["ExileLootSpawnedAt", time]; _building setVariable ["ExileHasLoot", true]; _buildingConfig = configFile >> "CfgBuildings" >> typeOf _building; _lootTableName = getText (_buildingConfig >> "table"); _localPositions = getArray (_buildingConfig >> "positions"); if ((getPosATL _building) call ExileClient_util_world_isInRadiatedZone) then { _lootTableName = "Radiation"; }; _lootConfig = missionConfigFile >> "CfgExileLootSettings"; _maximumNumberOfLootPositions = getNumber (_lootConfig >> "maximumNumberOfLootSpotsPerBuilding"); _maximumPositionCoverage = getNumber (_lootConfig >> "maximumPositionCoverage"); _maximumNumberOfItemsPerLootSpot = getNumber (_lootConfig >> "maximumNumberOfItemsPerLootSpot"); _numberOfPositionsToUse = 1 max (((count _localPositions) * _maximumPositionCoverage / 100) min _maximumNumberOfLootPositions); _localPositions = _localPositions call ExileClient_util_array_shuffle; _lootPositions = _localPositions select [0, _numberOfPositionsToUse]; _spawnedItemClassNames = []; _lootWeaponHolderNetIDs = []; { _lootPosition = ASLToATL (AGLToASL (_building modelToWorld _x)); if (_lootPosition select 2 < 0.05) then { _lootPosition set [2, 0.05]; }; _lootHolder = objNull; _numberOfItemsToSpawn = (floor (random _maximumNumberOfItemsPerLootSpot)) + 1; for "_n" from 1 to _numberOfItemsToSpawn do { _itemClassName = _lootTableName call ExileServer_system_lootManager_dropItem; if !(_itemClassName in _spawnedItemClassNames) then { if (isNull _lootHolder) then { _lootHolder = createVehicle ["LootWeaponHolder", _lootPosition, [], 0, "CAN_COLLIDE"]; _lootHolder setDir (random 360); _lootHolder setPosATL _lootPosition; _lootHolder setVariable ["ExileSpawnedAt", time]; _lootWeaponHolderNetIDs pushBack (netId _lootHolder); }; _cargoType = _itemClassName call ExileClient_util_cargo_getType; switch (_cargoType) do { case 1: { if (_itemClassName isEqualTo "Exile_Item_MountainDupe") then { _lootHolder addMagazineCargoGlobal [_itemClassName, 2]; } else { _lootHolder addMagazineCargoGlobal [_itemClassName, 1]; }; }; case 3: { _lootHolder addBackpackCargoGlobal [_itemClassName, 1]; }; case 2: { _lootHolder addWeaponCargoGlobal [_itemClassName, 1]; if !(_itemClassName isKindOf ["Exile_Melee_Abstract", configFile >> "CfgWeapons"]) then { _magazineClassNames = getArray(configFile >> "CfgWeapons" >> _itemClassName >> "magazines"); if (count(_magazineClassNames) > 0) then { // Start Removal of BetaC Mags _removeBetaCMags = ["CUP_100Rnd_556x45_BetaCMag","CUP_100Rnd_TE1_Red_Tracer_556x45_BetaCMag","CUP_100Rnd_TE1_Green_Tracer_556x45_BetaCMag","CUP_100Rnd_TE1_Yellow_Tracer_556x45_BetaCMag"]; { _magazineClassNames = _magazineClassNames - [_x]; } forEach _removeBetaCMags; // End Removal of BetaC Mags _magazineClassName = selectRandom _magazineClassNames; // Start Spawn Less Ammo _numberOfMagazines = 1 + floor(random 2); // End Spawn Less Ammo _lootHolder addMagazineCargoGlobal [_magazineClassName, _numberOfMagazines]; _spawnedItemClassNames pushBack _magazineClassName; }; }; _numberOfItemsToSpawn = -1; }; default { _lootHolder addItemCargoGlobal [_itemClassName, 1]; }; }; _spawnedItemClassNames pushBack _itemClassName; }; }; } forEach _lootPositions; _building setVariable ["ExileLootWeaponHolderNetIDs", _lootWeaponHolderNetIDs]; ExileServerBuildingNetIdsWithLoot pushBack (netId _building); Cheers to @infiSTAR and @eraser1 for the quick heads up on this. Edited December 24, 2016 by kuplion 1 Share this post Link to post Share on other sites
NG.Wildwire 3 Report post Posted December 24, 2016 11 hours ago, kuplion said: Here ya go: /** * ExileServer_system_lootManager_spawnLootInBuilding * * Exile Mod * exile.majormittens.co.uk * © 2015 Exile Mod Team * * Modified by [FPS]kuplion * * This work is licensed under the Creative Commons Attribution-NonCommercial-NoDerivatives 4.0 International License. * To view a copy of this license, visit http://creativecommons.org/licenses/by-nc-nd/4.0/. */ private["_building","_buildingConfig","_lootTableName","_localPositions","_lootConfig","_maximumNumberOfLootPositions","_maximumPositionCoverage","_maximumNumberOfItemsPerLootSpot","_numberOfPositionsToUse","_lootPositions","_spawnedItemClassNames","_lootWeaponHolderNetIDs","_lootPosition","_lootHolder","_numberOfItemsToSpawn","_n","_itemClassName","_cargoType","_magazineClassNames","_magazineClassName","_numberOfMagazines"]; _building = _this; _building setVariable ["ExileLootSpawnedAt", time]; _building setVariable ["ExileHasLoot", true]; _buildingConfig = configFile >> "CfgBuildings" >> typeOf _building; _lootTableName = getText (_buildingConfig >> "table"); _localPositions = getArray (_buildingConfig >> "positions"); if ((getPosATL _building) call ExileClient_util_world_isInRadiatedZone) then { _lootTableName = "Radiation"; }; _lootConfig = missionConfigFile >> "CfgExileLootSettings"; _maximumNumberOfLootPositions = getNumber (_lootConfig >> "maximumNumberOfLootSpotsPerBuilding"); _maximumPositionCoverage = getNumber (_lootConfig >> "maximumPositionCoverage"); _maximumNumberOfItemsPerLootSpot = getNumber (_lootConfig >> "maximumNumberOfItemsPerLootSpot"); _numberOfPositionsToUse = 1 max (((count _localPositions) * _maximumPositionCoverage / 100) min _maximumNumberOfLootPositions); _localPositions = _localPositions call ExileClient_util_array_shuffle; _lootPositions = _localPositions select [0, _numberOfPositionsToUse]; _spawnedItemClassNames = []; _lootWeaponHolderNetIDs = []; { _lootPosition = ASLToATL (AGLToASL (_building modelToWorld _x)); if (_lootPosition select 2 < 0.05) then { _lootPosition set [2, 0.05]; }; _lootHolder = objNull; _numberOfItemsToSpawn = (floor (random _maximumNumberOfItemsPerLootSpot)) + 1; for "_n" from 1 to _numberOfItemsToSpawn do { _itemClassName = _lootTableName call ExileServer_system_lootManager_dropItem; if !(_itemClassName in _spawnedItemClassNames) then { if (isNull _lootHolder) then { _lootHolder = createVehicle ["LootWeaponHolder", _lootPosition, [], 0, "CAN_COLLIDE"]; _lootHolder setDir (random 360); _lootHolder setPosATL _lootPosition; _lootHolder setVariable ["ExileSpawnedAt", time]; _lootWeaponHolderNetIDs pushBack (netId _lootHolder); }; _cargoType = _itemClassName call ExileClient_util_cargo_getType; switch (_cargoType) do { case 1: { if (_itemClassName isEqualTo "Exile_Item_MountainDupe") then { _lootHolder addMagazineCargoGlobal [_itemClassName, 2]; } else { _lootHolder addMagazineCargoGlobal [_itemClassName, 1]; }; }; case 3: { _lootHolder addBackpackCargoGlobal [_itemClassName, 1]; }; case 2: { _lootHolder addWeaponCargoGlobal [_itemClassName, 1]; if !(_itemClassName isKindOf ["Exile_Melee_Abstract", configFile >> "CfgWeapons"]) then { _magazineClassNames = getArray(configFile >> "CfgWeapons" >> _itemClassName >> "magazines"); if (count(_magazineClassNames) > 0) then { // Start Removal of BetaC Mags _removeBetaCMags = ["CUP_100Rnd_556x45_BetaCMag","CUP_100Rnd_TE1_Red_Tracer_556x45_BetaCMag","CUP_100Rnd_TE1_Green_Tracer_556x45_BetaCMag","CUP_100Rnd_TE1_Yellow_Tracer_556x45_BetaCMag"]; { _magazineClassNames = _magazineClassNames - [_x]; } forEach _removeBetaCMags; // End Removal of BetaC Mags _magazineClassName = selectRandom _magazineClassNames; // Start Spawn Less Ammo _numberOfMagazines = 1 + floor(random 2); // End Spawn Less Ammo _lootHolder addMagazineCargoGlobal [_magazineClassName, _numberOfMagazines]; _spawnedItemClassNames pushBack _magazineClassName; }; }; _numberOfItemsToSpawn = -1; }; default { _lootHolder addItemCargoGlobal [_itemClassName, 1]; }; }; _spawnedItemClassNames pushBack _itemClassName; }; }; } forEach _lootPositions; _building setVariable ["ExileLootWeaponHolderNetIDs", _lootWeaponHolderNetIDs]; ExileServerBuildingNetIdsWithLoot pushBack (netId _building); Cheers to @infiSTAR and @eraser1 for the quick heads up on this. It works! Amazing thanks everyone! 1 Share this post Link to post Share on other sites