• 0
Mr Health And Safety

no random boat spawns

Question

I have got vehicles spawning fine on my server but can not work out why boats wont spawn.

In the server config.cpp there is a section relating to what boats should spawn on water but none do

// Stuff to spawn on water
		water[] = 
		{
			"Exile_Boat_MotorBoat_Police",
			"Exile_Boat_MotorBoat_Orange",
			"Exile_Boat_MotorBoat_White",
			"Exile_Boat_RubberDuck_CSAT",
			"Exile_Boat_RubberDuck_Digital",
			"Exile_Boat_RubberDuck_Orange",
			"Exile_Boat_RubberDuck_Blue",
			"Exile_Boat_RubberDuck_Black",
			"Exile_Boat_SDV_CSAT",
			"Exile_Boat_SDV_Digital",
			"Exile_Boat_SDV_Grey"
		};

in ExileServer_world_spawnVehicles.sqf there is nothing about water, only ground.

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/.
 */
 
private["_mapsizeX","_mapsizeY","_gridSize","_gridVehicles","_gridSizeOffset","_vehicleCount","_debugMarkers","_vehicleClassNames","_maximumDamage","_damageChance","_xSize","_workingXSize","_ySize","_workingYSize","_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;
_gridSizeOffset = _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 0 to _mapsizeX step _gridSize do
{
    _workingXSize = _xSize + _gridSizeOffset;
    for "_ySize" from 0 to _mapsizeY step _gridSize do
    {
        _workingYSize = _ySize + _gridSizeOffset;
        _position = [_workingXSize,_workingYSize];
        _spawned = 0;
        _spawnedPositions = [];
        while {_spawned < _gridVehicles} do 
        {
            _positionReal = [_position, 25, _gridSize, 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

Is this a over sight or are boats not intended to spawn randomly at server start?

Share this post


Link to post
Share on other sites

5 answers to this question

  • 0
28 minutes ago, Mr Health And Safety said:

I have got vehicles spawning fine on my server but can not work out why boats wont spawn.

In the server config.cpp there is a section relating to what boats should spawn on water but none do


// Stuff to spawn on water
		water[] = 
		{
			"Exile_Boat_MotorBoat_Police",
			"Exile_Boat_MotorBoat_Orange",
			"Exile_Boat_MotorBoat_White",
			"Exile_Boat_RubberDuck_CSAT",
			"Exile_Boat_RubberDuck_Digital",
			"Exile_Boat_RubberDuck_Orange",
			"Exile_Boat_RubberDuck_Blue",
			"Exile_Boat_RubberDuck_Black",
			"Exile_Boat_SDV_CSAT",
			"Exile_Boat_SDV_Digital",
			"Exile_Boat_SDV_Grey"
		};

in ExileServer_world_spawnVehicles.sqf there is nothing about water, only ground.

  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/.
 */
 
private["_mapsizeX","_mapsizeY","_gridSize","_gridVehicles","_gridSizeOffset","_vehicleCount","_debugMarkers","_vehicleClassNames","_maximumDamage","_damageChance","_xSize","_workingXSize","_ySize","_workingYSize","_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;
_gridSizeOffset = _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 0 to _mapsizeX step _gridSize do
{
    _workingXSize = _xSize + _gridSizeOffset;
    for "_ySize" from 0 to _mapsizeY step _gridSize do
    {
        _workingYSize = _ySize + _gridSizeOffset;
        _position = [_workingXSize,_workingYSize];
        _spawned = 0;
        _spawnedPositions = [];
        while {_spawned < _gridVehicles} do 
        {
            _positionReal = [_position, 25, _gridSize, 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

Is this a over sight or are boats not intended to spawn randomly at server start?

what map are you using ?

Boats spawn fine for me and im sure many others as well. When i removed them, players complianed.

Share this post


Link to post
Share on other sites
  • 0

Altis and Australia.

Altis is the main server and has been running for a couple of weeks now but no boats spawn randomly and Australia is just a local test server I'm working on and again no boats are spawning. I didn't copy any files over from Altis to Australia so its not that i broke something in one and copied it to the other etc.

Share this post


Link to post
Share on other sites
Advertisement
  • 0

interesting. Let me check  a few things, and if i find i also have errors, i will reply, otherwise, i will allow others to respond. I would have no clue how to fix this if its working for me. All of your stuff looks correct.

Thanks,

Josh

Share this post


Link to post
Share on other sites
Advertisement

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!


Register a new account

Sign in

Already have an account? Sign in here.


Sign In Now

  • Recently Browsing   0 members

    No registered users viewing this page.