• 0
xunin

esseker vehicles spawning out of map

Question

AsX2hiK.jpg

 

vehicles spawning out of map and never on top ... has anyone a solution

Edited by xunin

Share this post


Link to post
Share on other sites

20 answers to this question

  • 0

I have overwritten the spawn sqf and added esseker values, but there must be a better way..



 

Share this post


Link to post
Share on other sites
Advertisement
  • 0

ExileServer_world_SpawnVehicles.sqf:

 

/**
 * 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["_mapcenter","_mapCenterKindaButNotReally","_mapsizeX","_mapsizeY","_gridSize","_gridVehicles","_gridSizeOffset","_vehicleCount","_debugMarkers","_vehicleClassNames","_maximumDamage","_damageChance","_xSize","_workingXSize","_ySize","_workingYSize","_position","_spawned","_spawnedPositions","_positionReal","_spawnControl","_vehicleClassName","_vehicle","_hitpoints","_debugMarker"];
_mapcenter = getArray(configFile >> "CfgWorlds" >> worldName >> "safePositionAnchor");
_mapCenterKindaButNotReally = (getArray(configFile >> "CfgWorlds" >> worldName >> "CenterPosition"));

_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;
_mapsizeX = 12200 - _gridSizeOffset;//(_mapcenter select 0) * 2;
_mapsizeY = 12200 - _gridSizeOffset;//(_mapcenter select 1) * 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, _gridSizeOffset, 5, 0 , 1 , 0 , _spawnedPositions] call BIS_fnc_findSafePos;
			if(_positionReal isEqualTo _mapCenterKindaButNotReally)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 = _vehicleClassNames select (floor (random (count _vehicleClassNames)));
			_vehicle = [_vehicleClassName, _positionReal, random 360, true] call ExileServer_object_vehicle_createNonPersistentVehicle;
			_hitpoints = _vehicleClassName call ExileClient_util_vehicle_getHitPoints;
			{
			    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

 

1 person likes this

Share this post


Link to post
Share on other sites
  • 0

Any Question dude have you a Loot Spawn Script for Esseker ? i dont find a script  can you help me ?

Share this post


Link to post
Share on other sites
  • 0

Hi :) Thanks for this man!

Little off for my Esseker, where map size is shown :

_mapsizeX = 12200 - _gridSizeOffset;//(_mapcenter select 0) * 2;
_mapsizeY = 12200 - _gridSizeOffset;//(_mapcenter select 1) * 2;

Ive adjusted it just a little bit like this :

_mapsizeX = 12000 - _gridSizeOffset;//(_mapcenter select 0) * 2;
_mapsizeY = 12000 - _gridSizeOffset;//(_mapcenter select 1) * 2;

It wasnt a big issue ,but i still had vehicles coming out of the right side and top of map :)

Share this post


Link to post
Share on other sites
  • 0
Where do I put this file ... ? code ? as active? help tks

Please keep in mind this is advanced work, if you don't know how to change stuff like that you should not make modifications at all...

If you would like to learn how to do it i would suggest you to take a look at the sp3 http://www.exilemod.com/topic/169-download-link-for-banana-sp3/?do=findComment&comment=961
and try to understand how its done there, after that you can start adding your own stuff or the code that is posted here with the same methods.

The key here is the custom code block in the config, where you can overwrite all the exile code.


 

Share this post


Link to post
Share on other sites
  • 0

im having the same problem with the update, this worked for the last update but doesn't seem to work for 9.4 

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.