Spawning Question

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 -

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.
 
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 -

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.

The "Class Markers" are not spawn points. But rather "Class Groups" I believe Shin Kicker has a tutorial for editing spawns to your liking somewhere out there, can't remember.
Code:
    class Groups
    {
        items=2;
        class Item0
        {
            side="WEST";
            class Vehicles
            {
                items=100;
                class Item0
                {
                    position[]={-18709.713,379.10086,25923.943};
                    azimut=-17.0839;
                    id=11;
                    side="WEST";
                    vehicle="Survivor1_DZ";
                    player="PLAY CDG";
                    skill=0.60000002;
                    init="this enableSimulation false;this allowDammage false;this disableAI 'FSM';this disableAI 'ANIM';this disableAI 'MOVE';";
                };
                class Item1
                {
                    position[]={-18621.865,368.67456,25857.564};
                    azimut=-17.0839;
                    id=0;
                    side="WEST";
                    vehicle="Survivor1_DZ";
                    player="PLAYER COMMANDER";
                    leader=1;
                    rank="SERGEANT";
                    skill=0.60000002;
                    init="this enableSimulation false;this allowDammage false;this disableAI 'FSM';this disableAI 'ANIM';this disableAI 'MOVE';";
                };
                class Item2
                {
                    position[]={-18688.303,376.65714,25929.211};
                    azimut=-17.083944;
                    id=5;
                    side="WEST";
                    vehicle="Survivor1_DZ";
                    player="PLAY CDG";
                    skill=0.60000002;
                    init="this enableSimulation false;this allowDammage false;this disableAI 'FSM';this disableAI 'ANIM';this disableAI 'MOVE';";
                };
                class Item3
                {
                    position[]={-18682.584,376.26038,25925.459};
                    azimut=-17.083944;
                    id=8;
                    side="WEST";
                    vehicle="Survivor1_DZ";
                    player="PLAY CDG";
                    skill=0.60000002;
                    init="this enableSimulation false;this allowDammage false;this disableAI 'FSM';this disableAI 'ANIM';this disableAI 'MOVE';";
                };
                class Item4
                {
                    position[]={-18687.459,377.10449,25918.287};
                    azimut=-17.083944;
                    id=18;
                    side="WEST";
                    vehicle="Survivor1_DZ";
                    player="PLAY CDG";
                    skill=0.60000002;
                    init="this enableSimulation false;this allowDammage false;this disableAI 'FSM';this disableAI 'ANIM';this disableAI 'MOVE';";
                };
                class Item5
                {
                    position[]={-18676.068,374.91525,25883.367};
                    azimut=-17.083944;
                    id=2;
                    side="WEST";
                    vehicle="Survivor1_DZ";
                    player="PLAY CDG";
                    skill=0.60000002;
                    init="this enableSimulation false;this allowDammage false;this disableAI 'FSM';this disableAI 'ANIM';this disableAI 'MOVE';";
                };
 
Awesome, thanks. I'll go find that tutorial. One question though, I thought that those might be the spawn points, but why are the first coords in each a negative number? Or maybe his tutorial will answer that. :)
 
Awesome, thanks. I'll go find that tutorial. One question though, I thought that those might be the spawn points, but why are the first coords in each a negative number? Or maybe his tutorial will answer that. :)

I havn't got a friggin clue man xD Your guess is as good as mine. I'll lend a hand in the search for the tut.
 
Awesome, thanks. I'll go find that tutorial. One question though, I thought that those might be the spawn points, but why are the first coords in each a negative number? Or maybe his tutorial will answer that. :)

Well, guess I was wrong. It is the class markers! I was in the wrong, sorry for the misinformation!
 
Back
Top