Jump to content
indijdev

Qs about ports and mods + Start gear solution [SOLVED]

Recommended Posts

 

Greetings.

First off, I would like to thank all the vets in here. Your contribution have provided invaluable information in my effort to get this thing up and running. Salute O7

I've solved a lot of initial issues by scouring through this forum, but there's a few things I haven't been able to figure out.
Hopefully some of you can nudge me in the right direction.


Problem 1:
I'm able to direct connect from my workstation to my home server over the LAN ip+port, but I just cannot get it to show up in the 'Community servers' tab or direct connect to my public IP.

All ports required for Steam is opened both in Win Defender and on my router as per this: Official Steam Post
Additionally 27015 is forwarded to the server and, as per the note in the post, nothing is re-mapped or reconfigured.

As I understand, BattleEye uses the game- and queryportnumber +10.
Port 2302 is set as gameport, opened in router and forwarded to the server along with 2312.
Port 2305 is set as queryport, opened in router and forwarded to the server along with 2315.
Serverlog is confirming these two ports being used - SUCCESS: SteamGameServer_Init(0,8766,2302,2305,3,1.15.154337)

I DO NOT have a static public IP - is this needed for direct connect? I'm checking public IP 2-3sec. before trying to connect.
Do I need to proxy out from my network to test my public IP? I've confirmed with a friend, but only once. He couldn't see it either.
I've read something about a Steam API Key - Do I need this to get my server to 'broadcast' it's presence?


Problem 2:
My server doesn't have any @<MODNAME> folders, only a lot of .pbo files.
The DayZ GAME folder on my workstation has all the @-folders of the mods I'm subscribed to, but they do not get downloaded as @-folders to the DayZ SERVER folder on my server-pc.

I've tried to unsub and resub to the mods from the steam-client on my server-pc, but that didn't work.
Do I need to install the full DayZ GAME on my server in order to get the mods?
Or is there some other way to handle mods that I am missing?


Contribution + bonus question:
-------------------------------

I've made some changes to init.c in order to edit the starting gear.
The changes will first spawn all things worn, then target individual slot and populate them.
This also allows you to spawn items on vests and belts, like buttpacks, holsters etc.

(Ed.) Updated version has a solution for spawning fully assembled weapons.

Modified init.c:

Spoiler

override void StartingEquipSetup(PlayerBase player, bool clothesChosen)
    {
        
        

        /*

        Thanks to the drgullen, philippj, HogsMaws and DrZeddy. I couldn't have done this without their input in this thread:
       https://forums.dayz.com/topic/242764-own-server-config

        Works for Vanilla - replace typenames as needed.
        Find all typenames in types.xml - I recommend Sublime Text for easy navigation through the list
        
        Snippet used for worn items:
            itemEnt = player.GetInventory().CreateInInventory( "item_typename" );
            
        Snippet used for inventory items (not sure where to find a list of slot names):
            itemFill = player.FindAttachmentBySlotName( "ATTACHMENT_SLOTNAME_STRING" )
            ...
            itemEnt = itemFill.GetInventory().CreateInInventory( "ITEM_TYPENAME" );
                
        Copy and paste the entries as needed, but make sure there's space enough in the item of clothes you have targeted
        Mags and Meds come maxed out.
                

        Enjoy - indij

        */


        /* Set variables */
        EntityAI itemEnt;
        EntityAI itemFill;
        
        /* Remove all items from player */
        player.RemoveAllItems()

        /* Spawn backpack first, explanation later */
        itemEnt = player.GetInventory().CreateInInventory( "TortillaBag" );
        
        /* Then spawn all other worn items */
        itemEnt = player.GetInventory().CreateInInventory( "MilitaryBoots_Redpunk" );
        itemEnt = player.GetInventory().CreateInInventory( "TrackSuitPants_Red" );
        itemEnt = player.GetInventory().CreateInInventory( "TrackSuitJacket_Red" );
        itemEnt = player.GetInventory().CreateInInventory( "SantasHat" );
        itemEnt = player.GetInventory().CreateInInventory( "SantasBeard" );
        itemEnt = player.GetInventory().CreateInInventory( "SurgicalGloves_White" );
        itemEnt = player.GetInventory().CreateInInventory( "MilitaryBelt" );
        itemEnt = player.GetInventory().CreateInInventory( "SmershVest" );
        itemEnt = player.GetInventory().CreateInInventory( "AviatorGlasses" );
        /* Spawn a rifle and attach items while it is still set as var itemEnt - Still cannot figure out how to attach mags */
        /* Thanks to NoBeansForMe for his input that led me to this solution - https://forums.dayz.com/topic/251863-qs-about-ports-and-mods-start-gear-solution */
        itemEnt = player.GetInventory().CreateInInventory( "M4A1_Black" );
        itemEnt.GetInventory().CreateInInventory( "M4_MPBttstck" );
        itemEnt.GetInventory().CreateInInventory( "M4_RISHndgrd" );
        itemEnt.GetInventory().CreateInInventory( "M4_Suppressor" );
        itemEnt.GetInventory().CreateInInventory( "ACOGOptic_6x" );
        itemEnt.GetInventory().CreateInInventory( "UniversalLight" );
        itemEnt.GetInventory().CreateInInventory( "Battery9V" );
        itemEnt = player.GetInventory().CreateInInventory( "FirefighterAxe_Black" );
        


        /* Set item to fill as 'vest' and spawn Buttpack and other items*/
        itemFill = player.FindAttachmentBySlotName( "Vest" )
        if ( itemFill )
            {
                /* Buttpack and grenades will automatically spawn attached to the vest if possible */
                itemEnt = itemFill.GetInventory().CreateInInventory( "SmershBag" );
                itemEnt = itemFill.GetInventory().CreateInInventory( "M18SmokeGrenade_White" );
                
                /* Non-attachable items are spawned inside, starting with the vest and then the buttback if available */
                itemEnt = itemFill.GetInventory().CreateInInventory( "Mag_CMAG_30Rnd" );
                itemEnt = itemFill.GetInventory().CreateInInventory( "Mag_CMAG_30Rnd" );
                itemEnt = itemFill.GetInventory().CreateInInventory( "Mag_CMAG_30Rnd" );
                itemEnt = itemFill.GetInventory().CreateInInventory( "Mag_Deagle_9rnd" );
                itemEnt = itemFill.GetInventory().CreateInInventory( "Mag_Deagle_9rnd" );
                itemEnt = itemFill.GetInventory().CreateInInventory( "Ammo_556x45" );
                itemEnt = itemFill.GetInventory().CreateInInventory( "Ammo_357" );            
            }


        /* Set belt as item to fill and attach canteen, holster and sheath to belt */
        itemFill = player.FindAttachmentBySlotName( "Hips" )
        
        /* Spawn attachments first */
        /* You can spawn knife and pistol as long as you spawn sheath and/or holster FIRST */
        if ( itemFill )
            {
                itemEnt = itemFill.GetInventory().CreateInInventory( "Canteen" );
                itemEnt = itemFill.GetInventory().CreateInInventory( "PlateCarrierHolster" );
                itemEnt = itemFill.GetInventory().CreateInInventory( "NylonKnifeSheath" );
                
                /* Finally spawn non-attatchable items and attach items while sidearm is still set as var itemEnt */
                itemEnt = itemFill.GetInventory().CreateInInventory( "FangeKnife" );
                itemEnt = itemFill.GetInventory().CreateInInventory( "Deagle_Gold" );
                itemEnt.GetInventory().CreateInInventory( "PistolSuppressor" );
                itemEnt.GetInventory().CreateInInventory( "PistolOptic" );            
            }
    


        /* Set item to fill as boots and put a knife in if possible */
        itemFill = player.FindAttachmentBySlotName( "Feet" )
        if ( itemFill )
            {
                itemEnt = itemFill.GetInventory().CreateInInventory( "CombatKnife" );
            }

        /* Set item to fill as 'body' in order to spawn items in jacket */
        itemFill = player.FindAttachmentBySlotName("Body")

        /* Spawn items in jacket */
        if ( itemFill )
            {
                itemEnt = itemFill.GetInventory().CreateInInventory( "SodaCan_Cola" );
            }

        /* Set item to fill as 'legs' in order to spawn items in pants */
        itemFill = player.FindAttachmentBySlotName( "Legs" )

        /* Spawn items in pants*/
        /* I chose to spawn some items related to survival here */
        if ( itemFill )
            {
                itemEnt = itemFill.GetInventory().CreateInInventory( "CanOpener" );
                itemEnt = itemFill.GetInventory().CreateInInventory( "TacticalBaconCan" );
                itemEnt = itemFill.GetInventory().CreateInInventory( "SodaCan_Cola" );
                itemEnt = itemFill.GetInventory().CreateInInventory( "Compass" );
                itemEnt = itemFill.GetInventory().CreateInInventory( "BandageDressing" );
                itemEnt = itemFill.GetInventory().CreateInInventory( "Battery9V" );
                itemEnt = itemFill.GetInventory().CreateInInventory( "Battery9V" );
                itemEnt = itemFill.GetInventory().CreateInInventory( "PetrolLighter" );
                itemEnt = itemFill.GetInventory().CreateInInventory( "VitaminBottle" );
                itemEnt = itemFill.GetInventory().CreateInInventory( "PurificationTablets" );
                itemEnt = itemFill.GetInventory().CreateInInventory( "TetracyclineAntibiotics" );            
            }

        /* Spawn rest of items in backpack  */
        /* Cannot find the "Backpack" slot, but it works when var itemEnt is set to player.GetInventory() instead of itemFill.GetInventory() */
        /* I assume it works since the backpack is the first thing, with available space, spawned on the player */
        
        itemEnt = player.GetInventory().CreateInInventory( "NVGoggles" );
        itemEnt = player.GetInventory().CreateInInventory( "NVGHeadstrap" );
        itemEnt = player.GetInventory().CreateInInventory( "StarlightOptic" );
    }

 

I bet you could even cut the code down by using lists and for x in y to populate slots, but C isn't my strong side.

Question [SOLVED]:
Is there any way to dictate who gets what starting equipment?
Maybe through an 'if player ID=xxx' check?
 

(Ed.) Exactly this can be done. Solution in post below


Thanks for your time - indij

Edited by indijdev
Updated init - problem solved
  • Beans 1

Share this post


Link to post
Share on other sites

Problem 1:
I haven't set my server to listen to any specific port in serverDZ.cfg, so it listens to the default ones, which seems to be port 2302, 2304, and 27016 UDP (I don't know what 56090 TCP is for, but you don't seem to have to port forward to this port), which is also the only ports I have port forwarded in my router to my internal IP, and it works fine.
SUCCESS: SteamGameServer_Init(0,8766,2302,27016,3,1.15.154337). I suppose your ports should work too if defined in serverDZ.cfg and port forwarded correctly. I have never tried with other ports than the default ones.

This is what it looks like in TCPView:
YohYORC.png

You don't need a static IP for this, dynamic works fine too (mine is). It needs to be public though, and not behind some kind of NAT by your ISP that blocks incoming connections. You don't need any Steam API Key for this either. 
In order for you to be able to connect to your own DayZ server using your public IP your router needs to support NAT hairpinning, also known as NAT loopback or NAT reflection. This is not needed for others to be able to connect to it though, only for devices behind the same NAT device trying to connect to each other using the public IP. This however probably won't let you know if there is some blockage further up the line, like from your ISP.

I don't think you have to worry about BattlEye needing a port forward unless you run an external BattlEye service like battlemetrics.com or similar needing to be able to connect to your server to monitor it. But that shouldn't have anything to do with your server not showing up in the community tab.

 

Problem 2:
Unless you are running some kind of managing application for your DayZ server the mods you want needs to be manually copied to a place your DayZ server has access to. It's common server owners just place them in the same folder as the server is installed.
r3I0h1A.png

Like you said, these mod folders are located in the games mod folder (steamapps\common\DayZ\!Workshop) and needs to be copied manually to where the server loads them. These mods need to be manually updated every time a new version of a mod is released. There are manager software (like OmegaManager) and batch scripts that can automatically keep these mods up to date, but I have never used any of them. I run my test DayZ server on the same computer I run the game, so I have just mapped W: to my games workshop folder and add them like this "-mod=W:\@CF;W:\@Community-Online-Tools" so the server uses the same copies as the game. But that might not be applicable to your setup.

Then you just start up your server with a batch script looking like this:

start DayZServer_x64.exe -config=serverDZ.cfg "-mod=@CF;@Community-Online-Tools;@VPPAdminTools;@VPPNotifications" -profiles=ServerProfile_1 -adminlog

This is just an example though, and as basic as they come. There are way more complicated batch files that do all kinds of stuff. If no path is provided to the "-mod" parameter it looks in the servers root folder. That's why many admins keep the mods there so they don't have to provide a path for every mod they want to add (on my personal setup I have to add W: but that's manageable).

I'm not sure you need the game installed on the server in order to download game specific mods directly to it (you don't need it to run the server though, that's for sure). Personally I'd just share a folder on your server and then copy the mods you want from your workstation to there. I'd probably just share the entire DayZ server folder on your local LAN for easy access and manageability. 

When you say "My server doesn't have any @<MODNAME> folders, only a lot of .pbo files." I suspect you mean the PBO files inside the servers "addons" folder. You don't install mods in this folder (except for some helicopter mods I know of needing a server PBO installed here, but that's unusual). You probably don't need to do anything with this folder.

 

Problem 3:
Here is code for setting the starting gear depending on the SteamID of the player:

	override void StartingEquipSetup(PlayerBase player, bool clothesChosen)
	{
		player.RemoveAllItems();

		private EntityAI clothesJacket;
		private EntityAI clothesPants;
		private EntityAI utilitiesRangefinder;

		string steamID = player.GetIdentity().GetPlainId();

		if (steamID == "76561100000000001")
		{
			// Jacket
			clothesJacket = player.GetInventory().CreateInInventory("HikingJacket_Red");
			clothesJacket.GetInventory().CreateInInventory("Rag");
			clothesJacket.GetInventory().CreateInInventory("Rag");
			clothesJacket.GetInventory().CreateInInventory("SewingKit");
			clothesJacket.GetInventory().CreateInInventory("LeatherSewingKit");
			utilitiesRangefinder = clothesJacket.GetInventory().CreateInInventory("Rangefinder");
			utilitiesRangefinder.GetInventory().CreateAttachment("Battery9V");

			// Pants
			clothesPants = player.GetInventory().CreateInInventory("TrackSuitPants_Red");
			clothesPants.GetInventory().CreateInInventory("Mag_Glock_15Rnd");
			clothesPants.GetInventory().CreateInInventory("Ammo_762x54");
		}
		else if (steamID == "76561100000000002")
		{
			// Jacket
			clothesJacket = player.GetInventory().CreateInInventory("HikingJacket_Green");
			clothesJacket.GetInventory().CreateInInventory("Rag");
			clothesJacket.GetInventory().CreateInInventory("Rag");
			clothesJacket.GetInventory().CreateInInventory("SewingKit");
			clothesJacket.GetInventory().CreateInInventory("LeatherSewingKit");
			utilitiesRangefinder = clothesJacket.GetInventory().CreateInInventory("Rangefinder");
			utilitiesRangefinder.GetInventory().CreateAttachment("Battery9V");

			// Pants
			clothesPants = player.GetInventory().CreateInInventory("TrackSuitPants_Green");
			clothesPants.GetInventory().CreateInInventory("Mag_Glock_15Rnd");
			clothesPants.GetInventory().CreateInInventory("Ammo_762x54");
		}
		else
		{
			// Jacket
			clothesJacket = player.GetInventory().CreateInInventory("HikingJacket_Blue");
			clothesJacket.GetInventory().CreateInInventory("Rag");
			clothesJacket.GetInventory().CreateInInventory("Rag");
			clothesJacket.GetInventory().CreateInInventory("SewingKit");
			clothesJacket.GetInventory().CreateInInventory("LeatherSewingKit");
			utilitiesRangefinder = clothesJacket.GetInventory().CreateInInventory("Rangefinder");
			utilitiesRangefinder.GetInventory().CreateAttachment("Battery9V");

			// Pants
			clothesPants = player.GetInventory().CreateInInventory("TrackSuitPants_Blue");
			clothesPants.GetInventory().CreateInInventory("Mag_Glock_15Rnd");
			clothesPants.GetInventory().CreateInInventory("Ammo_762x54");
		}
	}

The first two if-statements set the starting gear for those specific SteamID:s. If the player joining has none of them that player will be given the setup in the last else-statement.
Personally I'd move all the code to external files, since I don't want init.c to get huge. I've got code for this as well, but this will at least get you started.

  • Thanks 2

Share this post


Link to post
Share on other sites

Thanks for you time, I appreciate it.

1.
I don't know why 2305 is set as queryport and not 27015/27016, but I will try to look at the configs and check my connections with TCPView. (Funny. I've been using Process Explorer for years, but never knew about TCPView. Both are sysinternals)

I'll also read up on hairpinning and try to configure my router if possible. ISP NAT *shouldn't* be the problem in this case.


2.
I do indeed mean the pbo's in the addons folder.
Thanks for explaining, makes much more sense to me now. I will try to copy the folders manually and configure the start.bat accordingly.


3.
Perfection! That's exactly what I meant. My aim is to let playes spawn with gear according to rank earned with one of 3 'NPC' factions.
After looking at the 'dogtags' mod, I've come to realize that init does more than I thought, so I see what you mean about the file getting bloated.
It also seems that my solution could be improved somewhat. Lots to learn, work to do.


Thanks again. The troubleshooting will continue.

- indij

  • Beans 1

Share this post


Link to post
Share on other sites
18 hours ago, indijdev said:


3.
Perfection! That's exactly what I meant. My aim is to let playes spawn with gear according to rank earned with one of 3 'NPC' factions.

If you are going to be dealing with a lot of SteamID:s it might be easier to have a text file for each rank and just put the SteamID:s in those.

Here is a code that reads the content of the files Rank1.txt and Rank2.txt in a folder called "StartupGear" in your servers profile folder. Just create that folder and those two files and put in the SteamID:s of the players you want to belong to each rank.

	override void StartingEquipSetup(PlayerBase player, bool clothesChosen)
	{
		player.RemoveAllItems();

		private EntityAI clothesJacket;
		private EntityAI clothesPants;
		private EntityAI utilitiesRangefinder;

		string rank1File = "$profile:StartupGear/Rank1.txt";
		string rank2File = "$profile:StartupGear/Rank2.txt";

		string steamID = player.GetIdentity().GetPlainId();

		if (IsOnList(rank1File, steamID))
		{
			// Jacket
			clothesJacket = player.GetInventory().CreateInInventory("HikingJacket_Red");
			clothesJacket.GetInventory().CreateInInventory("Rag");
			clothesJacket.GetInventory().CreateInInventory("Rag");
			clothesJacket.GetInventory().CreateInInventory("SewingKit");
			clothesJacket.GetInventory().CreateInInventory("LeatherSewingKit");
			utilitiesRangefinder = clothesJacket.GetInventory().CreateInInventory("Rangefinder");
			utilitiesRangefinder.GetInventory().CreateAttachment("Battery9V");

			// Pants
			clothesPants = player.GetInventory().CreateInInventory("TrackSuitPants_Red");
			clothesPants.GetInventory().CreateInInventory("Mag_Glock_15Rnd");
			clothesPants.GetInventory().CreateInInventory("Ammo_762x54");
		}
		else if (IsOnList(rank2File, steamID))
		{
			// Jacket
			clothesJacket = player.GetInventory().CreateInInventory("HikingJacket_Green");
			clothesJacket.GetInventory().CreateInInventory("Rag");
			clothesJacket.GetInventory().CreateInInventory("Rag");
			clothesJacket.GetInventory().CreateInInventory("SewingKit");
			clothesJacket.GetInventory().CreateInInventory("LeatherSewingKit");
			utilitiesRangefinder = clothesJacket.GetInventory().CreateInInventory("Rangefinder");
			utilitiesRangefinder.GetInventory().CreateAttachment("Battery9V");

			// Pants
			clothesPants = player.GetInventory().CreateInInventory("TrackSuitPants_Green");
			clothesPants.GetInventory().CreateInInventory("Mag_Glock_15Rnd");
			clothesPants.GetInventory().CreateInInventory("Ammo_762x54");
		}
		else
		{
			// Jacket
			clothesJacket = player.GetInventory().CreateInInventory("HikingJacket_Blue");
			clothesJacket.GetInventory().CreateInInventory("Rag");
			clothesJacket.GetInventory().CreateInInventory("Rag");
			clothesJacket.GetInventory().CreateInInventory("SewingKit");
			clothesJacket.GetInventory().CreateInInventory("LeatherSewingKit");
			utilitiesRangefinder = clothesJacket.GetInventory().CreateInInventory("Rangefinder");
			utilitiesRangefinder.GetInventory().CreateAttachment("Battery9V");

			// Pants
			clothesPants = player.GetInventory().CreateInInventory("TrackSuitPants_Blue");
			clothesPants.GetInventory().CreateInInventory("Mag_Glock_15Rnd");
			clothesPants.GetInventory().CreateInInventory("Ammo_762x54");
		}
	}

	bool IsOnList(string listFileName, string steamID)
	{
		TStringArray listContent = new TStringArray;
		listContent = ReadList(listFileName);

		for (int i = 0; i < listContent.Count(); ++i)
		{
			if (steamID == listContent[i])
				return true;
		}

		return false;
	}

	TStringArray ReadList(string listFileName)
	{
		TStringArray listContent = new TStringArray;
		FileHandle fileHandle = OpenFile(listFileName, FileMode.READ);

		if (fileHandle != 0)
		{
			string currentLine;
			while (FGets(fileHandle, currentLine) > 0)
			{
				int endOfFirstWord = currentLine.IndexOf("\t");
				if (endOfFirstWord == -1)
					endOfFirstWord = currentLine.IndexOf(" ");
				if (endOfFirstWord == -1)
					endOfFirstWord = currentLine.Length();

				string firstWord = currentLine.Substring(0, endOfFirstWord);
				listContent.Insert(firstWord);
			}
		}
		else
		{
			Print("StartupGear: Error: The file " + listFileName + " couldn't be opened.");
		}

		CloseFile(fileHandle);
		return listContent;
	}

 

If you don't have a profile folder or know how to create one here is how. You just define it in the startup parameters of the server. I think you manually have to create this folder unless it already exists.

WlT8UPS.png

Don't mind the mismatch between the mods in the folder and the mods on the startup command. I just mixed the screenshots up as an example.
Then create the folder "StartupGear" in that folder, and the two rank-files mentioned above. You can of course call this folder and files whatever you want, as long as you modify the code accordingly. You don't have to modify any code in the methods "IsOnList" and "ReadList". Then just add one SteamID per line. Only the first word of each line is read, which should be the SteamID, so you can put whatever you want after, like a comment who the SteamID belongs to:

76561100000000001      DayZLegend1
76561100000000002      Some other guy
76561100000000003      I don't know this guy but he had a cool hat.

If you want more ranks, just duplicate the files, variables and if-statements accordingly.

Also, here is code for a fully geared player, if you need inspiration on how to create and attach stuff:

	override void StartingEquipSetup(PlayerBase player, bool clothesChosen)
	{
		player.RemoveAllItems();

		// Helmet
		player.GetInventory().CreateInInventory("BallisticHelmet_Green");

		// Jacket
		private EntityAI clothesJacket;
		clothesJacket = player.GetInventory().CreateInInventory("BDUJacket");
		clothesJacket.GetInventory().CreateInInventory("Rag");
		clothesJacket.GetInventory().CreateInInventory("Rag");
		clothesJacket.GetInventory().CreateInInventory("SewingKit");
		clothesJacket.GetInventory().CreateInInventory("LeatherSewingKit");
		private EntityAI utilitiesRangefinder;
		utilitiesRangefinder = clothesJacket.GetInventory().CreateInInventory("Rangefinder");
		utilitiesRangefinder.GetInventory().CreateAttachment("Battery9V");	
		
		// First Aid Kit
		private EntityAI firstAidKit;
		firstAidKit = clothesJacket.GetInventory().CreateInInventory("FirstAidKit");
		firstAidKit.GetInventory().CreateInInventory("BandageDressing");
		firstAidKit.GetInventory().CreateInInventory("SalineBagIV");
		firstAidKit.GetInventory().CreateInInventory("Epinephrine");
		firstAidKit.GetInventory().CreateInInventory("BloodTestKit");

		// Gloves
		player.GetInventory().CreateInInventory("TacticalGloves_Green");
		
		// Pants
		private EntityAI clothesPants;
		clothesPants = player.GetInventory().CreateInInventory("BDUPants");
		clothesPants.GetInventory().CreateInInventory("Mag_Glock_15Rnd");
		clothesPants.GetInventory().CreateInInventory("Ammo_762x54");
		
		// Belt
		private EntityAI clothesBelt;
		clothesBelt = player.GetInventory().CreateInInventory("MilitaryBelt");

		// Belt - Holster
		private EntityAI clothesHolster;
		clothesHolster = clothesBelt.GetInventory().CreateInInventory("PlateCarrierHolster");
		private EntityAI weapon2;
		weapon2 = clothesHolster.GetInventory().CreateInInventory("Glock19");
		private EntityAI weapon2Optic;
		weapon2Optic = weapon2.GetInventory().CreateAttachment("FNP45_MRDSOptic");
		weapon2Optic.GetInventory().CreateAttachment("Battery9V");
		private EntityAI weapon2Light;
		weapon2Light = weapon2.GetInventory().CreateAttachment("TLRLight");
		weapon2Light.GetInventory().CreateAttachment("Battery9V");

		// Boots
		private EntityAI clothesBoots;
		clothesBoots = player.GetInventory().CreateInInventory("MilitaryBoots_Black");
		private EntityAI utilitiesCombatKnife;
		utilitiesCombatKnife = clothesBoots.GetInventory().CreateInInventory("CombatKnife");
		
		// Backpack
		private EntityAI utilitiesBackpack;
		utilitiesBackpack = player.GetInventory().CreateInInventory("AliceBag_Camo");
		utilitiesBackpack.GetInventory().CreateInInventory("Mag_STANAG_30Rnd");

		// Weapon 1 - M4-A1
		private EntityAI weapon1;
		weapon1 = player.GetHumanInventory().CreateInHands("M4A1");
		weapon1.GetInventory().CreateAttachment("M4_OEBttstck");
		weapon1.GetInventory().CreateAttachment("ACOGOptic");
		weapon1.GetInventory().CreateAttachment("M4_RISHndgrd");
		private EntityAI weapon1Light;
		weapon1Light = weapon1.GetInventory().CreateAttachment("UniversalLight");
		//weapon1Light.GetInventory().CreateAttachment("Battery9V");

		// Weapon 3 - Mosin9130
		private EntityAI weapon3;
		weapon3 = player.GetInventory().CreateInInventory("Mosin9130");
		weapon3.GetInventory().CreateAttachment("PUScopeOptic");
		
		// Quickbar
		player.SetQuickBarEntityShortcut(weapon1, 0);
		player.SetQuickBarEntityShortcut(weapon2, 1);
		player.SetQuickBarEntityShortcut(weapon3, 2);
		player.SetQuickBarEntityShortcut(utilitiesCombatKnife, 5);
		player.SetQuickBarEntityShortcut(utilitiesRangefinder, 6);
	}

It's slightly different from the other code I pasted in the previous post as the "EntityAI" variables aren't all defined at the top, but rather down in the code as they are needed by each clothing item.

The //Quickbar thingie at the bottom of the code just presets what's in the players quickbar and you might want to remove that part since most players probably has their own idea on how to organize that. I just put it there so you know it can be done.

Edited by NoBeansForMe
  • Thanks 2

Share this post


Link to post
Share on other sites

Update:

Still trying to sort out network issues.
Queryport is 2305 due to this line in serverDZ.cfg:
"steamQueryPort = 2305;  // defines Steam query port, should fix the issue with server not being visible in client server browser"
Don't know where I copied that from, but it obviously didn't fix the issue in my case.
Troubleshooting continues.


I think I understand 98% of your code. Texthandling looks more complicated than most languages I've encountered, but in retrospect, I should've known that.
Will test it once I have some other issues sorted, it's much appreciated.
Had some issues with the 'profiles' parameter. Started 1st time without defining the par and then I couldn't boot the server with the new folder I created. Turns out I had put the parameter in "" because I mixed up the usecases, problem solved.

The quickbar part will be very useful to me. Never figured out how to log in as admin.
I need to suicide when testing respawn, so it'll save some time.

Spent a good few hours making a new start-zone in DayZ Editor only for it to crash when I was about to save.
Might take the night off.


- indij

Edited by indijdev
speleleling
  • Beans 1

Share this post


Link to post
Share on other sites
4 hours ago, indijdev said:

Update:

Still trying to sort out network issues.
Queryport is 2305 due to this line in serverDZ.cfg:
"steamQueryPort = 2305;  // defines Steam query port, should fix the issue with server not being visible in client server browser"
Don't know where I copied that from, but it obviously didn't fix the issue in my case.
Troubleshooting continues.

 

So strange. I didn't have to do any of those things and it works fine with the default ports. Are you sure you have a public IP? Google "what's my IP" and it should tell you what IP you have facing the internet. Then log in to your router and see what IP it reports on the WAN interface. They should be the same. If they are I'm starting to suspect your ISP is blocking incoming connections.

Edited by NoBeansForMe
  • Thanks 2

Share this post


Link to post
Share on other sites

Seems like I was mistaken. My outwards IP (212.x.x.x) does not match the WAN IP (100.x.x.x) and it seems I'm on a 255.252.0.0 subnet.

(ed.) I am able to connect to the server using the WAN IP, so I guess that Win Defender and port forwarding are not the issue.

 

I'm awaiting mail from my ISP regarding a static IP.

 

Thx Beans.

-indij

 

Edited by indijdev
  • Beans 1

Share this post


Link to post
Share on other sites

Issue is resolved. My IP was not public, which I thought it was.

Thank you NoBeansForMe, without your help it would have taken me ages to pinpoint the problem.

I've been able to install a few mods without huge issues.

Also thanks for your input on the init files. As said, spawning startgear based on steamid works flawlessly and I'm about to test the rank-based solution.

 

Best regards.

-indij

Share this post


Link to post
Share on other sites

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now

×