HeraclesJones
Well-Known Member
Just getting into scripting, and as a beginner I had a quick question. I'm working on a customized Takistan map, and if you've ever played it, you know that everyone spawns at the same place (airfield). I want to change that up a bit.
The markers (which I'm pretty sure control the spawn points, please feel free to correct me if I'm wrong) look like this -
So it looks like there are a variety of spawn points. But in server_playerSetup.sqf, the random spawn code looks like this -
If I'm correct about how spawning works (maybe not), then it looks like the problem is "str(round(random 4));". I'm assuming that would generate a number (0-3 or 1-4?) that would not line up correctly with the spawn names (spawn1, spawn2, etc. and there are 5 spawns markers listed not 4).
Am I completely off on this one? Thanks in advance for your help.
The markers (which I'm pretty sure control the spawn points, please feel free to correct me if I'm wrong) look like this -
Code:
class Item0
{
position[]={6341.8906,225.14104,6649.7861};
name="center";
type="Empty";
};
class Item1
{
position[]={9278.8789,432.9335,2952.8794};
name="respawn_west";
type="Empty";
};
class Item2
{
position[]={11353.254,370.70004,5992.5576};
name="spawn0";
type="Empty";
};
class Item3
{
position[]={4698.8223,372.28113,1124.9641};
name="spawn1";
type="Empty";
};
class Item4
{
position[]={3733.5181,282.04947,5027.2549};
name="spawn2";
type="Empty";
};
class Item5
{
position[]={404.9055,227.38644,7861.5503};
name="spawn3";
type="Empty";
};
class Item6
{
position[]={7307.1943,145.58955,10182.385};
name="spawn4";
type="Empty";
};
So it looks like there are a variety of spawn points. But in server_playerSetup.sqf, the random spawn code looks like this -
Code:
_mkr = "spawn" + str(round(random 4));
_position = ([(getMarkerPos _mkr),0,1500,10,0,2000,1] call BIS_fnc_findSafePos);
_isNear = count (_position nearEntities ["Man",100]) == 0;
_isZero = ((_position select 0) == 0) and ((_position select 1) == 0);
If I'm correct about how spawning works (maybe not), then it looks like the problem is "str(round(random 4));". I'm assuming that would generate a number (0-3 or 1-4?) that would not line up correctly with the spawn names (spawn1, spawn2, etc. and there are 5 spawns markers listed not 4).
Am I completely off on this one? Thanks in advance for your help.