Jump to content

Random Spawn Script


Matijs

Recommended Posts

Anyone know how to add a 4th portal or get the coordinates to add one ?

 cant u just go inside and add lets say a object u can then pull cords from the DB i did that to add more random spawn points around my map

 

 

....make three different spawnpoints.sqf (spawnpoints1.sqf, spawnpoints2.sqf....)

In your init:

if (!isDedicated) then {

    [] execVM "spawnpoints1.sqf";

    [] execVM "spawnpoints2.sqf";

    [] execVM "spawnpoints3.sqf";

};

 

And in your mission add three Sensors, like this:

 

class Sensors

    {

        items=3;

        class Item0

        {

            position[]={6325.6772,0,7807.7412}; //Spawnpoint coords left TP

            activationBy="ANY";

            repeating=1;

            interruptable=1;

            age="UNKNOWN";

            name="SPAWNPOINT1";

            expCond="(player distance SPAWNPOINT1) < 2;";

            expActiv="inSpawnPoint = true;";

            expDesactiv="inSpawnPoint = false;";

            class Effects

            {

            };

        };

        class Item1

        {

            position[]={6325.6772,0,7807.7412}; //Spawnpoint coords middle TP

            activationBy="ANY";

            repeating=1;

            interruptable=1;

            age="UNKNOWN";

            name="SPAWNPOINT2";

            expCond="(player distance SPAWNPOINT2) < 2;";

            expActiv="inSpawnPoint = true;";

            expDesactiv="inSpawnPoint = false;";

            class Effects

            {

            };

        };

        class Item2

        {

            position[]={6325.6772,0,7807.7412}; //Spawnpoint coords right TP

            activationBy="ANY";

            repeating=1;

            interruptable=1;

            age="UNKNOWN";

            name="SPAWNPOINT3";

            expCond="(player distance SPAWNPOINT3) < 2;";

            expActiv="inSpawnPoint = true;";

            expDesactiv="inSpawnPoint = false;";

            class Effects

            {

            };

        };

    };

 

Hope you understand the way i´m thinking....

You have the three Teleporter already in this Box, but the player couldnt use it, cause the Sensor on the TP is about 2m, wich is activate the spawnpoints.sqf.

And in the three spawnpoints.sqf you take the coords you wanna have

So this is only basic, not testet, but if you spend a little time for test, youll figure out how to make this work....

 

 

 

i like this idea is it still the same script or is it been edited differntly for spawning randomly

Link to comment
Share on other sites

 cant u just go inside and add lets say a object u can then pull cords from the DB i did that to add more random spawn points around my map

 

Nope, I can't find where the debug is loaded from to get its coordinates :unsure: anyone know the location of it on Chernarus ?

Link to comment
Share on other sites

Nope, I can't find where the debug is loaded from to get its coordinates :unsure: anyone know the location of it on Chernarus ?

 

debug is left of kamenka, left ot tihaya bay. it's on the coast. 

 

Coords u can find in the server config pbo : ) , in the config.bin file

Link to comment
Share on other sites

My config.bin only contains the loot table, I don't see the world coordinates for the debug area with the spawn tubes.

its in that area on that pic very hard to miss its a very big BOX Shaped building on the ground  by the coast but the cords are 010 133

Link to comment
Share on other sites

@Richie

You find the coords for the Teleporter here: @epochhive\addons\a3_epoch_server_settings\config.cpp

You have to scroll around to find your map... in this example I take chernarus

First coords after Transport_W_EPOCH are the coords for the Teleporter west an so on...

class Chernarus : Default
    {
        worldSize = 12000;
        traderBlds[] = { "Land_A_FuelStation_Build", "Land_A_GeneralStore_01", "Land_A_GeneralStore_01a", "Land_A_Office01", "Land_Ind_Garage01", "Land_Ind_Workshop01_04", "Land_Ind_Workshop01_L", "Land_Shed_Ind02", "Land_Tovarna2", "Land_sara_hasic_zbroj" };
        telePos[] = {
                { "Transport_W_EPOCH", { 1009.76, 2023.75, 0.224995 }, "", { 4569.52, 4524.24, 0.201431 } }, // South West
                { "Transport_E_EPOCH", { 1040.27, 2023.47, 0.224995 }, "", { 12077.8, 5121.92, 0.00144958 } }, // South East
                { "Transport_N_EPOCH", { 1024.91, 2031.31, 0.224995 }, "", { 10688.6, 9428.98, 0.00144958 } } // North East
        };

 

The Coords for the DebugBox is binded on the coords for respawn west, I think.... Cause, if I change this coords in my mission.sqm, the Box will spawn there... ;-)

Just have a look into this file:

@epochhive\addons\a3_epoch_server\compile\epoch_server\EPOCH_server_createTeleport.sqf

private["_aa","_ab","_ac","_ad","_ae"];
_debugLocation=getMarkerPos "respawn_west";
_debugLocation set[2,0];
_debug=createVehicle["Debug_static_F",_debugLocation,[],0,"CAN_COLLIDE"];
_protection=createVehicle["ProtectionZone_Invisible_F",_debugLocation,[],0,"CAN_COLLIDE"];
_debug1=createVehicle["clone_male_static_F",(_debug modelToWorld(_debug selectionPosition "2")),[],0,"CAN_COLLIDE"];
_debug1 setDir-90;
_debug2=createVehicle["clone_female_static_F",(_debug modelToWorld(_debug selectionPosition "5")),[],0,"CAN_COLLIDE"];
_debug2 setDir 90;
_debug3=createVehicle["clone_male_static_F",(_debug modelToWorld(_debug selectionPosition "7")),[],0,"CAN_COLLIDE"];
_debug3 setDir 90;

_debugLocation=getMarkerPos "respawn_west"; ........IYKWIM

 

Link to comment
Share on other sites

I think I should describe my problem better. So the problem is the following. have the script running successfully, after clients spawn in the debug box they get teleported by the script. normally it should teleported the clients to one of the cords I defined in the spawn script but it just spawns them into the middle of the sea. (nearly same area all the time. does anyone know how to get this working? Respawn West, Respawn east and the sensor which calls the script have the same coordinates.

Link to comment
Share on other sites

when i look at this all the code is on one very very long line :-s how do i make it separate on separate lines like above spoiler ??

Open the File with Notepad++

Now, sorry for my bad english... will upload a picture, my Notepad++ has german language, but pics say more than thousands words...

 

Press CTRL + F

This open a search-window click on the second TAB ?replace?

Now write a ; in the "search for" textbox

And in the "replace" textbox you need to write ;\n

You need to enable the option on Step 4 of the picture

And then you click to "Replace All"..... tada

Picture:

notepad.jpg

Link to comment
Share on other sites

I think I should describe my problem better. So the problem is the following. have the script running successfully, after clients spawn in the debug box they get teleported by the script. normally it should teleported the clients to one of the cords I defined in the spawn script but it just spawns them into the middle of the sea. (nearly same area all the time. does anyone know how to get this working? Respawn West, Respawn east and the sensor which calls the script have the same coordinates.

 

Have a look to your mission.sqm, I think you have the wrong format of the Grid... Coords

In SQM the Z is in middle, in SQF the Z on the end (Z=height)

 

From the spawnpoints.sqF:

1745,2107,0.1 ---> 0.1 = height

 

From the mission.sqM:

6325.6772,0,7807.7412 ---> 0 = height

 

So, just check the right Format and I think it will work

Link to comment
Share on other sites

  • 2 weeks later...

Hi All, 

 

I'm still trying to get my hands around server setup & maintenance, so I apologize if it appears I'm wasting your time. 

 

Firstly, I've applied what seems to be all necessary changes to init.SQF, mission.sqm and spawnpoints.sqf. I've uploaded them to my dropbox for convenience, but if someone prefers I can post the text here as well. 

 

Second, I've tried hiding the default spawn crate (with teleports) outlined in this forum, but it seems I'm doing something wrong here as well. I've unpacked the "a3_epoch_server_settings" pbo and made changes to the config.cpp, outlined below. Note - the PBO is found under "@EpochHive\Addons" to my understanding.

 

 

class Altis : Default

{
worldSize = 20000;
traderBlds[] = { "Land_Kiosk_blueking_F", "Land_FuelStation_Build_F", "Land_CarService_F", "Land_i_Garage_V1_F", "Land_i_Shed_Ind_F", "Land_i_Shop_01_V1_F" };
containerPos[] = {
{ 8599.97, 24513.6, 0 },
{ 6282.61, 22654, 0 },
{ 3431.42, 22447.1, 0 },
{ 3524.53, 22718.1, 0 },
{ 3528.63, 22747.7, 0 },
{ 2185.4, 21454.6, 0 },
{ 2180.42, 21429.5, 0 },
{ 2105.21, 23439.7, 0 },
{ 2352.68, 19379.2, 0 },
{ 3022.73, 13520.1, 0 },
{ 2997.03, 13502.6, 0 },
{ 1940.41, 10095.8, 0 },
{ 7454.79, 9247.77, 0 },
{ 7485.66, 9255.52, 0 },
{ 12060.5, 6203.39, 0 },
{ 12059.2, 6183.42, 0 },
{ 14205.4, 7549.47, 0 },
{ 14373.1, 7688.5, 0 },
{ 14376.8, 7715.9, 0 },
{ 13115, 9491.82, 0 },
{ 13666, 11913.7, 0 },
{ 13682.8, 11890.2, 0 },
{ 15209.5, 14341.1, 0 },
{ 15326.2, 14361.6, 0 },
{ 15340.7, 14291.1, 0 },
{ 15351.3, 14278.1, 0 },
{ 15419.5, 14287.1, 0 },
{ 15951.8, 9707.72, 0 },
{ 22199.6, 5697.94, 0 },
{ 22279.2, 8641.17, 0 },
{ 26135.7, 19798.5, 0 },
{ 27908.6, 24460.4, 0 },
{ 23164.5, 24046.1, 0 },
{ 21016.3, 20024.2, 0 },
{ 18776.8, 18291.9, 0 },
{ 17361.2, 18792.1, 0 },
{ 17598.9, 18813.6, 0 },
{ 17560, 18928.3, 0 },
{ 17702.8, 19466.5, 0 }
};
telePos[] = {
{ "Transport_C_EPOCH", { 23600.5, 18009, -50.233421 }, "", { 13326.5, 14515.2, -50.16426 } }, // Trader city 1
{ "Transport_W_EPOCH", { 23585.4, 18000.7, -50.233424 }, "", { 6192.46, 16834, -50.00154114 } }, // Trader city 2
{ "Transport_E_EPOCH", { 23615.5, 18000.9, -50.233423 }, "", { 18451.9, 14278.1, -50.00143814 } } // Trader city 3
};
telePosCenter[] = {23600, 18009, -50}

As always, any help is appreciated! 

 

Thanks,

 

Jbox88

Link to comment
Share on other sites

I think I should describe my problem better. So the problem is the following. have the script running successfully, after clients spawn in the debug box they get teleported by the script. normally it should teleported the clients to one of the cords I defined in the spawn script but it just spawns them into the middle of the sea. (nearly same area all the time. does anyone know how to get this working? Respawn West, Respawn east and the sensor which calls the script have the same coordinates.

If you have recently changed maps you will need to wipe the database so the new map database can be made active ?

Link to comment
Share on other sites

so i went into editor...placed soldiers around map for spawn points...copied the cords over to spawnpoing script and all i get is spawning in water.

 

did not have this problem on cherno

Remember that in the mission.sqm it's xzy, in .sqf it's xzy, are you sure you've changed the coordinates correctly ?

So basically the height is the middle parameter in .sqm but in .sqf it's the last

Link to comment
Share on other sites

  • 2 weeks later...

anyone have any altis spawn points? im being lazy here :P

 

thanks in advance :D

 

if (isNil "inSpawnPoint") then {
	inSpawnPoint = false;
};
_mPos = [
[3560.1035,13083.708,0.1],
[3820.1555,13708.508,0.1],
[4219.335,15051.563,0.1],
[4925.6255,16132.682,0.1],
[3902.8757,17405.727,0.1],
[3902.8757,17405.727,0.1],
[4096.0322,11756.556,0.1],
[5105.2622,11272.859,0.1],
[5184.3306,14477.511,0.1],
[6250.1523,15104.31,0.1],
[7143.4854,16274.598,0.1],
[9352.4258,15876.169,0.1],
[12425.263,15876.017,0.1],
[12485.178,14313.947,0.1],
[14953.449,16592.48,0.1],
[16373.166,17261.219,0.1],
[18840.512,16623.096,0.1],
[20980.967,16994.732,0.1],
[16912.867,12708.29,0.1],
[20541.539,8869.9131,0.1],
[19895.506,11686.942,0.1],
[16958.914,15165.632,0.1],
[15963.038,16163.978,0.1],
[21398.707,16389.771,0.1],
[22830.541,19199.67,0.1],
[25728.291,21385.627,0.1],
[26995.854,23248.502,0.1],
[17868.898,17770.432,0.1],
[14488.871,17663.668,0.1],
[14000.213,18705.748,0.1],
[9432.7646,20254.582,0.1],
[9166.3848,21587.592,0.1],
[21140.688,7285.8965,0.1],
[21606.014,7747.3281,0.1],
[20784.965,6700.9902,0.1],
[11562.277,11739.153,0.1],
[10601.9,12308.547,0.1],
[9023.6709,12041.779,0.1],
[9269.2549,13430.002,0.1]
];
while {true} do {
	waitUntil { inSpawnPoint };
	waitUntil { player == vehicle player };
	thePlayer = vehicle player;
	_clothes = [
		"U_C_Scientist",
		"U_C_Journalist",
		"U_C_Poor_1",
		"U_C_Poloshirt_redwhite",
		"U_NikosBody",
		"U_C_Poloshirt_salmon",
		"U_C_WorkerCoveralls",
		"U_C_Poloshirt_tricolour",
		"U_OrestesBody",
		"U_C_Poloshirt_burgundy",
		"U_Rangemaster",
		"U_C_Poloshirt_blue",
		"U_Competitor",
		"U_C_Poloshirt_stripped",
		"U_C_Fisherman",
		"U_C_Farmer",
		"U_C_Scavenger_1",
		"U_C_Scavenger_2",
		"U_C_PriestBody"
		] call BIS_fnc_selectRandom;
	
	thePlayer addVest "V_1_EPOCH";
	thePlayer addWeapon "ItemMap";
	thePlayer forceAddUniform _clothes;
	_selectspawnpoint = _mPos select floor random count _mPos;
	_randPos = [_selectspawnpoint,0,500,1,0,25,0] call BIS_fnc_findSafePos;
	_posX = _randPos select 0;
	_posY = _randPos select 1;
	_spawnpoint = [_posX,_posY,0.1];
	thePlayer setPos _spawnpoint;
	waitUntil { !inSpawnPoint };
};

 

this is my altis randomspawn. feel free to use as u like it. Spawnpoints are mostly nearby cities. Players spawn usually at a max distance of 1km from town or city

 

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...