Jump to content
DEH4NK

spawn size of the transport on the .Enoch map

Recommended Posts

Where can I adjust the spawn size of the transport on the .Enoch map? Someone already asked this before on the main forum, but as far as I remember, I did not receive an answer.

20190805093231-1.jpg

Share this post


Link to post
Share on other sites
2 hours ago, WAKeupneo said:

Hey, what do you mean "the transport"?

@ExileServer\addons\exile_server_config\config.cpp --- class VehicleSpawn

As you can see in the screenshot, a large number of vehicles appear outside the map itself, from the bottom and to the left.

Share this post


Link to post
Share on other sites

Try that.

 

Fixed by Michael Cullen,

 

ExileServer_world_spawnVehicles.sqf

 

Spoiler

/**
 * ExileServer_world_spawnVehicles
 *
 * Exile Mod
 * www.exilemod.com
 * © 2015 Exile Mod Team
 *
 * 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/.
 *
 * Fixed by Michael Cullen, no rights reserved.
 */
 
private["_mapsizeX","_mapsizeY","_gridSize","_gridVehicles","_gridHalf","_vehicleCount","_debugMarkers","_vehicleClassNames","_maximumDamage","_damageChance","_xSize","_ySize","_position","_spawned","_spawnedPositions","_positionReal","_spawnControl","_vehicleClassName","_vehicle","_hitpointsData","_hitpoints","_debugMarker"];

_mapsizeX = worldSize;
_mapsizeY = worldSize;
_gridSize = getNumber(configFile >> "CfgSettings" >> "VehicleSpawn" >> "vehiclesGridSize");
_gridVehicles = getNumber(configFile >> "CfgSettings" >> "VehicleSpawn" >> "vehiclesGridAmount");
format ["Spawning Dynamic Vehicles. GridSize: %1 Vehs/Grid: %2",_gridSize,_gridVehicles] call ExileServer_util_log;
_gridHalf = _gridSize / 2;
_vehicleCount = 0;
_debugMarkers = ((getNumber(configFile >> "CfgSettings" >> "VehicleSpawn" >> "vehiclesDebugMarkers")) isEqualTo 1);
_vehicleClassNames = getArray (configFile >> "CfgSettings" >> "VehicleSpawn" >> "ground");
_maximumDamage = getNumber (configFile >> "CfgSettings" >> "VehicleSpawn" >> "maximumDamage");
_damageChance = getNumber (configFile >> "CfgSettings" >> "VehicleSpawn" >> "damageChance");

for "_xSize" from _gridHalf to (_mapsizeX - _gridHalf) step _gridSize do
{
    for "_ySize" from _gridHalf to (_mapsizeY - _gridHalf) step _gridSize do
    {
        _position = [_xSize,_ySize];
        _spawned = 0;
        _spawnedPositions = [];
        while {_spawned < _gridVehicles} do 
        {
            _positionReal = [_position, 25, _gridHalf, 5, 0 , 1 , 0 , _spawnedPositions] call BIS_fnc_findSafePos;
            if(count _positionReal isEqualTo 3)exitWith{};
            _spawnControl = [[(_positionReal select 0) - 50, (_positionReal select 1) + 50],[(_positionReal select 0) + 50,(_positionReal select 1) - 50]];
            _spawnedPositions pushBack _spawnControl;
            _positionReal pushBack 0;
            _vehicleClassName = selectRandom _vehicleClassNames;
            _vehicle = [_vehicleClassName, _positionReal, random 360, true] call ExileServer_object_vehicle_createNonPersistentVehicle;
            _hitpointsData = getAllHitPointsDamage _vehicle;
            if !(_hitpointsData isEqualTo []) then 
            {
                _hitpoints = _hitpointsData select 0;
                {
                    if ((random 100) < _damageChance) then
                    {
                        _vehicle setHitPointDamage [_x, random _maximumDamage];
                    };
                }
                forEach _hitpoints;
            };
            if (_debugMarkers) then
            {
                _debugMarker = createMarker ["vehicleMarker#"+str _vehicleCount, _positionReal];
                _debugMarker setMarkerColor "ColorOrange";
                _debugMarker setMarkerType "mil_dot_noShadow";
            };
            _spawned = _spawned + 1;
            _vehicleCount = _vehicleCount + 1;
        };
    };
};
format ["Dynamic vehicles spawned. Count : %1",_vehicleCount] call ExileServer_util_log;
true

 

config.cpp

Spoiler

//Vehicle Spawn Fix
    ExileServer_world_spawnVehicles                                                 = "Custom\VehicleSpawnFix\ExileServer_world_spawnVehicles.sqf";

 

  • Like 2

Share this post


Link to post
Share on other sites
50 minutes ago, Whitey01 said:

Try that.

 

Fixed by Michael Cullen,

 

ExileServer_world_spawnVehicles.sqf

 

  Reveal hidden contents

/**
 * ExileServer_world_spawnVehicles
 *
 * Exile Mod
 * www.exilemod.com
 * © 2015 Exile Mod Team
 *
 * 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/.
 *
 * Fixed by Michael Cullen, no rights reserved.
 */
 
private["_mapsizeX","_mapsizeY","_gridSize","_gridVehicles","_gridHalf","_vehicleCount","_debugMarkers","_vehicleClassNames","_maximumDamage","_damageChance","_xSize","_ySize","_position","_spawned","_spawnedPositions","_positionReal","_spawnControl","_vehicleClassName","_vehicle","_hitpointsData","_hitpoints","_debugMarker"];

_mapsizeX = worldSize;
_mapsizeY = worldSize;
_gridSize = getNumber(configFile >> "CfgSettings" >> "VehicleSpawn" >> "vehiclesGridSize");
_gridVehicles = getNumber(configFile >> "CfgSettings" >> "VehicleSpawn" >> "vehiclesGridAmount");
format ["Spawning Dynamic Vehicles. GridSize: %1 Vehs/Grid: %2",_gridSize,_gridVehicles] call ExileServer_util_log;
_gridHalf = _gridSize / 2;
_vehicleCount = 0;
_debugMarkers = ((getNumber(configFile >> "CfgSettings" >> "VehicleSpawn" >> "vehiclesDebugMarkers")) isEqualTo 1);
_vehicleClassNames = getArray (configFile >> "CfgSettings" >> "VehicleSpawn" >> "ground");
_maximumDamage = getNumber (configFile >> "CfgSettings" >> "VehicleSpawn" >> "maximumDamage");
_damageChance = getNumber (configFile >> "CfgSettings" >> "VehicleSpawn" >> "damageChance");

for "_xSize" from _gridHalf to (_mapsizeX - _gridHalf) step _gridSize do
{
    for "_ySize" from _gridHalf to (_mapsizeY - _gridHalf) step _gridSize do
    {
        _position = [_xSize,_ySize];
        _spawned = 0;
        _spawnedPositions = [];
        while {_spawned < _gridVehicles} do 
        {
            _positionReal = [_position, 25, _gridHalf, 5, 0 , 1 , 0 , _spawnedPositions] call BIS_fnc_findSafePos;
            if(count _positionReal isEqualTo 3)exitWith{};
            _spawnControl = [[(_positionReal select 0) - 50, (_positionReal select 1) + 50],[(_positionReal select 0) + 50,(_positionReal select 1) - 50]];
            _spawnedPositions pushBack _spawnControl;
            _positionReal pushBack 0;
            _vehicleClassName = selectRandom _vehicleClassNames;
            _vehicle = [_vehicleClassName, _positionReal, random 360, true] call ExileServer_object_vehicle_createNonPersistentVehicle;
            _hitpointsData = getAllHitPointsDamage _vehicle;
            if !(_hitpointsData isEqualTo []) then 
            {
                _hitpoints = _hitpointsData select 0;
                {
                    if ((random 100) < _damageChance) then
                    {
                        _vehicle setHitPointDamage [_x, random _maximumDamage];
                    };
                }
                forEach _hitpoints;
            };
            if (_debugMarkers) then
            {
                _debugMarker = createMarker ["vehicleMarker#"+str _vehicleCount, _positionReal];
                _debugMarker setMarkerColor "ColorOrange";
                _debugMarker setMarkerType "mil_dot_noShadow";
            };
            _spawned = _spawned + 1;
            _vehicleCount = _vehicleCount + 1;
        };
    };
};
format ["Dynamic vehicles spawned. Count : %1",_vehicleCount] call ExileServer_util_log;
true

 

config.cpp

  Hide contents

//Vehicle Spawn Fix
    ExileServer_world_spawnVehicles                                                 = "Custom\VehicleSpawnFix\ExileServer_world_spawnVehicles.sqf";

 

Thank you very much!!! It works.

20190814191743-1.jpg

  • Like 1

Share this post


Link to post
Share on other sites

File ExileServer_world_spawnVehicles.sqf for those who want to use it with this script: https://web.archive.org/web/20171216095410/http://www.exilemod.com/topic/9184-dynamic-vehicle-spawn-with-items-in-their-inventory/

Spoiler

/**
 * ExileServer_world_spawnVehicles
 *
 * Exile Mod
 * www.exilemod.com
 * © 2015 Exile Mod Team
 *
 * 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/.
 *
 * Fixed by Michael Cullen, no rights reserved.
 */
 
private["_mapsizeX","_mapsizeY","_gridSize","_gridVehicles","_gridHalf","_vehicleCount","_debugMarkers","_vehicleClassNames","_maximumDamage","_damageChance","_xSize","_ySize","_position","_spawned","_spawnedPositions","_positionReal","_spawnControl","_vehicleClassName","_vehicle","_hitpointsData","_hitpoints","_debugMarker","_randomizeFuel","_fuel","_randomizeAmmo","_ammo","_vehicleItemsAllowed","_allowedItems","_maximumItemsPerVehicle","_itemsAdded","_itemsPerVehicle","_itemAdd","_cargoType"];

_mapsizeX = worldSize;
_mapsizeY = worldSize;
_gridSize = getNumber(configFile >> "CfgSettings" >> "VehicleSpawn" >> "vehiclesGridSize");
_gridVehicles = getNumber(configFile >> "CfgSettings" >> "VehicleSpawn" >> "vehiclesGridAmount");
format ["Spawning Dynamic Vehicles. GridSize: %1 Vehs/Grid: %2",_gridSize,_gridVehicles] call ExileServer_util_log;
_gridHalf = _gridSize / 2;
_vehicleCount = 0;
_debugMarkers = ((getNumber(configFile >> "CfgSettings" >> "VehicleSpawn" >> "vehiclesDebugMarkers")) isEqualTo 1);
_vehicleClassNames = getArray (configFile >> "CfgSettings" >> "VehicleSpawn" >> "ground");
_maximumDamage = getNumber (configFile >> "CfgSettings" >> "VehicleSpawn" >> "maximumDamage");
_damageChance = getNumber (configFile >> "CfgSettings" >> "VehicleSpawn" >> "damageChance");
_randomizeFuel = ((getNumber(configFile >> "CfgSettings" >> "VehicleSpawn" >> "randomizeFuel")) isEqualTo 1);
_fuel = (getNumber(configFile >> "CfgSettings" >> "VehicleSpawn" >> "fuel"));
_randomizeAmmo = ((getNumber(configFile >> "CfgSettings" >> "VehicleSpawn" >> "randomizeAmmo")) isEqualTo 1);
_ammo = (getNumber(configFile >> "CfgSettings" >> "VehicleSpawn" >> "ammo"));
_vehicleItemsAllowed = getNumber (missionConfigFile >> "SpawnVehicleItems" >> "WorldVehicles" >> "vehicleItemsAllowed");
_allowedItems = getArray (missionConfigFile >> "SpawnVehicleItems" >> "WorldVehicles" >> "allowedItems");
_maximumItemsPerVehicle = getNumber (missionConfigFile >> "SpawnVehicleItems" >> "WorldVehicles" >> "maximumItemsPerVehicle");
_maximumItemsPerVehicle = _maximumItemsPerVehicle +1;
for "_xSize" from _gridHalf to (_mapsizeX - _gridHalf) step _gridSize do
{
    for "_ySize" from _gridHalf to (_mapsizeY - _gridHalf) step _gridSize do
    {
        _position = [_xSize,_ySize];
        _spawned = 0;
        _spawnedPositions = [];
        while {_spawned < _gridVehicles} do 
        {
            _positionReal = [_position, 25, _gridHalf, 5, 0 , 1 , 0 , _spawnedPositions] call BIS_fnc_findSafePos;
            if(count _positionReal isEqualTo 3)exitWith{};
            _spawnControl = [[(_positionReal select 0) - 50, (_positionReal select 1) + 50],[(_positionReal select 0) + 50,(_positionReal select 1) - 50]];
            _spawnedPositions pushBack _spawnControl;
            _positionReal pushBack 0;
            _vehicleClassName = selectRandom _vehicleClassNames;
            _vehicle = [_vehicleClassName, _positionReal, random 360, true] call ExileServer_object_vehicle_createNonPersistentVehicle;
            _hitpointsData = getAllHitPointsDamage _vehicle;
            if !(_hitpointsData isEqualTo []) then 
            {
                _hitpoints = _hitpointsData select 0;
                {
                    if ((random 100) < _damageChance) then
                    {
                        _vehicle setHitPointDamage [_x, random _maximumDamage];
                    };
                }
                forEach _hitpoints;
            };
            if (_randomizeFuel) then
            {
                _vehicle setFuel (random _fuel);
            }
            else
            {
                _vehicle setFuel _fuel;
            };
            if (_randomizeAmmo) then
            {
                _vehicle setVehicleAmmo (random _ammo);
            }
            else
            {
                _vehicle setVehicleAmmo _ammo;
            };                                     
            if (_debugMarkers) then
            {
                _debugMarker = createMarker ["vehicleMarker#"+str _vehicleCount, _positionReal];
                _debugMarker setMarkerColor "ColorOrange";
                _debugMarker setMarkerType "mil_dot_noShadow";
            };
      if (_vehicleItemsAllowed isEqualTo 1) then {
        _itemsAdded = 0;
        _itemsPerVehicle = floor (random _maximumItemsPerVehicle);
        while{_itemsAdded < _itemsPerVehicle} do {
          _itemAdd = _allowedItems select (floor (random (count _allowedItems)));
          _cargoType = _itemAdd call ExileClient_util_cargo_getType;
          switch (_cargoType) do {
            case 1: { _vehicle addMagazineAmmoCargo [_itemAdd, 1, 1]; };
            case 2: { _vehicle addWeaponCargoGlobal [_itemAdd, 1]; };
            case 3: { _vehicle addBackpackCargoGlobal [_itemAdd, 1]; };
            default { _vehicle addItemCargoGlobal [_itemAdd, 1, 1]; };
          };
          _itemsAdded = _itemsAdded + 1;
        };
      };                                                      
            _spawned = _spawned + 1;
            _vehicleCount = _vehicleCount + 1;
        };
    };
};
format ["Dynamic vehicles spawned. Count : %1",_vehicleCount] call ExileServer_util_log;
true

 

Share this post


Link to post
Share on other sites

×