Jump to content

Server does not check a spawn location is vacant before allowing spawning.


Recommended Posts

This has been a issue for years, but I've never seen it reported.

Happens predominantly on busier servers, If someone has returned from a sortie, taxied to the ramp and is shutting down / rearming / whatever and another player selects a slot that the first player is physically occupying the aircraft are destroyed.

This presents an additional issue of there now being debris in that location rendering it useless until the debris de-spawns or the server resets.

Spawning in the debris causes the same issue.


Suggestions on how to deal with it range from trivial to significant work.

Easy way, have the server check that the location is suitable to spawn in before inserting the joining player.
Could do this by sampling weather or not another aircraft is present within xyz co-ordinates of the spawn center.
Then delay spawning for new player with a client message saying the current location is occupied.
Crude but effective enough to stop telefraging.

Most complicated - have a system of aircraft inventory and some logic in the game itself to determine where 'client' aircraft spawn.


Something should be done... can happen not at all or a few times in a session.

Either way it's unpleasant and DCS should be better than to fall victim to such a simple issue.

Can this get a look at please?

  • Like 2

R7 3800X - 32Gig RAM -- All SSD -- GTX1070 -- TM Warthog, MFG Crosswinds & TiR

Link to comment
Share on other sites

@v81, I think it may be possible to check objects at spawn spot inside a function, called when a player select a slot, and refuse or valid the spawn.

I have no MP scripting exp., nor any way to test, so this has 99% chances to be an error, but a script example I can think off :

function DetectObjectsAtSpawn(point)
foundUnits = {}
local volS = {
	id = world.VolumeType.SPHERE,
	params = {
	point = point,
	radius = 1
local ifFound = function(foundItem, val)
	foundUnits[#foundUnits + 1] = foundItem:getName()
	return true
world.searchObjects({Object.Category.UNIT, Object.Category.STATIC, Object.Category.Cargo}, volS, ifFound)

local SpawnObjectFree = {}

function SpawnObjectFree.onPlayerTryChangeSlot(playerId, side, slotId)
local slotId = tostring(slotId)--convert multicrew slotId to unitId format ?
if string.match(slotId, "_") then
if string.len(slotId) == 3 then
slotId = string.sub(slotId,1)
elseif string.len(slotId) == 4 then
slotId = string.sub(slotId,2)
elseif string.len(slotId) == 5 then
slotId = string.sub(slotId,3)
local slotId = tonumber(slotId)--end of slotId conversion
for i = 1, 2 do--red and blue
for j = 0, 1 do--planes and helos
  local allGroups = coalition.getGroups(i, j)
  if #allGroups > 0 then
  for k = 1, #allGroups do
  local gpUnits = allGroups[k]:getUnits()
  if #gpUnits > 0 then
  for l = 1, #gpUnits do
    if gpUnits[l]:getID() == slotId then
	   if #foundUnits == 0 then return true
	   else return false



Link to comment
Share on other sites

@toutenglisseAppreciate your input.

I was thinking more like ED could implement it in the game code itself.

My level of programing is 0.1 out of 10... i can sometimes take a working script or program and tweak or adjust it to do something slightly different... but that's about it.

R7 3800X - 32Gig RAM -- All SSD -- GTX1070 -- TM Warthog, MFG Crosswinds & TiR

Link to comment
Share on other sites

  • Recently Browsing   0 members

    • No registered users viewing this page.
  • Create New...