Jump to content
Grahame

Deployable Sleeping Bags as Spawn Points

Recommended Posts

sleeping_bags.jpg

Another class of item added to EpochCore client-side in 1.1 are deployable sleeping bags. Here is the code for placing them and a suggestion (and code) for actually making use of them to provide greater flexibility at respawn for your players.

Installation Instructions

(1) Add the sleeping bag "kits" to your loot tables and trader price lists. The class names are KitSleepingBagGreenKitSleepingBagBlue and KitSleepingBagBrown

(2) Add the following to epoch_config/Configs/CfgItemInteractions.hpp:

	class KitSleepingBagGreen : Item_Build_base
    {
        buildClass = "SleepingBagGreen_SIM_EPOCH";
    };
	class KitSleepingBagBlue : Item_Build_base
    {
        buildClass = "SleepingBagBlue_SIM_EPOCH";
    };
	class KitSleepingBagBrown : Item_Build_base
    {
        buildClass = "SleepingBagBrown_SIM_EPOCH";
    };

(3) Add the following to epoch_config/Configs/CfgBaseBuilding.hpp:

	class SleepingBagGreen_EPOCH  : Default
	{
		removeParts[] = {{"KitSleepingBagGreen",1}};
		GhostPreview = "SleepingBagGreen_Ghost_EPOCH";
		staticClass = "SleepingBagGreen_EPOCH";
		simulClass = "SleepingBagGreen_SIM_EPOCH";
		bypassJammer = 1;
	};
	class SleepingBagGreen_SIM_EPOCH : SleepingBagGreen_EPOCH
	{
		removeParts[] = {};
	};
	class SleepingBagGreen_Ghost_EPOCH : SleepingBagGreen_SIM_EPOCH {};
	class SleepingBagBlue_EPOCH  : Default
	{
		removeParts[] = {{"KitSleepingBagBlue",1}};
		GhostPreview = "SleepingBagBlue_Ghost_EPOCH";
		staticClass = "SleepingBagBlue_EPOCH";
		simulClass = "SleepingBagBlue_SIM_EPOCH";
		bypassJammer = 1;
	};
	class SleepingBagBlue_SIM_EPOCH : SleepingBagBlue_EPOCH
	{
		removeParts[] = {};
	};
	class SleepingBagBlue_Ghost_EPOCH : SleepingBagBlue_SIM_EPOCH {};
	class SleepingBagBrown_EPOCH  : Default
	{
		removeParts[] = {{"KitSleepingBagBrown",1}};
		GhostPreview = "SleepingBagBrown_Ghost_EPOCH";
		staticClass = "SleepingBagBrown_EPOCH";
		simulClass = "SleepingBagBrown_SIM_EPOCH";
		bypassJammer = 1;
	};
	class SleepingBagBrown_SIM_EPOCH : SleepingBagBrown_EPOCH
	{
		removeParts[] = {};
	};
	class SleepingBagBrown_Ghost_EPOCH : SleepingBagBrown_SIM_EPOCH {};

So, at this point you can place sleeping bags and they look pretty nice, but what's the point. Well, say for example that you would like to seal your jammer away in a dark place in your base but don't want to respawn in that room, but do want to respawn somewhere in a base; or perhaps you are doing a mission or you're off hunting heroes and don't want to make your way from the coast all over again... well, you can set sleeping bags to be spawn points too!

(4) Change the definition for the select_jammer class in epoch_config/Configs/CfgActionMenu/cfgActionMenu_target.hpp to:

class select_jammer
{
	condition = "((dyna_cursorTargetType isEqualTo 'PlotPole_EPOCH') || (dyna_cursorTargetType isEqualTo 'SleepingBagGreen_EPOCH') || (dyna_cursorTargetType isEqualTo 'SleepingBagBlue_EPOCH') || (dyna_cursorTargetType isEqualTo 'SleepingBagBrown_EPOCH')) && (damage dyna_cursorTarget < 1)";
	action = "[dyna_cursorTarget,player,Epoch_personalToken] remoteExec [""EPOCH_server_makeSP"",2];";
	icon = "x\addons\a3_epoch_code\Data\UI\buttons\player_inspect.paa";
	tooltip = "Make Spawnpoint";
};

RePBO your mission file and upload it to the server.

(5) Now unpack epoch_server.pbo. There is one file in there that needs a change which is compile/epoch_player/EPOCH_server_loadPlayer.sqf. Change line 145 from:

				_jammers = nearestObjects[_CheckLocation, ["PlotPole_EPOCH"], 6];

to:

				_jammers = nearestObjects[_CheckLocation, ["PlotPole_EPOCH","SleepingBagGreen_EPOCH","SleepingBagBlue_EPOCH","SleepingBagBrown_EPOCH"], 6];

RePBO epoch_server.pbo and upload to your server. You now have sleeping bags that can be built anywhere and used as respawn points.

Be aware though! Anyone can pick yours up in the wild (as they should be able to) and you will no longer spawn at its location!

(Optional 6) Also note that should you give these as starting gear you may want to add energy to a player at spawn by changing the energy entry in the CustomVarsDefaults array in epoch_config/CfgEpochClient.hpp to something like the following (which gives 1250 energy to a new spawned player):

		{"Energy",1250,{2500,0}},

 

Share this post


Link to post
Share on other sites

Thank you so much for this script, it only makes sense for base building! My server is not starting after installing this script for 1.2.

 

WATCHDOG (3119): [Sun Jul 22 08:47:32 UTC 2018] Starting server (port 2302)...
 8:47:32 Could not enable linux core dumps. Error 1 -
 8:47:32 SteamAPI initialization failed. Steam features won't be accessible!
 8:47:32 Cannot register unknown string STR_3DEN_CAMERA_NAME
 8:47:32 Cannot register unknown string STR_DIFF_SCENE_ONLY
 8:47:32 Cannot register unknown string STR_DIFF_SCENE_AND_MAP
 8:47:32 Initializing stats manager.
 8:47:32 Stats config disabled.
 8:47:32 sessionID: 994ff4cf491f4543550f75692a99377c592dc023
 8:47:38 Unsupported language English in stringtable
 8:47:38 Item str_a3_to_c01_m02_036_ta_mechanized_briefing_SOLDIERC_0 listed twice
ErrorMessage: File epoch_server_settings\configs\CfgLootTable.h, line 202: Config: '{' encountered instead of ','
Application terminated intentionally
 8:47:40 ../lib/Network/networkServer.cpp ClearNetServer:NOT IMPLEMENTED - briefing!
File epoch_server_settings\configs\CfgLootTable.h, line 202: Config: '{' encountered instead of ','
 8:47:40 Critical:Destroying running thread!
 8:47:40 Critical:Destroying running thread!
 8:47:40 Critical:Destroying running thread!
 8:47:40 Extensions:
WATCHDOG (3119): [Sun Jul 22 08:47:40 UTC 2018] Server died, waiting to restart...

 

Share this post


Link to post
Share on other sites

You have a separate issue in your CfgLootTable.h... 

ErrorMessage: File epoch_server_settings\configs\CfgLootTable.h, line 202: Config: '{' encountered instead of ','
Application terminated intentionally

That's what preventing the server from coming online. What did you add there? The sleeping bags I assume.

Share this post


Link to post
Share on other sites
7 hours ago, Grahame said:

You have a separate issue in your CfgLootTable.h... 

ErrorMessage: File epoch_server_settings\configs\CfgLootTable.h, line 202: Config: '{' encountered instead of ','
Application terminated intentionally

That's what preventing the server from coming online. What did you add there? The sleeping bags I assume.

Yes, I tried to add them, essentially anything I tried to add from your step 1 crashed the server, if you could be so kind as to let us know how you added your Sleeping Bags to the loot tables and spawn tables that would be awesome.

In addition, I'm also getting an error message when I try to connect to the server. "Authentication Failed" after a bunch of errors.

 

CE02F4FD446EE242F05E5B11693CB4B84B246D1F

 

I'm going to remove all the edits 1 by 1, and then try to start the server again. Then add them back with your edits for step 1.

 

EDIT:

I have since got the server to start after removing all the edits and adding all the steps back, but the server starts but I cannot connect to it.

The game type has a - in it and the logs look like.

After reviewing all the logs problems and it seems that I'm having problems with step 3, where exactly do you put the information in that.

 

I've pretty much fixed everything else, the server is now starting but it's loading me into a black screen I'm guessing because step 3 is not installed.

It Gives me an "authentication failed" and kicks me from the server.

 

It now looks as if step 5 is causing this problem.

 

18:38:52 "CfgEpochCoreServerFunctions"
18:38:52 "Epoch: Advanced Vehicle Repair Enabled"
18:38:52 "Loading Functions: CfgServerFunctions"
18:38:52 Error in expression <Location;
};
_jammers = nearestObjects[_CheckLocation, ["PlotPole_EPOCH","Sle>
18:38:52   Error position: <CheckLocation, ["PlotPole_EPOCH","Sle>
18:38:52   Error Missing ]
18:38:52 File epoch_server\compile\epoch_player\EPOCH_server_loadPlayer.sqf, line 146
18:38:52 Error in expression <Location;
};
_jammers = nearestObjects[_CheckLocation, ["PlotPole_EPOCH","Sle>
18:38:52   Error position: <CheckLocation, ["PlotPole_EPOCH","Sle>
18:38:52   Error Missing ]
18:38:52 File epoch_server\compile\epoch_player\EPOCH_server_loadPlayer.sqf, line 146
18:38:52 Mission read.
18:38:52 Connected to Steam servers
18:38:52 "Epoch: Starting ArmA3 Epoch Server, Version 1.2.0. Note: If server crashes directly after this point check that Redis is running and the connection info is correct."
18:38:52 CallExtension loaded:   epochserver (/home/epoch/arma3/@epochhive/epochserver.so) []

I was able to get the server working though, without this step.

 

EDIT:

 

I was able to get the server started with all the scripts in your post, but whenever I try to build a sleeping bag I get Building Disallowed Frequency Jammer Needed, I built a jammer and was able to place the sleeping bag next to it. I ran off in a field and committed suicide with a grenade and it didn't spawn me at my sleeping bag it spawned me back at the spawn tubes.

 

I have successfully got it working, I see where you use the jammer to set the spawnpoint nice!

Share this post


Link to post
Share on other sites
_jammers = nearestObjects[_CheckLocation, ["PlotPole_EPOCH","SleepingBagGreen_EPOCH","SleepingBagBlue_EPOCH","SleepingBagBrown_EPOCH"], 6];

This should still work.
"call EPOCH_JammerClasses" is only needed, when you have defined other types than the default Jammers as PlotPoles.

But you can also use:

_jammers = nearestObjects[_CheckLocation, call EPOCH_JammerClasses + ["SleepingBagGreen_EPOCH","SleepingBagBlue_EPOCH","SleepingBagBrown_EPOCH"], 6];

@Tarabas

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...

  • Advertisement
  • Supporters
  • Discord

×
×
  • Create New...