Modifying Survivor Spawn Locations

Discussion in 'Map Porting' started by shinkicker, Oct 22, 2012.

  1. shinkicker

    shinkicker Administrator Staff Member

    Joined:
    Oct 18, 2012
    Messages:
    741
    Likes Received:
    198
    1. Open up the Arma editor from the single player menu (disable the DayZ mod (remove -mod=@DayZ) if single player is greyed out and can't be selected)).

    2. Select your Map (we will use Chernarus for this example)

    3. Now highlight Markers to the right select menu.

    4. Using the map marker, find a spawn position close to the centre of the map and double left click on the mouse. Type under name 'centre', leave everything else as it is, and select OK.

    [​IMG]

    4. Repeat the same to the left side of the map and name type as 'respawn_west'

    5. Repeat again to your selected locations and name them spawn0, spawn1, spawn2, spawn3, spawn4

    6. Now select 'Save' and name it 'spawnpoints', save as 'user mission.

    7. Go to C:\Users\<your_name>\Documents\ArmA 2\missions\spawnpoints.Chernarus

    8. Open up the mission.sqm file and copy the following code:

    Code:
    class Markers
            {
                    items=7;
                    class Item0
                    {
                            position[]={7839.6055,381.33774,8414.7324};
                            name="center";
                            type="Empty";
                    };
                    class Item1
                    {
                            position[]={-18697.58,379.53012,25815.256};
                            name="respawn_west";
                            type="Empty";
                    };
                    class Item2
                    {
                            position[]={4932.3345,0.39950246,1989.1094};
                            name="spawn0";
                            type="Empty";
                    };
                    class Item3
                    {
                            position[]={2236.0391,0.63119155,1923.3735};
                            name="spawn1";
                            type="Empty";
                    };
                    class Item4
                    {
                            position[]={8738.1328,0.45720705,2122.1082};
                            name="spawn2";
                            type="Empty";
                    };
                    class Item5
                    {
                            position[]={10909.267,0.57597214,2422.3096};
                            name="spawn3";
                            type="Empty";
                    };
                    class Item6
                    {
                            position[]={13510.764,0.44504455,5249.3027};
                            name="spawn4";
                            type="Empty";
                    };
            };
    };
    Now open up the mission.sqm file for DayZ - location depends on server type you have. Mine is MPMissions\dayz_1.Chernarus

    Find the same section of code as above and replace each position coordinate, i.e. take the centerwest position[] number from your own created mission.sqm you made in the editor and paste it into the position[] in the dayz mission file.

    Also if you followed the sequence as above, it should be identical (apart from having both different and new positions), so you may be able to just copy and paste the whole class.

    Just make sure the code syntax is copied over correctly. Back up your DayZ mission.sqm first, so you can rollback if you screw it up.
     
  2. beowolfschaefer

    beowolfschaefer Administrator Staff Member

    Joined:
    Oct 19, 2012
    Messages:
    209
    Likes Received:
    23
    Could this method be used to create vehicle spawn points as well?
     
  3. shinkicker

    shinkicker Administrator Staff Member

    Joined:
    Oct 18, 2012
    Messages:
    741
    Likes Received:
    198
    It could, but I have a much better method. I will try and post it up soon.
     
    xerxes likes this.
  4. beowolfschaefer

    beowolfschaefer Administrator Staff Member

    Joined:
    Oct 19, 2012
    Messages:
    209
    Likes Received:
    23
    That would be great. If you could write something up on how to do a map conversion for dayz that would be great too. I have been plying around and figured out some of it but never quite got one working. I'd love to find out how to do it then maybe start making a map of my own from scratch.
     
  5. shinkicker

    shinkicker Administrator Staff Member

    Joined:
    Oct 18, 2012
    Messages:
    741
    Likes Received:
    198
    Sure, will do.

    I need to clean up a lot of loose ends from Celle first, but after that hopefully I can chill and put up some material.
     
  6. Z0MBiE

    Z0MBiE New Member

    Joined:
    Nov 2, 2012
    Messages:
    2
    Likes Received:
    0
    That'd be awesome. But any chance of just a quick list of things I could look up myself for now?

    I'm making a map for arma2 and can't find anything about what I need to do to convert it for use with DayZ.
     
  7. shinkicker

    shinkicker Administrator Staff Member

    Joined:
    Oct 18, 2012
    Messages:
    741
    Likes Received:
    198
    Theres a few things you need to do, but the main points that should get you up and running.

    Create a mod folder with your map @zombiesmap

    Inside that folder should be your map zombiesmap.pbo

    Create a mod folder for the dayz files @DayZ (as you would for a normal install of DayZ)

    Next you want to download a server install and set it up inside a COPY of your arma 2 OA folder (there are plenty of tutorials around to show that) - call the folder something like MyServer (anything will do).

    Inside MyServer\MPMissions create a new mission folder called

    dayz_1.zombiesmap

    so...

    MyServer\MPMissions\dayz_1.zombiesmap

    Copy over the mission.sqm, init.sqf and description.sqf from dayz_1.Chernarus to dayz_1.zombiesmap

    Edit the copied over mission.sqm file and add your addon to the existing addons:


    addOns[]=
    {
    "zombiesmap",
    "ca_modules_animals",
    "dayz_code",
    "dayz_weapons",
    "dayz_equip",
    "dayz_vehicles",


    Next open the server.cfg file and change as follows:

    class Missions { class DayZ { template = dayz_1.zombiesmap; difficulty = "Veteran"; }; };

    In your server startup file change the world and mod folders:

    start .\Expansion\beta\arma2oaserver.exe -mod=@DayZ;@zombiesmap;@hive -name=cfgdayz -config=cfgdayz\server.cfg -cfg=cfgdayz\arma2.cfg -profiles=cfgdayz -world=zombiesmap -exThreads=0 -maxMem=1024

    Note the above is an example, it depends on the server (that example is using pwnoz0rs build).

    After that you want to make sure you have @zombiesmap and @dayz in both the root of your server and the Arma 2 OA installation folder.

    Set your launch options for starting the arma 2 game:

    -mod=@zombiesmap;@DayZ

    That should be enough to get you up and running with your map and the DayZ mission running. If you use the same buildings as Chernarus then you will get loot and zombies spawn, if not, and you are using new buildings it gets a little more complicated, but I will go into that soon.
     
  8. Z0MBiE

    Z0MBiE New Member

    Joined:
    Nov 2, 2012
    Messages:
    2
    Likes Received:
    0
    That's excellent thanks a lot for taking the time to do that.
     
  9. shinkicker

    shinkicker Administrator Staff Member

    Joined:
    Oct 18, 2012
    Messages:
    741
    Likes Received:
    198
    No worries, I have a load to do this weekend, but after that I will right up some more.
     
  10. Pwnoz0r

    Pwnoz0r Administrator Staff Member

    Joined:
    Oct 18, 2012
    Messages:
    255
    Likes Received:
    110
    Going to make a video tutorial series on this.
     
  11. Geekz

    Geekz New Member

    Joined:
    Oct 20, 2012
    Messages:
    4
    Likes Received:
    0
    Thanks for the info Shinkicker. However, I am having an issue getting this [spawn locations] to work. After doing what is stated in your first post. I rebuilt my pbo. and booted up my server. The spawnpoints still appear to be as they were before - as in I'm not spawning at my new locations.

    I have checked my MPmission pbo and it shows the spawns I created, but they don't seem to have any effect.

    Any extra help would be greatly appreciated.
     
  12. shinkicker

    shinkicker Administrator Staff Member

    Joined:
    Oct 18, 2012
    Messages:
    741
    Likes Received:
    198
    Really mate, I am worried maybe I got it wrong now, but I am sure this worked for me (its awhile since I played with it). I am little snowed under with things to do, do you think you could test something........

    Follow the same procedure as the post with the screenshots, but put your markets right up north near the edge of the map and re'PBO them back up. Now restart the server, kill y'self and then see if you respawn in the north.

    What you could also do is upload your PBO to mediafire or a similar service and I can take a look at it later ron.

    EDIT: One other things come to mind, if you mission is PBO'ed that suggests its the Bliss build? I wonder if ayan has changned the spawn function and put it somewhere else? Hmmmm...I will see if I can check that out if thats the case.
     
  13. Geekz

    Geekz New Member

    Joined:
    Oct 20, 2012
    Messages:
    4
    Likes Received:
    0
    Thanks for your reply. Sorry I forget to mention (half asleep when I wrote the post) it is the Bliss build I'm using.

    The first trial was on Utes map, and it seemed to have no effect. After your post, I have retried using Chernarus map, I placed the markers up north as you suggested. This time I always spawn inside that house in Novy. - The one that very rarely happens with the regular spawns. - No matter how many times I kill myself or where I move my spawns to, this is the only spawn that seems to be active.

    Here is the link to the rePBO'd file: http://www.mediafire.com/download.php?0i3z8062v4f24ef

    Thanks for taking your time to have a look at this, it's very much appreciated
     
  14. godheim

    godheim Member

    Joined:
    Oct 29, 2012
    Messages:
    40
    Likes Received:
    3
    @shinkicker, what if the map is using different objects, lets say from panthera, what's the procedure then?
     
  15. Dean

    Dean Member

    Joined:
    Nov 5, 2012
    Messages:
    56
    Likes Received:
    6
    This is the exact same thing that happens on my server when I try to adjust the player spawn points.
     
  16. Rockylee

    Rockylee New Member

    Joined:
    Jan 22, 2013
    Messages:
    4
    Likes Received:
    0
    managed to get spawn of players .....
    the fact that each marker reprecenta a class.

    spawning west =
    players

    spawning center
    HeliCash's

    spawning 0, 1, 2, 3, 4
    games are probably
    Items spawning, or spawning zombie ..

    |
    |
    \/
    |
    |
    \/

    codes ready ..
    spawning for electro
     
  17. Rockylee

    Rockylee New Member

    Joined:
    Jan 22, 2013
    Messages:
    4
    Likes Received:
    0
    Code:
        items=7;
            class Item0
            {
                position[]={10440.316,6,2234.4336};
                name="center";
                type="Empty";
            };
            class Item1
            {
                position[]={10540.356,6,2234.4236};
                name="respawn_west";
                type="Empty";
            };
            class Item2
            {
                position[]={10386.87,6.154192,2269.3311};
                name="spawn0";
                type="Empty";
            };
            class Item3
            {
                position[]={10505.49,6,2184.4487};
                name="spawn1";
                type="Empty";
            };
            class Item4
            {
                position[]={10389.216,6,2136.4214};
                name="spawn2";
                type="Empty";
            };
            class Item5
            {
                position[]={10421.217,6,2204.8638};
                name="spawn3";
                type="Empty";
            };
            class Item6
            {
                position[]={10480.699,6,2269.7336};
                name="spawn4";
                type="Empty";
            };
     
  18. Rockylee

    Rockylee New Member

    Joined:
    Jan 22, 2013
    Messages:
    4
    Likes Received:
    0
    dayz_server.pbo => compile => server_playerSetup.sqf



    Code:
    private ["_characterID", "_doLoop", "_playerID", "_playerObj", "_randomSpot", "_primary", "_key", "_worldspace", "_score", "_position", "_pos", "_isIsland", "_medical", "_stats", "_state", "_dummy", "_debug", "_distance", "_hit", "_fractures", "_w", "_findSpot", "_humanity", "_clientID", "_distanceValue", "_coastSpawn"];
     
    #include "\@dayzcc\addons\dayz_server_config.hpp"
     
    // Set Variables
    _characterID    = _this select 0;
    _playerObj        = _this select 1;
    _playerID        = getPlayerUID _playerObj;
     
    diag_log ("PLAYER: SETUP ATTEMPT: " + str(_this));
     
    if (isNull _playerObj) exitWith {
        diag_log ("PLAYER: SETUP INIT FAILED: Exiting, player object null: " + str(_playerObj));
    };
     
    if (_playerID == "") then {
        _playerID = getPlayerUID _playerObj;
    };
     
    if (_playerID == "") exitWith {
        diag_log ("PLAYER: SETUP INIT FAILED: Exiting, no player ID: " + str(_playerObj));
    };
     
    private ["_dummy"];
    _dummy = getPlayerUID _playerObj;
    if ( _playerID != _dummy ) then {
        diag_log format ["DEBUG: Player ID miscompare with UID! ID: %1", _playerID];
        _playerID = _dummy;
    };
     
    // Variables
    _worldspace    = [];
    _state            = [];
     
    _key = format ["CHILD:102:%1:", _characterID];
    _primary = [_key, false, dayZ_hivePipeAuth] call server_hiveReadWrite;
     
    if (isNull _playerObj or !isPlayer _playerObj) exitWith {
        diag_log ("PLAYER: SETUP RESULT: Exiting, player object null: " + str(_playerObj));
    };
     
    if (KillMsgs) then {
        diag_log ("PLAYER: Adding MPHit Event for " + str(_playerObj));
        _playerObj addMPEventHandler ["MPHit", {_this spawn fnc_Hit;}];
    };
     
    diag_log ("PLAYER: SETUP RESULT: Successful with " + str(_primary));
     
    _medical        = _primary select 1;
    _stats            = _primary select 2;
    _state            = _primary select 3;
    _worldspace    = _primary select 4;
    _humanity        = _primary select 5;
    _randomSpot    = false;
     
    // Get correct world values
    _distanceValue    = 500;
    _isIsland        = false;
    _coastSpawn    = 0;
     
    if (worldName in ["lingor", "fallujah", "panthera2", "takistan", "zargabad"]) then {
        _distanceValue    = 500;
        _isIsland        = true;
        _coastSpawn    = 1;
    };
     
    if (count _worldspace > 0) then {
        _position        = _worldspace select 1;
        _debug            = getMarkerpos "respawn_west";
        _distance        = _debug distance _position;
       
        if (count _position < 3) then { _randomSpot = true; };
        if (_distance < _distanceValue) then { _randomSpot = true; };
    } else {
        _randomSpot = true;
    };
     
    diag_log ("PLAYER: LOGIN RESULT: Location: " + str(_worldspace) + ", Random Spawn: " + str(_randomSpot));
     
    // Set medical values
    if (count _medical > 0) then {
        _playerObj setVariable ["USEC_isDead", (_medical select 0), true];
        _playerObj setVariable ["NORRN_unconscious", (_medical select 1), true];
        _playerObj setVariable ["USEC_infected", (_medical select 2), true];
        _playerObj setVariable ["USEC_injured", (_medical select 3), true];
        _playerObj setVariable ["USEC_inPain", (_medical select 4), true];
        _playerObj setVariable ["USEC_isCardiac", (_medical select 5), true];
        _playerObj setVariable ["USEC_lowBlood", (_medical select 6), true];
        _playerObj setVariable ["USEC_BloodQty", (_medical select 7), true];
        _playerObj setVariable ["unconsciousTime", (_medical select 10), true];
       
        // Add Wounds
        {
            _playerObj setVariable[_x, true, true];
            [_playerObj, _x, _hit] spawn fnc_usec_damageBleed;
            usecBleed = [_playerObj, _x, 0];
            publicVariable "usecBleed";
        } forEach (_medical select 8);
       
        // Add fractures
        _fractures = (_medical select 9);
        _playerObj setVariable ["hit_legs", (_fractures select 0), true];
        _playerObj setVariable ["hit_hands", (_fractures select 1), true];
       
        // Additional medical stats
        if (count _medical > 11) then {
            _playerObj setVariable ["messing", (_medical select 11), true];
        };   
    } else {
        // Reset Fractures
        _playerObj setVariable ["hit_legs", 0, true];
        _playerObj setVariable ["hit_hands", 0, true];
        _playerObj setVariable ["USEC_injured", false, true];
        _playerObj setVariable ["USEC_inPain", false, true];
        _playerObj setVariable ["messing", [0,0], true];
    };
       
    if (count _stats > 0) then {   
        // Register stats
        _playerObj setVariable ["zombieKills", (_stats select 0), true];
        _playerObj setVariable ["headShots", (_stats select 1), true];
        _playerObj setVariable ["humanKills", (_stats select 2), true];
        _playerObj setVariable ["banditKills", (_stats select 3), true];
        _playerObj addScore (_stats select 1);
       
        // Save Score
        _score = score _playerObj;
        _playerObj addScore ((_stats select 0) - _score);
       
        // Record for Server JIP checks
        _playerObj setVariable ["zombieKills_CHK", (_stats select 0)];
        _playerObj setVariable ["headShots_CHK", (_stats select 1)];
        _playerObj setVariable ["humanKills_CHK", (_stats select 2)];
        _playerObj setVariable ["banditKills_CHK", (_stats select 3)];
     
        // Add sex selection
        if (count _stats > 4) then {
            if (!(_stats select 3)) then { _playerObj setVariable["selectSex", true, true]; };
        } else {
            _playerObj setVariable ["selectSex", true, true];
        };
    } else {
        // Register stats
        _playerObj setVariable ["zombieKills", 0, true];
        _playerObj setVariable ["humanKills", 0, true];
        _playerObj setVariable ["banditKills", 0, true];
        _playerObj setVariable ["headShots", 0, true];
       
        // Record for Server JIP checks
        _playerObj setVariable ["zombieKills_CHK", 0];
        _playerObj setVariable ["humanKills_CHK", 0, true];
        _playerObj setVariable ["banditKills_CHK", 0, true];
        _playerObj setVariable ["headShots_CHK", 0];
    };
     
    if (_randomSpot) then {
        private ["_counter", "_position", "_isNear", "_isZero", "_mkr"];
       
        if (!isDedicated) then { endLoadingScreen; };
       
        // Spawn into random
        _findSpot = true;
        _mkr = "";
       
        while {_findSpot} do {
            _counter = 0;
           
            while {_counter < 20 and _findSpot} do {
                _mkr        = "spawn" + str(round(random 4)); // Read random spawn marker from mission
                _position    = ([(getMarkerPos _mkr), 0, 400, 10, 0, 300, _coastSpawn] call BIS_fnc_findSafePos); // Get position from spawn marker
                _isNear    = count (_position nearEntities ["Man", 50]) == 0; // Another player near?
                _isZero    = ((_position select 0) == 0) and ((_position select 1) == 0);
     
                if (!_isIsland) then {
                    _pos = _position;
                    for [{_w = 0}, {_w <= 150}, {_w = _w + 2}] do {
                        _pos = [(_pos select 0), ((_pos select 1) + _w), (_pos select 2)];
                        if (surfaceisWater _pos) exitWith { _isIsland = true; };
                    };
                };
     
                if (_isNear and !_isZero) then { _findSpot = false };
               
                _counter = _counter + 1;
            };
        };
       
        _isZero    = ((_position select 0) == 0) and ((_position select 1) == 0);
        _position    = [_position select 0, _position select 1, 0];
       
        if (!_isZero) then {
            _worldspace = [0, _position];
            diag_log ("PLAYER: SETUP RESULT: Marker: " + _mkr + ", Position: " + str(_position));
        } else {
            diag_log ("PLAYER: SETUP ERROR: Position is zero");
        };
    };
     
    // Record player for management
    dayz_players set [count dayz_players, _playerObj];
     
    // Record player position locally for server checking
    _playerObj setVariable ["characterID", _characterID, true];
    _playerObj setVariable ["humanity", _humanity, true];
    _playerObj setVariable ["humanity_CHK", _humanity];
    _playerObj setVariable ["lastPos", getPosATL _playerObj];
     
    dayzPlayerLogin2 = [_worldspace, _state];
    _clientID = owner _playerObj;
    _clientID publicVariableClient "dayzPlayerLogin2";
     
    // Record time started
    _playerObj setVariable ["lastTime", time];
     
    diag_log ("PLAYER: LOGIN PUBLISHING: " + str(_playerObj) + ", Type: " + (typeOf _playerObj));
     
    // Clean up
    dayzLogin    = null;
    dayzLogin2    = null;
     
  19. TorturedChunk

    TorturedChunk Valued Member!

    Joined:
    Jan 2, 2013
    Messages:
    290
    Likes Received:
    50
    I am trying to add a few extra spawns as well. I get the same problem as above where a new player may get the spawn but a dead player re spawning gets stuck in the house in novy sobor.

    I have added the new locations via the mission file and edited the random selection in dayz_server.pbo => compile => server_playerSetup.sqf to no avail.

    Any help is much appreciated.
     
  20. endlesszboyz

    endlesszboyz Member

    Joined:
    Mar 23, 2013
    Messages:
    52
    Likes Received:
    1
    Same problem #19
     

Share This Page