Jump to content
Matijs

Random Spawn Script

Recommended Posts

This might be not the way to do this, but I dont reallly care, because it works.

This script was made for a server to be able to have random spawns. (Spawn points given by the administrator.)

Make a script called spawnpoints.sqf:

 
if (isNil "inSpawnPoint") then {
inSpawnPoint = false;
};
 
while {true} do {
waitUntil { inSpawnPoint };
titleText [format["Entering Spawn Point."],"PLAIN DOWN"]; titleFadeOut 4;
 
waitUntil { player == vehicle player };
 
thePlayer = vehicle player;

_spawnpointsarray = [
[1745,2107,0.1],
[2737,1980,0.1],
[3663,2130,0.1],
[4109,2317,0.1],
[4813,2086,0.1],
[5825,2023,0.1],
[6357,2082,0.1],
[7198,2533,0.1],
[7226,2187,0.1],
[8045,2835,0.1],
[8577,2320,0.1],
[9286,1902,0.1],
[9840,1786,0.1],
[10466,1886,0.1],
[10243,1576,0.1],
[10857,2275,0.1],
[11939,3402,0.1],
[11105,3009,0.1],
[13509,6166,0.1],
[13081,7804,0.1],
[12940,9326,0.1],
[13170,10292,0.1]
];

systemChat "[DeadZ] Selecting spawn point...";
_selectspawnpoint = _spawnpointsarray select floor random count _spawnpointsarray;
sleep 1;
systemChat "[DeadZ] Spawn point selected. Spawning...";
sleep 1;
thePlayer setPos _selectspawnpoint;

 
waitUntil { !inSpawnPoint };
 
titleText [format["Exiting Spawn Point. Have fun."],"PLAIN DOWN"]; titleFadeOut 4;

 
};
In the init.sqf add this:
if (!isDedicated) then {
	[] execVM "spawnpoints.sqf";
};
In your mission sqm, create a sensor called SPAWNPOINT like this:
class Sensors
	{
		items=1;
		class Item0
		{
			position[]={6325.6772,0,7807.7412}; //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
			{
			};
		};
	};
And it should spawn you automaticaly after 2 seconds randomly.

Also you need to remove your portals, or place them -x in the ground.

Tell me if you like it.

This is very nooby, but it works, so no hate.

EDIT: I think you can remove the sleep 1;, im not sure about this, I just added it in for safety, so the player is definetaly going to a new location.

Greetings,

Matijs

Share this post


Link to post
Share on other sites

how do ya remove the portals?

 

You know how to configure overpoch, but you dont know how to hide the portals? Unpack your server settings pbo, config.cpp file, scroll down to class Chernarus, edit the first positions of the portals, set the height, last one, to -50 instead of 0

Share this post


Link to post
Share on other sites

some things are easy (calling a server overpoch for haing 300+ weapons and extra vehicles)

 

dont mean i know everything though ;)

 

also guess it can go pretty much anywhere in the mission.sqm ya?

 

tyvm been needing this for a while hated this spawn system :P

Share this post


Link to post
Share on other sites

can you just add this anywhere in mission.sqm

 

class Sensors
    {
        items=1;
        class Item0
        {
            position[]={6325.6772,0,7807.7412}; //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
            {
            };
        };
    };

Share this post


Link to post
Share on other sites
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[] = {6325.6772,0,7807.741};
activationBy = "ANY";
repeating = 1;
interruptable = 1;
age = "UNKNOWN";
name = "SPAWNPOINT";
expCond = "(player distance SPAWNPOINT) < 50;";
expActiv = "inSpawnPoint = true;";
expDesactiv = "inSpawnPoint = false;";
class Effects{};
};
};
 
 
is that correct cause this aint working for me :/

Share this post


Link to post
Share on other sites

 

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[] = {6325.6772,0,7807.741};
activationBy = "ANY";
repeating = 1;
interruptable = 1;
age = "UNKNOWN";
name = "SPAWNPOINT";
expCond = "(player distance SPAWNPOINT) < 50;";
expActiv = "inSpawnPoint = true;";
expDesactiv = "inSpawnPoint = false;";
class Effects{};
};
};
 
 
is that correct cause this aint working for me :/

 

 

Behind the last "};" is there another "};" ?

Share this post


Link to post
Share on other sites
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[]={6325.6772,0,7807.7412}; //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
 
 
 
so that should work? sorry about this :p

Share this post


Link to post
Share on other sites

Hump the coords are wrong in the file he posted so you'll never be near the sensor when you spawn.

 

Change that to the respawn east or west coords in the markers so it matches, then you'll spawn, and will be within the 25m and the script will execute.

Share this post


Link to post
Share on other sites

so if i dont make my mission.sqm crypted again my server wont let anyone join......

 

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
{
};
};
};
 
 
that is my coding but if i dont put another ); between the last ); from markers and sensors i cant re-crpt it

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...

  • Similar Content

    • By FG_Trap
      Made this in my free time awhile ago thought id make it public.
      Right Alt is the key to open the menu.
      Install instructions are inside the download.
      https://github.com/NWDZ-Trapxxgods/traps-menu
       
       
      here is a picture of the server menu
       
    • By lordacus
      so i have been making a server between trying to get my provider to update their mods section. after getting this don i found the server with epoch and infistar were conflicting each other such as: when joining i can use infistar but when i press f9 or i to enter my inventory or f10 for the mobile pad it then conflicts (i think) infistar and i can no longer use it. any ideas on how to stop this
       
    • By vbawol
      Open world survival mod set just two years after the mass extinction of billions of people. Those that remain are left with remnants of a once technological society. Try to survive, build, or explore your way through the harsh dynamic environment.
      Features
      Powerful persistence framework for Arma 3 with native Windows and Linux dedicated server support. Fully configurable script based security checks. Base Building re-envisioned for Arma 3 PhysX. Persistent secure and insecure storage devices. Upgradeable locking doors. Barter based economy and trading systems backed a single currency ¤ called "Krypto". Hostile Environment with several different types of antagonists, Air and Water temperature extremes, and Earthquakes. Hunting, Fishing, Tame Dogs, Explore & Loot: Wrecked ships, Abandoned vehicles and buildings, Perform task based missions and more! Open source APL-SA Epoch Survival MP gamemode. Open source APL-SA Modders resource configs and Class List. Assets can be used as a mod dependency on Steam workshop.
    • By Achef
      Greetings!
      So I recently started up in a new host and haven't gotten to make the server run, found that a ca/modules bis_fnc issue is recurring but doesn't affect players when running coop missions like the default arma 2 oa ones, but when trying with Epoch hive won't connect/start despite being configured.
      Hive error
      Meanwhile at line 23...
       
      I'm still bad with Pastebin, sorry.
       
      This error has been chasing me for 2 days now
    • By WeepiestLem0n
      So I've been wanting to create a private ArmA 2 DayZ Epoch server for a bunch of my mates to play on, however I dont have a dedicated machine and want to run it on my PC. So I looked at the server download files on the GitHub page and followed the ReadMe, however I absolutely cannot figure out how to get the MySQL server and DB set up. I have downloaded MySQL Server on my PC and created the admin role, root passwords and ran it as a windows service. I now have no clue how to create the database and am wondering if anyone can help me set this up or let me know if I've done anything wrong. 

      I can add on Steam or Discord if need be for convenience.
  • Advertisement
  • Supporters
  • Discord

×
×
  • Create New...