Jump to content

Random Spawn Script


Matijs

Recommended Posts

I can't for the life of me get this to work on Altis.

	class Markers
	{
		items = 3;
		class Item0
		{
			position[] = {6968.658,324.48145,8345.914};
			name = "center";
			type = "Empty";
		};
		class Item1
		{
			position[] = {1024.82,0,2023.51};
			name = "respawn_east";
			type = "Empty";
			angle = 23.608498;
		};
		class Item2
		{
			position[] = {1024.8502,5.858802,2023.5204};
			name = "respawn_west";
			type = "Empty";
			angle = 23.608498;
		};
	};
	class Sensors
	{
		items=1;
		class Item0
		{
			position[]={1024.8502,5.858802,2023.5204}; //Spawnpoint coords (same as respawn_west & east)
			activationBy="ANY";
			repeating=1;
			interruptable=1;
			age="UNKNOWN";
			name="SPAWNPOINT";
			expCond="(player distance SPAWNPOINT) < 50;";
			expActiv="inSpawnPoint = true;";
			expDesactiv="inSpawnPoint = false;";
			class Effects
			{
			};
		};
	};
Link to comment
Share on other sites

I can't for the life of me get this to work on Altis.

	class Markers
	{
		items = 3;
		class Item0
		{
			position[] = {6968.658,324.48145,8345.914};
			name = "center";
			type = "Empty";
		};
		class Item1
		{
			position[] = {1024.82,0,2023.51};
			name = "respawn_east";
			type = "Empty";
			angle = 23.608498;
		};
		class Item2
		{
			position[] = {1024.8502,5.858802,2023.5204};
			name = "respawn_west";
			type = "Empty";
			angle = 23.608498;
		};
	};
	class Sensors
	{
		items=1;
		class Item0
		{
			position[]={1024.8502,5.858802,2023.5204}; //Spawnpoint coords (same as respawn_west & east)
			activationBy="ANY";
			repeating=1;
			interruptable=1;
			age="UNKNOWN";
			name="SPAWNPOINT";
			expCond="(player distance SPAWNPOINT) < 50;";
			expActiv="inSpawnPoint = true;";
			expDesactiv="inSpawnPoint = false;";
			class Effects
			{
			};
		};
	};

Is there another }; at the end of the code you sent here?

Link to comment
Share on other sites

Is there another }; at the end of the code you sent here?

	class Markers
	{
		items = 3;
		class Item0
		{
			position[] = {14939.934,0.053499073,15083.272};
			name = "center";
			type = "Empty";
		};
		class Item1
		{
			position[] = {23600.639,3.19,18000.72};
			name = "respawn_east";
			type = "Empty";
		};
		class Item2
		{
			position[] = {23600.611,3.19,18000.768};
			name = "respawn_west";
			type = "Empty";
		};
	};
	class Sensors
	{
		items=1;
		class Item0
		{
			position[]={23600.639,3.19,18000.72}; //Spawnpoint coords (same as respawn_west & east)
			activationBy="ANY";
			repeating=1;
			interruptable=1;
			age="UNKNOWN";
			name="SPAWNPOINT";
			expCond="(player distance SPAWNPOINT) < 50;";
			expActiv="inSpawnPoint = true;";
			expDesactiv="inSpawnPoint = false;";
			class Effects
			{
			};
		};
	};
};
class Intro
{
	addOns[] = {"a3_map_altis"};
	addOnsAuto[] = {"a3_map_altis"};
	randomSeed = 13802307;
	class Intel
	{
		timeOfChanges = 1800.0002;
		startWeather = 0.3;
		startWind = 0.1;
		startWaves = 0.1;
		forecastWeather = 0.3;
		forecastWind = 0.1;
		forecastWaves = 0.1;
		forecastLightnings = 0.1;
		year = 2035;
		month = 6;
		day = 24;
		hour = 12;
		minute = 0;
		startFogDecay = 0.013;
		forecastFogDecay = 0.013;
	};
};
class OutroWin
{
	addOns[] = {"a3_map_altis"};
	addOnsAuto[] = {"a3_map_altis"};
	randomSeed = 4712975;
	class Intel
	{
		timeOfChanges = 1800.0002;
		startWeather = 0.3;
		startWind = 0.1;
		startWaves = 0.1;
		forecastWeather = 0.3;
		forecastWind = 0.1;
		forecastWaves = 0.1;
		forecastLightnings = 0.1;
		year = 2035;
		month = 6;
		day = 24;
		hour = 12;
		minute = 0;
		startFogDecay = 0.013;
		forecastFogDecay = 0.013;
	};
};
class OutroLoose
{
	addOns[] = {"a3_map_altis"};
	addOnsAuto[] = {"a3_map_altis"};
	randomSeed = 10755213;
	class Intel
	{
		timeOfChanges = 1800.0002;
		startWeather = 0.3;
		startWind = 0.1;
		startWaves = 0.1;
		forecastWeather = 0.3;
		forecastWind = 0.1;
		forecastWaves = 0.1;
		forecastLightnings = 0.1;
		year = 2035;
		month = 6;
		day = 24;
		hour = 12;
		minute = 0;
		startFogDecay = 0.013;
		forecastFogDecay = 0.013;
	};
};
//};

Nope, I had the wrong coordinates first snippit of code above but it still doesn't work. I take it I need another }; at the end? I don't even get a half assed message about it trying to teleport me or something. Nothing at all happens.

 

By the way in the OP you say to make a spawnpoint.sqf but you call a spawnpoints.sqf in your init.sqf.

Link to comment
Share on other sites

If you want to check brackets, grab Notepad++ , it draws nice lines to connect bracket pairs.. IMO it's an essential tool for modders.

I use sublime and it looks to me like they're all correctly bracketed. I'm not sure what's going on. It's in the main mission class and after markers.

Link to comment
Share on other sites

How would I spawn at the same places just in the air so they can paradrop? i got them to spawn with the parachutes but when they pick a portal i want them in the air.

not entirly sure but i think you have to adjust the "0.1"in oure spawnpoints.sqf to youre desired height

 

_spawnpointsarray = [

[1745,2107,0.1],

 

would become something like this

 

_spawnpointsarray = [

[1745,2107,300],

 

i used just 1 line you have to adjust it in all the spawnpoitarray lines 

 

not sure if 300 would do it dont know how long it would take to open youre parachute you should try this out

 

Link to comment
Share on other sites

actually my randomspawn.sqf looks like this.

if (isNil "inSpawnPoint") then {
	inSpawnPoint = false;
};
 
while {true} do {
	waitUntil { inSpawnPoint };
	waitUntil { player == vehicle player };
	thePlayer = vehicle player;
	systemChat "Calculating spawn point...please be patient";
	_randPos = [getMarkerPos "center",1500,10000,1,0,20,1] call BIS_fnc_findSafePos; //spawn on shore only
        //_randPos = [getMarkerPos "center",1500,10000,0,1,20,0] call BIS_fnc_findSafePos; //spawn off shore
	_posX = _randPos select 0;
	_posY = __randPos select 1;
	_spawnpoint = [_posX,_posY,0.1];

	sleep 1;
	systemChat "Spawn point selected. Teleporting...";
	sleep 1;
	thePlayer setPos _spawnpoint;

	waitUntil { !inSpawnPoint };
};

calculating a position didn´t took longer than 10-30 secs on Stratis. Must test on Altis too. 
In Case something goes wrong or someone does want to spawn at a trader i kept the teleporters at the debug location.

 

requires to add !"findSafePos" to scripts.txt in line 1 to avoid a scripts #0 kick on join

Link to comment
Share on other sites

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now
×
×
  • Create New...