Forum Jump :

Author Message


Posts: 4
Rank:


Level: Member

Country: us
Location:
Occupation:
Age:
In-game name:

 
#1 Posted at 2016-02-15 01:33        
     
Sorry, but this has eluded and bugged me ever since I downloaded 404's Wasteland Takistan ( and Chernarus ) vers 3.0.
I have searched Google, asked for help on Steam forums, tried 404's website/forums , and found nothing that helps.

The issue - When starting up in the server, alone or no faction beacons placed, you have a GUI pop up after starting the mission. The button up top , says "random" , and I know from playing on other servers , it is to spawn in a random "town" location, or close to one.

However, no matter what I do, clicking this button keeps players in the "debug" area , or "no mans land" of the map , 30 THOUSAND meters away from the edge of the actual playing area. ( takes about an hour and half to two hours to run to the playing area. )

The had part on this mission, is that there isn't just "one" script to handle spawns ... so I will try to copy/paste all I have and label it so others smarter than me, can help. I am not a scripter, and am very confused at what I am looking at, as it is not simple like examples placed in Armaholic have been.

Script - spawnRandom
Location : 404games\wasteland_takistan\client\functions
//	@file Version: 1.0
//	@file Name: spawnRandom.sqf
//	@file Author: [404] Deadbeat, [404] Costlyy
//	@file Created: 28/11/2012 05:19
//	@file Args:

waituntil {!isnil "bis_fnc_init"};

private ["_townName","_randomLoc","_pos"];

_randomLoc = cityList select (random (count cityList - 1));

_pos = getMarkerPos (_randomLoc select 0);
_pos = [_pos,1,(_randomLoc select 1),1,0,0,0] call BIS_fnc_findSafePos;
_pos = [_pos select 0, _pos select 1, (_pos select 2) + 10];
player setPos _pos;

respawnDialogActive = false;
closeDialog 0;

_mins = floor(60 * (daytime - floor(daytime)));
_townName = _randomLoc select 2;
[
	"404 Wasteland",_townName,format ["%1:%3%2", floor(daytime), _mins, if(_mins < 10) then {"0"} else {""}]
] spawn BIS_fnc_infoText;

Script - spawnAction
Location - client\functions
//	@file Version: 1.0
//	@file Name: spawnAction.sqf
//	@file Author: [404] Deadbeat, [404] Costlyy
//	@file Created: 20/11/2012 05:19
//	@file Args: [int(type of spawn)]

_switch = _this select 0;
_button = _this select 1;

switch(_switch) do 
{
    case 0:{execVM "client\functions\spawnRandom.sqf"};
    case 1:{
	    if(showBeacons) then { 	
	    	[_button] execVM "client\functions\spawnOnBeacon.sqf"
	    } else {
	    	[_button] execVM "client\functions\spawnInTown.sqf"
	    }; 
    };
};

if(isNil{client_firstSpawn}) then {
	client_firstSpawn = true;
	[] execVM "client\functions\welcomeMessage.sqf";
    
    true spawn {      
        _startTime = floor(time);
        _result = 0;
		waitUntil
		{ 
		    _currTime = floor(time);
		    if(_currTime - _startTime >= 200) then 
		    {
		    	_result = 1;    
		    };
		    (_result == 1)
		};
        
        // Allow the player to drop money again now that 3 minutes have passed.
        player setVariable["canDrop",true,false];
        
		if(playerSide in [west, east]) then {
			_found = false;
			{
				if(_x select 0 == playerUID) then {_found = true;};
			} forEach pvar_teamSwitchList;
			if(!_found) then {
				pvar_teamSwitchList set [count pvar_teamSwitchList, [playerUID, playerSide]];
				publicVariable "pvar_teamSwitchList";
                
                _side = "";
                if(str(playerSide) == "WEST") then {
                    _side = "Blufor";
                };
                
                if(str(playerSide) == "EAST") then {
                    _side = "Opfor";
                };
                
				titleText [format["You have been locked to %1",_side],"PLAIN",0];
			};
		};
	};

} else {
	[] spawn {      
        _startTime = floor(time);
        _result = 0;
		waitUntil
		{ 
		    _currTime = floor(time);
		    if(_currTime - _startTime >= 200) then 
		    {
		    	_result = 1;    
		    };
		    (_result == 1)
		};
        
        // Allow the player to drop money again now that 3 minutes have passed.
        player setVariable["canDrop",true,false];
    };
};

Script - playerSpawn
Location - client\functions

//	@file Version: 1.0
//	@file Name: playerSpawn.sqf
//	@file Author: [404] Deadbeat
//	@file Created: 20/11/2012 05:19
//	@file Args:

private ["_side"];

playerSpawning = true;
playerUID = getPlayerUID(player);
townSearch = 0;
beaconSearch = 0;

doKickTeamKiller = false;
doKickTeamSwitcher = false;

//Check Teamkiller
{
	if(_x select 0 == playerUID) then {
        
		if((_x select 1) >= 2) then {
			if(playerSide in [west, east]) then {
				doKickTeamKiller = true;
			};
		};
	};
} forEach pvar_teamKillList;

//Check Teamswitcher
{
	if(_x select 0 == playerUID) then
    {
        if(playerSide != (_x select 1) && str(playerSide) != "GUER") then{
        	doKickTeamSwitcher = true;
			_side = str(_x select 1);
        };	
	};
} forEach pvar_teamSwitchList;

//Kick to lobby for appropriate reason
//Teamkiller Kick
if(doKickTeamKiller) exitWith {
	titleText ["", "BLACK IN", 0];
	titleText [localize "STR_WL_Loading_Teamkiller", "black"]; titleFadeOut 9999;
	[] spawn {sleep 20; endMission "LOSER";};
};

//Teamswitcher Kick
if(doKickTeamSwitcher) exitWith {
	titleText ["", "BLACK IN", 0];
	titleText [format[localize "STR_WL_Loading_Teamswitched", localize format ["STR_WL_Gen_Team%1_2", _side]], "black"]; titleFadeOut 9999;
	[] spawn {sleep 20; endMission "LOSER";};
};

//Send player to debug to stop fake spawn locations.
player setPos [-20000 - (random 10000), 5000 + random 15000, 0];


true spawn client_respawnDialog;

waitUntil {respawnDialogActive};

while {respawnDialogActive} do {
	titleText ["", "BLACK OUT", 0.00001];
};
sleep 0.1;
titleText ["", "BLACK IN", 0.00001];
player enableSimulation true; 
playerSpawning = false;

Script- loadRespawnDialog
Location : client\functions
//	@file Version: 1.0
//	@file Name: loadRespawnDialog.sqf
//	@file Author: [404] Deadbeat, [404] Costlyy
//	@file Created: 20/11/2012 05:19
//	@file Args:

#define respawn_Content_Text 3401
#define respawn_MissionUptime_Text 3402
#define respawn_Town_Button0 3403
#define respawn_Town_Button1 3404
#define respawn_Town_Button2 3405
#define respawn_Town_Button3 3406
#define respawn_Town_Button4 3407
#define respawn_PlayersInTown_Text0 3408
#define respawn_PlayersInTown_Text1 3409
#define respawn_PlayersInTown_Text2 3410
#define respawn_PlayersInTown_Text3 3411
#define respawn_PlayersInTown_Text4 3412

waitUntil{!isnil "bis_fnc_init"};
disableSerialization;

private["_player","_city","_radius","_name","_enemyCount","_friendlyCount","_side","_dynamicControlsArray", "_enemyPresent","_inGroup","_tempArray", "_text", "_players", "_playerArray"];

createDialog "RespawnSelectionDialog";
_display = uiNamespace getVariable "RespawnSelectionDialog";
_display displayAddEventHandler ["KeyDown", "_return = false; if(respawnDialogActive && (_this select 1) == 1) then {_return = true;}; _return"];
_respawnText = _display displayCtrl respawn_Content_Text;
_missionUptimeText = _display displayCtrl respawn_MissionUptime_Text;
_beaconBlockDistance = 300;

if(playerSide in [west]) then {_side = "Blufor"};
if(playerSide in [east]) then {_side = "Opfor"};
if(str(playerSide) == "GUER") then {_side = "Independent"};
_respawnText ctrlSetStructuredText parseText (format["You are on %1.<br/>Please select a spawn point.",_side]);
respawnDialogActive = true;

_dynamicControlsArray = [
	[respawn_Town_Button0,respawn_PlayersInTown_Text0],
    [respawn_Town_Button1,respawn_PlayersInTown_Text1],
    [respawn_Town_Button2,respawn_PlayersInTown_Text2],
    [respawn_Town_Button3,respawn_PlayersInTown_Text3],
    [respawn_Town_Button4,respawn_PlayersInTown_Text4]];

{
    _button = _display displayCtrl (_x select 0);
    _button ctrlSetText format[""];
    _button ctrlShow false;
}foreach _dynamicControlsArray;

_friendlyTowns = [];
_tempArray = [];
showBeacons = false;
_inGroup = false;
while {respawnDialogActive} do
{
    _timeText = [time/60/60] call BIS_fnc_timeToString;
    _missionUptimeText ctrlSetText format["Mission Uptime: %1", _timeText];
       
    if(_side != "Independent") then
    {  
        if(!showBeacons) then {
            {
                _pos = getMarkerPos (_x select 0);
                _name = _x select 2;
                _rad = _x select 1;
                _playerArray = [];

                {
                    if((getPos _x distance _pos) < _rad) then
                    {
                        if(side _x == playerSide AND alive _x) then
                        {
                            _friendlyCount = _friendlyCount + 1;
                            _playerArray set [count _playerArray, name _x];      
                        }else{
                            _enemyCount = _enemyCount + 1;
                        };
                    }; 
                }forEach playableUnits;  

                if((_friendlyCount > 0) AND (_enemyCount == 0)) then
                {
                    _friendlyTowns set [count _friendlyTowns, [_name, _playerArray]];                    
                };
                _friendlyCount = 0;
                _enemyCount = 0; 
                
            }forEach cityList; 

            {
                _button = _display displayCtrl (_x select 0);
                _text = _display displayCtrl (_x select 1);
                
                if(_forEachIndex <= count _friendlyTowns -1) then
                {
                	// Set the button details
                    _button ctrlShow true;
                    _name = _friendlyTowns select _forEachIndex select 0;
                    _button ctrlSetText	format["%1",_name]; 
                    // Set the players in town text details
                    _text ctrlShow true;
                    _players = _friendlyTowns select _forEachIndex select 1;
                    _text ctrlSetText format["%1",_players]; 
                } else {
                    _name = "";
                    // reset button text and disable
                    _button ctrlSetText _name;
                    _button ctrlShow false; 
                    // reset players text and disable
                    _text ctrlSetText _name;
                    _text ctrlShow false; 
                };          
            }forEach _dynamicControlsArray;
            
            _friendlyTowns = [];    
            
        } else {
            _enemyCount = 0;
            {
                _button = _display displayCtrl (_x select 0);
                _text = _display displayCtrl (_x select 1);
                
                _button ctrlSetText format[""];
                _button ctrlShow false;   
                _text ctrlSetText format[""];
                _text ctrlShow false;  
                
            }foreach _dynamicControlsArray;
            
            {
                if(_side == "Blufor") then {
                    _button = _display displayCtrl (_dynamicControlsArray select _forEachIndex select 0);
                    _centrePos = (pvar_beaconListBlu select _forEachIndex) select 1;

                    {
                        _onTeam = str(side _x) in ["EAST","GUER"];   
                        if(_onTeam) then {
                            if((getPos _x distance _centrePos) < _beaconBlockDistance) then {
                                if(!(side _x == playerSide)) then {
                                    _enemyCount = _enemyCount + 1; 
                                };   
                            }; 
                        };  
                    }forEach playableUnits;

                    if(_enemyCount == 0) then {
                        _button ctrlShow true;   
                        _name = (pvar_beaconListBlu select _forEachIndex) select 0;
                        _button ctrlSetText	format["%1",_name]; 
                    } else {
                        _name = "";
                        _button ctrlSetText _name;
                        _button ctrlShow false; 
                    };
                }; 
                _enemyCount = 0;         
            }forEach pvar_beaconListBlu;

            {
                if(_side == "Opfor") then {
                    _button = _display displayCtrl (_dynamicControlsArray select _forEachIndex select 0);
                    _centrePos = (pvar_beaconListRed select _forEachIndex) select 1;

                    {
                        _onTeam = str(side _x) in ["WEST","GUER"];   
                        if(_onTeam) then {
                            if((getPos _x distance _centrePos) < _beaconBlockDistance) then {
                                if(!(side _x == playerSide)) then {
                                    _enemyCount = _enemyCount + 1; 
                                };   
                            }; 
                        };  
                    }forEach playableUnits;


                    if(_enemyCount == 0) then {
                        _button ctrlShow true;   
                        _name = (pvar_beaconListRed select _forEachIndex) select 0;
                        _button ctrlSetText	format["%1",_name]; 
                    } else {
                        _name = "";
                        _button ctrlSetText _name;
                        _button ctrlShow false; 
                    };   
                };
                _enemyCount = 0;                   
            }forEach pvar_beaconListRed;       
        };
    };
    
    if((count units group player > 1) AND (_side == "Independent")) then
    {
        _tempArray = [];
        {
        	_tempArray set [count _tempArray,getPlayerUID _x];    
        }forEach units player;
                    
        //Towns
    	if(!showBeacons) then 
        {
        	{
                _pos = getMarkerPos (_x select 0);
                _name = _x select 2;
                _rad = _x select 1;
                _friendlyCount = 0;
                _enemyCount = 0; 
                _playerArray = [];

                {
                    if((getPos _x distance _pos) < _rad) then
                    {
                        if(getPlayerUID _x in _tempArray) then
                        {
                            _friendlyCount = _friendlyCount + 1;
                            _playerArray set [count _playerArray, name _x]; 
                        }else{
                            _enemyCount = _enemyCount + 1;
                        };
                    };
                }forEach playableUnits;

                if((_friendlyCount > 0) AND (_enemyCount == 0)) then
                {
                    _friendlyTowns set [count _friendlyTowns, [_name, _playerArray]]; 
                };
            }forEach cityList; 

            {
                _button = _display displayCtrl (_x select 0);
                _text = _display displayCtrl (_x select 1);
                
                if(_forEachIndex <= count _friendlyTowns -1) then
                {
                    // Set the button details
                    _button ctrlShow true;
                    _name = _friendlyTowns select _forEachIndex select 0;
                    _button ctrlSetText	format["%1",_name]; 
                    // Set the players in town text details
                    _text ctrlShow true;
                    _players = _friendlyTowns select _forEachIndex select 1;
                    _text ctrlSetText format["%1",_players]; 
                } else {
                    _name = "";
                    // reset button text and disable
                    _button ctrlSetText _name;
                    _button ctrlShow false; 
                    // reset players text and disable
                    _text ctrlSetText _name;
                    _text ctrlShow false; 
                };          
            }forEach _dynamicControlsArray;
            _friendlyTowns = [];    
        } else { //Beacons
        
			{
		        _tempArray = [];
			    {
			    	_tempArray set [count _tempArray,getPlayerUID _x];    
			    }forEach units player;
		    
		    	_button = _display displayCtrl (_dynamicControlsArray select _forEachIndex select 0);
		        _centrePos = (pvar_beaconListIndep select _forEachIndex) select 1;
		        _ownerUID = (pvar_beaconListIndep select _forEachIndex) select 3;
				_enemyCount = 0;
		        
		        {
		        	_onTeam = str(side _x) in ["EAST","WEST"];   
		            if(_onTeam) then {
		            	if((getPos _x distance _centrePos) < _beaconBlockDistance) then {
		                	if(getPlayerUID _x in _tempArray) then {
		                    	 
		                    } else {
		                    	_enemyCount = _enemyCount + 1;    
		                    };   
		                }; 
		            };  
		        }forEach playableUnits;
		
		        if((_enemyCount == 0) AND (_ownerUID in _tempArray)) then {
		        	_button ctrlShow true;   
		            _name = (pvar_beaconListIndep select _forEachIndex) select 0;
		            _button ctrlSetText	format["%1",_name]; 
		        } else {
		        	_name = "";
		            _button ctrlSetText _name;
		            _button ctrlShow false; 
		        };
			}forEach pvar_beaconListIndep;    
            
        };	    
    };
    sleep 0.1;
};

Those are all I found that have anything to do with Player spawning.

I have a temp fix by editing the orginal file below:
Edited Script - playerSpawn
Location - client\functions ( copied the original and moved it before editing to keep a back up. )

//	@file Version: 1.0
//	@file Name: playerSpawn.sqf
//	@file Author: [404] Deadbeat
//	@file Created: 20/11/2012 05:19
//	@file Args:

private ["_side"];

playerSpawning = true;
playerUID = getPlayerUID(player);
townSearch = 0;
beaconSearch = 0;

doKickTeamKiller = false;
doKickTeamSwitcher = false;

//Check Teamkiller
{
	if(_x select 0 == playerUID) then {
        
		if((_x select 1) >= 2) then {
			if(playerSide in [west, east]) then {
				doKickTeamKiller = true;
			};
		};
	};
} forEach pvar_teamKillList;

//Check Teamswitcher
{
	if(_x select 0 == playerUID) then
    {
        if(playerSide != (_x select 1) && !(playerSide in [INDEPENDENT,sideEnemy])) then{
        	doKickTeamSwitcher = true;
			_side = str(_x select 1);
        };	
	};
} forEach pvar_teamSwitchList;

//Kick to lobby for appropriate reason
//Teamkiller Kick
if(doKickTeamKiller) exitWith {
	titleText ["", "BLACK IN", 0];
	titleText [localize "STR_WL_Loading_Teamkiller", "black"]; titleFadeOut 9999;
	[] spawn {sleep 20; endMission "LOSER";};
};

//Teamswitcher Kick
if(doKickTeamSwitcher) exitWith {
	titleText ["", "BLACK IN", 0];
	titleText [format[localize "STR_WL_Loading_Teamswitched", localize format ["STR_WL_Gen_Team%1_2", _side]], "black"]; titleFadeOut 9999;
	[] spawn {sleep 20; endMission "LOSER";};
};

//Send player to debug to stop fake spawn locations.
player setPos [3755.94,7945.76,0.00160313];

titleText ["Loading...", "BLACK OUT", 0.00001];

private ["_handle"];
true spawn client_respawnDialog;

waitUntil {respawnDialogActive};

while {respawnDialogActive} do {
	titleText ["", "BLACK OUT", 0.00001];
};
sleep 0.1;
titleText ["", "BLACK IN", 0.00001];
playerSpawning = false;

To save on looking hard , I took this from the original code :
//Send player to debug to stop fake spawn locations.
player setPos [-20000 - (random 10000), 5000 + random 15000, 0];

and replaced it with this:
//Send player to debug to stop fake spawn locations.
player setPos [3755.94,7945.76,0.00160313];

All this did was allow all players to start in the map, instead of debug.
But , it is not a random spawn, and all factions spawn on that point.

It probably will help if anyone knows what 404game's wasteland is ... and can download and run it to see what I am saying clearly.

Wasteland_Takistan_ver3.0 Standalone < I extracted using PBOview.

If anyone can look into this, and help me fix the silly random spawn system , I would be grateful, and share the fix with the world as I seen several others posted on 404games forums about the same issue ... but the only response 404games gave was "do not support this anymore", and no help was given.

If this cannot be fixed , then a viable alternative that will work instead I am willing to do.

Only issue with that is, other than that one line I changed, any other changes I try to do , seem to break some features in game , like vehicles not spawning weapons in cargo, or can't load objects or tow vehicles ... which are all crucial to the game play.

Please, please, please help me someone ... I am begging. Even if it takes someone to download, and extract and look at everything in the files/scripts ...
This one thing is really the only thing I need fixed, so it works right and makes my players happier.


Author Message


Posts: 4
Rank:


Level: Member

Country: us
Location:
Occupation:
Age:
In-game name:

 
#2 Posted at 2016-02-18 01:26        
     
Nevermind on this, I stopped running the mission on my server. Just not enough folks interested in playing it.


Advertisement


Author Message

Brook  



Posts: 2
Rank:


Level: Member

Country: de
Location: Eastern Zone
Occupation:
Age:
In-game name: GodZilla aka JaJa aka Brook

 
#3 Posted at 2019-05-24 09:29        
     
Hi,May Be Will Help You this:
Delete In The "PlayerSpawn.sqf" Located In client\functions, this:
//Send player to debug to stop fake spawn locations.
player setPos [-20000 - (random 10000), 5000 + random 15000, 0];
And Replace With This:
_markers = ["Town_0", "Town_1", "Town_2","Town_3", "Town_4", "Town_5","Town_6", "Town_7", "Town_8","Town_9", "Town_10", "Town_11", "Town_12","Town_13", "Town_14", "Town_15","Town_16", "Town_17", "Town_18","Town_19","Town_20", "Town_21", "Town_22","Town_23", "Town_24", "Town_25","Town_26", "Town_27", "Town_28","Town_29", "Town_30", "Town_31", "Town_32","Town_33", "Town_34", "Town_35","Town_36", "Town_37", "Town_38","Town_39", "Town_40","Town_41","Town_42","Town_43","Town_44","Town_45","Town_46"];
player setpos (getMarkerPos (_markers select (floor(random(count _markers)))));

This post was edited by Brook (2019-05-24 09:47, 491 days ago)