Vehicles repeatedly spawning ontop of each other in towns

Vehicles repeatedly spawning ontop of each other in towns

« posted: Aug 27, 2018, 08:02 AM »
I'm getting a weird issue where in some towns, not all of them, probably 50/50, it just constantly spawns random vehicles into the same spot (and thus exploding, and slowing my test server down to a crawl"). They seem to be spawning exactly in the center of the town markers. It also just started doing this out of the blue. All I had done between the previous test and this starting was add some stores, towns, and territories, all of which work perfectly. I did organize everything into different layers for the different towns in Eden, that's the only thing I can think of that might break things. It follows the town markers if moved, and disappears if they're deleted, and only the town markers. I'm currently running ACE, CUP, and ALiVE, but no ALiVE modules actually placed atm, and all were working fine before (and still have the issue with them removed),  ALiVE may have messed something up, as i placed some AI modules before this started, but removed them right after as the first test, and the problem persisted. But since I've confirmed it to be tied directly to the the town markers I doubt any of those mods are a contributing factor anyway, since none of them should be having any interaction with the town_markers specifically, and everything was working properly prior to this. But, I've been wrong before.

The issue also disappears if I swap an older version of my .sqm into the mission folder with no other changes to the .sqf's (most of the towns are the same, one specifically that I know is doing this), so it must be something to do with the actual mission file, I just can't for the life of me figure out what it is.

rpt is a mess, still need to work out some kinks with ACE3. Was finishing the map, then ironing out bugs when this issue popped up. Any assistance in this would be greatly appreciated.

Re: Vehicles repeatedly spawning ontop of each other in towns

« Reply #1 posted: Aug 28, 2018, 08:12 AM »
I would suggest reverting back to that earlier version of the mission.sqm and slowly re-introduce your changes until the bug re-occurs, if it re-occurs at all.

Re: Vehicles repeatedly spawning ontop of each other in towns

« Reply #2 posted: Aug 28, 2018, 10:11 PM »
I thought about it, but I've already spent a lot of time working on that map, and just can't do it again. I just switched to Altis, and just about done. Made all the same changes, though not quite as detailed as my Malden map (in terms of prop placement). Haven't had any trouble. Really dont know what was happening there. I even deleted everything from the map, saved it, checked the code in the .sqm to see if there was anything weird left over, but it was just the standard header. Put down a town marker, so it was literally the only thing on the map, and it did it again.

I'm pretty much set on switching to Altis now though, just need to do some finishing touches with the store items, and fix any broken stores/territories. Maybe I'll copy/paste everything from the Malden map to Altis or Stratis, just out of curiosity to see if it still does it.

Re: Vehicles repeatedly spawning ontop of each other in towns

« Reply #3 posted: Aug 30, 2018, 04:50 AM »
I think I figured it out. The version I used as a base has the following piece of code at the bottom of the towns.sqf, that I assumed was part of vanilla wasteland, but I see it's not there in the stock one. He was using ellipse markers for towns, and has this code put in to make the size of the map markers match the size of the ellipse markers used, which I think then overrides the radius for each town in the array, which was just set to -1 (which I then followed in my changes). Most of my towns are rectangle markers however, so the size was unaffected and just remained at -1. Strange that one of the towns it was happening in was an ellipse though... I changed all the town sizes to 300 to test and it seems to have fixed the problem.

Code: [Select]
//copyToClipboard str ((allMapMarkers select {_x select [0,5] == "Town_"}) apply {[_x, -1, markerText _x]})

private "_size";
 
{
_x params ["_marker"];

if (markerShape _marker == "ELLIPSE") then
{
_size = markerSize _marker;
_x set [1, (_size select 0) min (_size select 1)];
};
} forEach _towns;

_towns

I would like to keep the concept he was going with, how would I modify this to apply the 2nd variable for a a rectangle size? Would it just simply be changing the above to;
Code: [Select]
private "_size";
 
{
_x params ["_marker"];

if (markerShape _marker == "ELLIPSE") then
{
_size = markerSize _marker;
_x set [1, (_size select 0) min (_size select 1)];
};

if (markerShape _marker == "RECTANGLE") then
{
_size = markerSize _marker;
_x set [1, (_size select 0) min (_size select 1)];
};
} forEach _towns;

_towns

And then adding this to createTownMarkers;
Code: [Select]
if (markerShape _marker != "RECTANGLE") then
{
_marker setMarkerShape "RECTANGLE";
_marker setMarkerSize [_x select 1, _x select 0];
};


If I can't get that to work, then worst case I'll just set the alpha to 0 so the circles don't show on the map (my towns/territories are the same, so the areas will still show up), and use the 'proper' method with icons and a set radius.

EDIT: I got it working. No more constant spawning of vehicles into the same spot, and the rectangle town markers on the map show correctly. I do have 4 ellipse town markers placed, that show up as rectangle on the map as well (while the capture territory is a circle). Sizes are correct though. Here's the working code, I thought maybe I needed to use "else" instead of "if" for the rectangle part in towns.sqf above, but that just breaks everything.

Code: [Select]
private ["_pos", "_marker"];

{
_x params ["_marker", "_size"];
_pos = markerPos _marker;

if (markerType _marker == "Empty") then
{
_marker = createMarker [format ["TownCircle%1", _forEachIndex + 1], _pos];
};

if (markerShape _marker != "ELLIPSE") then
{
_marker setMarkerShape "ELLIPSE";
_marker setMarkerSize [_x select 1, _x select 0];
};

if (markerShape _marker != "RECTANGLE") then
{
_marker setMarkerShape "RECTANGLE";
_marker setMarkerSize [_x select 1, _x select 0];
};

_marker setMarkerColor "ColorBlue";
_marker setMarkerBrush "SolidBorder";
_marker setMarkerAlpha .5;
} forEach (call cityList);