HarryPearce
New Member
Hello,
I've been meaning to code in a custom, selective spawn system. It would work along the lines of opening the map on new character spawn, with temporary markers depicting the possible spawn locations. A player would then click on one of the available markers, setting the position of his character accordingly. I haven't managed to find anything using the search function, but it is possible I missed a thread on this matter.
I have the logic coded in, but I am having problems with recognizing the newly spawned character. I've tried setting a custom variable in the server_playerSetup.sqf in dayz_server.pbo/compile as such:
And referring to this variable in a custom script file, executed from init.sqf of the mpmission file, as such:
However, this only works when the character is new AND the server is freshly restarted. Any other time the variable comes in as <null>.
I have limited understanding of the dayz character creation mechanism, and I am at a loss, trying to understand why the variable is valid only some of the time, as other variables are set in the same scope to the _playerObj object, including medical data, which are working as intended.
I am certain I am missing a crucial logical step somewhere in the dayz player/character creation processing. Can anyone shed some light on this subject? Thanks.
I've been meaning to code in a custom, selective spawn system. It would work along the lines of opening the map on new character spawn, with temporary markers depicting the possible spawn locations. A player would then click on one of the available markers, setting the position of his character accordingly. I haven't managed to find anything using the search function, but it is possible I missed a thread on this matter.
I have the logic coded in, but I am having problems with recognizing the newly spawned character. I've tried setting a custom variable in the server_playerSetup.sqf in dayz_server.pbo/compile as such:
Code:
if (_randomSpot) then {
private["_counter","_position","_isNear","_isZero","_mkr","_code","_omsc"];
if (!isDedicated) then {
endLoadingScreen;
};
_playerObj setVariable["RandomSpawn",true,true]; //my custom variable
...
And referring to this variable in a custom script file, executed from init.sqf of the mpmission file, as such:
Code:
waitUntil {!isNil ("dayzLoginRecord")};
_randomSpawn = player getVariable "RandomSpawn";
titleText[format["RS:%1",_randomSpawn],"PLAIN"];
if ((!isNil ("_randomSpawn")) and (_randomSpawn)) then {
...
However, this only works when the character is new AND the server is freshly restarted. Any other time the variable comes in as <null>.
I have limited understanding of the dayz character creation mechanism, and I am at a loss, trying to understand why the variable is valid only some of the time, as other variables are set in the same scope to the _playerObj object, including medical data, which are working as intended.
I am certain I am missing a crucial logical step somewhere in the dayz player/character creation processing. Can anyone shed some light on this subject? Thanks.