Forums Announcement
Read-Only Mode for Announcements & Changelogs
Dear Survivors, we'd like to inform you that this forum will transition to read-only mode. From now on, it will serve exclusively as a platform for official announcements and changelogs.
For all community discussions, debates, and engagement, we encourage you to join us on our social media platforms: Discord, Twitter/X, Facebook.
Thank you for being a valued part of our community. We look forward to connecting with you on our other channels!
Stay safe out there,
Your DayZ Team
NoBeansForMe
Members-
Content Count
38 -
Joined
-
Last visited
Everything posted by NoBeansForMe
-
custom spawn gear with primary weapon and secondary weapon slots equiped
NoBeansForMe replied to StreetkillnHD's topic in Scripting
No, sorry, I haven't looked into it any more. -
You will need a mod in order to disable recipes. I don't know how much you know about modding, but in order to make a mod that disables recipes you will need two files: 1. Create a folder called DisableRecipes 2. In this folder you create a file called "Config.cpp". This file is basically just a description of your mod and what it requires. 3. Put this into that file: class CfgPatches { class DisableRecipies { units[] = {}; weapons[] = {}; requiredVersion = 0.1; requiredAddons[] = { }; }; }; class CfgMods { class DisableRecipies { dir = "DisableRecipies"; name = "DisableRecipies"; type = "mod"; dependencies[] = {"World"}; class defs { class worldScriptModule { value = ""; files[] = {"DisableRecipies/4_World"}; }; }; }; }; 4. In the same folder as the Config.cpp file is located in you create a new folder called "4_World" 5. Go into that folder and create a file called "DisableRecipies.c" (this file can be called whatever though, just an example). This is the file that does the actual disabling of recipes. 6. Put this into that file: modded class PluginRecipesManager { override void RegisterRecipies() { super.RegisterRecipies(); UnregisterRecipe("CraftWoodenCrate"); } } 7. Then you use DayZ Tools "DS Utils" to create a key for the mod and then "Addon Builder" to build the mod and finally "Publisher" to upload it to your Steam Workshop. If you want to disable more recipes you can find all the vanilla recipes in the file "E:\DayZPDrive\scripts\4_world\classes\recipes\recipes\pluginrecipesmanagerbase.c" or wherever you extracted your game files in DayZ Tools, and then just add a new line for each recipe you want to disable below the line "UnregisterRecipe("CraftWoodenCrate"); like: UnregisterRecipe("CraftTorch"); UnregisterRecipe("CraftFireplace"); Etc You can disable recipes from other peoples mods as well this way, you just need to make sure they are loaded first by adding their names to the "requiredAddons" section in the Config.cpp file above. You need to find that out from their own Config.cpp files which can be extracted using PBO Manager (https://github.com/winseros/pboman3). That file most likely also need to be unbinarized to be more easely read using the tool "CfgConvert.exe" that comes with DayZ Tools like "CfgConvert.exe -txt -dst C:\Temp\config.cpp C:\Temp\config.bin" but thats a whole other can of worms that can be opened depending on how much work you want to put into it. Then you need to find the name of their recipes as well, so you are going to need to dig into the code of the other files in the mod. I know this requires some knowledge in mod making, but there are tutorials on youtube that covers this.
- 1 reply
-
- 2
-
-
as a server owner, how do i find out territory flag pole owners?
NoBeansForMe replied to DarthYodaSoda's topic in Scripting
Yeah, it's serverside. -
as a server owner, how do i find out territory flag pole owners?
NoBeansForMe replied to DarthYodaSoda's topic in Scripting
Yeah, that sounds like it could be it. Is it "Instant Flag" at https://steamcommunity.com/sharedfiles/filedetails/?id=2812309047 you are using? Edit: I tried it and when used it doesn't get logged to the ADM file when someone places a flag pole. I made a mod called "LogFlagPolePlacement" that logs flag pole placements to a separate log file in your server's profile folder. You can get it here if you want to try it: https://steamcommunity.com/sharedfiles/filedetails/?id=2988841676 I noticed you get a crash log when you use the "Instant Flag" mod mentioned above (the game and server doesn't go down though). You get that crash log regardless if you use my mod combined with it or not, so it's not my mods fault even though it is mentioned in the crash log as well if you run them both. -
as a server owner, how do i find out territory flag pole owners?
NoBeansForMe replied to DarthYodaSoda's topic in Scripting
Strange. This is what I get when I log in with adminLogPlacement = 1; spawn a flag pole kit in vppadmintools, build it and raise the flag. ****************************************************************************** AdminLog started on 2023-06-12 at 17:14:33 17:15:26 | Player "TestNick" is connected (id=BYTFbvytfbTJVbtryVTRvbTHRCrhteVBChvretCTest=) 17:16:25 | Player "TestNick" (id=BYTFbvytfbTJVbtryVTRvbTHRCrhteVBChvretCTest= pos=<4647.5, 10338.1, 339.0>) placed Flag Pole Kit 17:16:49 | Player "TestNick" (id=BYTFbvytfbTJVbtryVTRvbTHRCrhteVBChvretCTest= pos=<4644.7, 10338, 339.6>) has raised Flag_Altis on TerritoryFlag at <4643.467773, 339.000000, 10338.107422> If I set adminLogPlacement = 0; and do the same procedure I get this: ****************************************************************************** AdminLog started on 2023-06-12 at 17:20:58 17:21:34 | Player "TestNick" is connected (id=BYTFbvytfbTJVbtryVTRvbTHRCrhteVBChvretCTest=) 17:22:42 | Player "TestNick" (id=BYTFbvytfbTJVbtryVTRvbTHRCrhteVBChvretCTest= pos=<4637.3, 10350.9, 339.0>) has raised Flag_Bohemia on TerritoryFlag at <4637.254883, 339.000000, 10352.299805> So are you sure you got adminLogPlacement = 1; cause that's seems to be the setting for logging flag pole kit placements. -
as a server owner, how do i find out territory flag pole owners?
NoBeansForMe replied to DarthYodaSoda's topic in Scripting
I missed one flag I've also set to 1 in my config: adminLogBuildActions = 1; I also start my server with the argument -adminlog. If none of these makes a different I don't know why it's not logging it. The log entry I posted above was me placing a flag pole kit on my test server and it logged it right away. -
as a server owner, how do i find out territory flag pole owners?
NoBeansForMe replied to DarthYodaSoda's topic in Scripting
Just check the servers ADM logfile in the profile folder. All placements of flag pole kits will be logged to it like this: 20:38:12 | Player "SomeDude" (id=UNHGukygNUgbN jBKIYTUiuHHmmMHTYGnyn= pos=<4658.0, 10323.2, 339.0>) placed Flag Pole Kit When I hosted a server I kept those files forever and when I needed to find something I just opened them all in Notepad++ and used "Find in all opened documents". Just search for "flag pole kit". If there have been a lot of flag pole kits placed on the server you will probably get a log of results, but since you know the coordinates of the one you are interested in you can probably find it. I don't know if there is a better way. Edit: You might need to set "adminLogPlacement = 1;" in the serverDZ.cfg in order for it to log those actions if you haven't already. I don't think it's there by default. If not, then it's not logged who placed that flag pole and I'm not sure it's possible to find out who owns it. -
custom spawn gear with primary weapon and secondary weapon slots equiped
NoBeansForMe replied to StreetkillnHD's topic in Scripting
The code below works for me. I don't have to specify they should be placed on the back of the player, they just do anyways. Put it in the init.c class CustomMission: MissionServer { // Vanilla code override void StartingEquipSetup(PlayerBase player, bool clothesChosen) { // Vanilla code // M4 private Weapon_Base weapon1; weapon1 = player.GetInventory().CreateInInventory("M4A1"); weapon1.GetInventory().CreateAttachment("M4_OEBttstck"); weapon1.GetInventory().CreateAttachment("M4_RISHndgrd"); weapon1.GetInventory().CreateAttachment("ACOGOptic"); weapon1.GetInventory().CreateAttachment("Mag_STANAG_30Rnd"); ChaimberWeapon(weapon1); // AKM private Weapon_Base weapon2; weapon2 = player.GetInventory().CreateInInventory("AKM"); weapon2.GetInventory().CreateAttachment("AK_WoodBttstck_Black"); weapon2.GetInventory().CreateAttachment("AK_RailHndgrd_Black"); weapon2.GetInventory().CreateAttachment("PSO11Optic"); weapon2.GetInventory().CreateAttachment("Mag_AKM_30Rnd"); ChaimberWeapon(weapon2); } // Put a round in the chaimber of the weapon. void ChaimberWeapon(Weapon_Base weapon) { int muzzleIndex = weapon.GetCurrentMuzzle(); float ammoDamage; string ammoTypeName; Magazine magazine = weapon.GetMagazine(muzzleIndex); magazine.LocalAcquireCartridge(ammoDamage, ammoTypeName); weapon.PushCartridgeToChamber(muzzleIndex, ammoDamage, ammoTypeName); } }; When you attach a magazine to the weapon this way it doesn't put a round in the chaimber, so I made a method for that. For some reason the first shot will click, but the second and following rounds will fire as normal. I don't know why that is. If you don't want a round to be put in the chaimber, but rather the player has to do it themself by clicking "R", just remove that function and the calls to it. Also, the magazine will only be visible in the attachment slots for the weapon until the first round is fired or the weapon is placed on the ground and picked up again. Everywhere else it will look like the weapon doesn't have a magazine (but it does). But after having done either of those two manouvers the magazine will be visible everywhere. I don't know why that is either. I'm guessing some more code is needed when attaching a magazine to make it work properly, but I haven't figured out what that is and I'm too lazy to dig into it any further. -
in init.c: override void StartingEquipSetup(PlayerBase player, bool clothesChosen) { // Default vanilla code here. // Set the energy and water level here to whatever you want. player.GetStatEnergy().Set(5000); player.GetStatWater().Set(5000); }
-
You have to port forward those three ports, 2302, 2304 and 27016, in your router (from the WAN IP) to the IP address of the computer that is hosting the DayZ server. If you don't specify any specific port in the serverDZ.cfg file the server should open and listen on those three ports. If you need to use other ports then you need to port forward those ports instead. If you are running a firewall on the computer hosting the DayZ server you need to open up those three ports as well.
-
You need to port forward these ports: 2302 UDP 2304 UDP 27016 UDP
-
DayZ Tools and windows update
NoBeansForMe replied to Gunny-e174dd68292a73e3's topic in General Discussion
They seem to have fixed it now. I'm no longer limited only to my desktop. I can browse my entire computer. Yay. -
DayZ Tools and windows update
NoBeansForMe replied to Gunny-e174dd68292a73e3's topic in General Discussion
I have the same problem with some type of file requesters in DayZ Tools. For example when selecting the source directory and the destination directory in the Addon Builder only my desktop is shown as the root directory and I can't browse to beyond it. I have to copy the path from my file explorer and paste it into the input field of the path to get anything done. It's annoying. However, for other file requesters this doesn't happen, for example when browsing for the key to sign the PBO. That works just fine, but it's another kind of file requester for some reason. A solution to this is to disable OneDrive's sync of the desktop. If I do that, then this problem doesn't appear. However, I need to have sync enabled so I gotto live with it. -
There seems to be missing a \ between "Mods" and "@FirstMod" in your path to the mods. Unless you named the mod "Mods@FirstMod" for some reason.
-
How to get player head orientation on server side?
NoBeansForMe replied to abrakadobr's topic in Scripting
I took a quick look at the source code of the mod SchanaModCompass where the compass updates no matter if you turn your entire body or just your head. I found this method which returns the angel the camera is looking at. Not sure if that's what you are looking for but here it is anyways. float SchanaGetAngle () { vector direction = GetGame ().GetCurrentCameraDirection (); float angle = direction.VectorToAngles () [0]; return angle; } -
Is there a keypress event on the server side?
NoBeansForMe replied to steam-76561198077052895's topic in Scripting
Sure, but it's a bit lengthy to explain how. I made a mod that spawns a helicopter when the player presses "H" on the keyboard. Download the mod (HelicopterSpawn) which includes the source code if you want to take a look: https://steamcommunity.com/sharedfiles/filedetails/?id=2660530150 -
One reference to GetGame().Chat() I found in the DayZ Tools scripts was this: /** \brief Prints text into game chat. \param text to print \param colorClass ?? \n usage : @code GetGame().Chat("Item splitted", "colorAction"); @endcode */ I also found this function and a call to it: Message( text, "colorAction" ); void Message( string text, string style ) { if (GetInstanceType() == DayZPlayerInstanceType.INSTANCETYPE_SERVER) { GetGame().ChatMP(this, text, style ); } else { GetGame().Chat( text, style ); } } The call wasn't just above the function in the document I found them in, I just put them together for better visibility. So basically the other argument seems to be a string type that says "colorAction". I have no idea what it does and what else can be put there. So maybe this would work? GetGame().Chat("Someone woke up, sleeping canceled.", "colorAction"); If that doesn't work, this is how I send a message to a player in my mods: SendMessageToPlayer(player, "Someone woke up, sleeping canceled."); void SendMessageToPlayer(PlayerBase player, string message) { Param1<string> param = new Param1<string>(message); GetGame().RPCSingleParam(player, ERPCs.RPC_USER_ACTION_MESSAGE, param, true, player.GetIdentity()); }
-
Qs about ports and mods + Start gear solution [SOLVED]
NoBeansForMe replied to indijdev's topic in Servers
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. -
Qs about ports and mods + Start gear solution [SOLVED]
NoBeansForMe replied to indijdev's topic in Servers
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. 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. -
Qs about ports and mods + Start gear solution [SOLVED]
NoBeansForMe replied to indijdev's topic in Servers
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: 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. 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. -
If you need the Y-coordinate (height) in a scripting environment you can get it using GetGame().SurfaceY() float coordinateX = 7500; float coordinateZ = 7500; float coordinateY = GetGame().SurfaceY(coordinateX, coordinateZ); It's a bit cumbersome though, I suppose. Getting the X and Z from iZurvive, then edit and execute the script to get the Y-coordinate. I suppose if you have a text file with all the X/Z coordinates on one line each you could have a script run trough it and add the Y-coordinate. Other than that, I don't know.
-
Spawn Player With Low hunger, thirst and health.
NoBeansForMe replied to YeeAmFam's topic in Scripting
class CustomMission: MissionServer { override void InvokeOnConnect(PlayerBase player, PlayerIdentity identity) { super.InvokeOnConnect(player, identity); player.GetStatEnergy().Set(1); player.GetStatWater().Set(1); } }; There is a modding Discord around (probably not official though), but unfortunately I don't have the address to it. -
This code works for me: class CustomMission: MissionServer { // Default code for this class goes here. Put the code below at the bottom of this class. // Teleport player to a specified coordinate on connect depending on the SteamID - Code start override void InvokeOnConnect(PlayerBase player, PlayerIdentity identity) { super.InvokeOnConnect(player, identity); // Define the X and Z coordinates below where the player(s) will spawn when they connect. float xCoordinate = 4661; float zCoordinate = 10330; // Enter the SteamID or the BI-UID for the player(s) you want to spawn at the above coordinates. // Separate with a comma if you have more than one player. ref TStringArray spawnPlayers = {"76561198000000001", "76561198000000002", "76561198000000003"}; // Check if the current player is on the above list. If so, make him/her spawn at the specified coordinates. for (int i = 0; i < spawnPlayers.Count(); ++i ) { if(player.GetIdentity().GetId() == spawnPlayers[i] || player.GetIdentity().GetPlainId() == spawnPlayers[i]) { float yCoordinate = GetGame().SurfaceY(xCoordinate, zCoordinate); vector spawnCoordinates = Vector(xCoordinate, yCoordinate, zCoordinate); player.SetPosition(spawnCoordinates); break; } } } // Teleport player to a specified coordinate on connect depending on the SteamID - Code end }; This will apply to respawns as well. If a player with a matching SteamID dies he/she will respawn at the given coordinates. I haven't tried the code with multiple Steam ID's, but it should work.
-
The first problem, "Could not connect to BE Master" is a really old problem. I've had it myself occasionally when I ran a DayZ server a while back and a quick search shows people having this issues as far back as 2007. Consensus seems to be BattlEye is having server issues and it's not much you can do but wait until they have resolved it. Give it some time and check the logs again and see if it can connect. As for CFTools not being able to connect to your server, I don't know, I've never used them myself. If it is an RCON service they provide they usually require you to specify the IP and port to your DayZ server for them to connect to, which should have been provided to you by your hosting company. If I'm not mistaken it's called something like the RCON query port or similar. If this is the case, all I can think of is that this information is incorrectly added, or you have to open ports for the connection in your firewall, like THEGordonFreeman said.
-
I can see a couple of problems: 1. In the file init.c, on line 45, it says "Place_Trash(); // Your function with trash.", but there is no such function. I don't know if this is supposed to call the function for placing the buildings, but if so, it has to be called the same as the function in buildings.c on line 23. Rename it to, for example, "AddBuildings()" 2. In the file building.c, on line 23, the function containing all the building objects and coordinates is called "main()". There already is a function called "main()" in the file init.c. You can't have two functions with the same name. Rename it AddBuildings() so it gets called by the line in step 1 above. 3. In the file building.c, on line 24, it says "void main()" again. Remove that line. 4. In the file building.c, on line 25 (line 24 if you removed the line in step 3), the curly bracket is turned the wrong way. It should be } and not { Hope it works.