Setting up Custom Loadout: Difference between revisions

From Survival Servers
Jump to navigation Jump to search
StevenW (talk | contribs)
[wiki:wiki-operator] Reworded to the house writing rules; facts that were wrong today corrected (approved by Ryan, Nov 17)
 
(5 intermediate revisions by 2 users not shown)
Line 1: Line 1:
{{#seo:|title=DayZ Custom Loadout: Set Starting Gear for New Players|description=Give new DayZ characters custom starting gear: edit StartingEquipSetup in your map's init.c with item class names, save and start the server.}}
== Setting up a custom loadout ==
== Setting up a custom loadout ==


Before we proceed with setting up custom loadouts. You will want to first head to the following area for the classnames <br>
First, get the item class names from this list: <br>
https://github.com/ravmustang/DayZ_SA_ClassName_Dump *thanks to ravmustang*
[https://github.com/ravmustang/DayZ_SA_ClassName_Dump DayZ SA ClassName Dump on GitHub] ''(thanks to ravmustang)''


:1. Bring down the server by hitting stop on the panel
:1. Stop the server: click STOP on the Game Server page in the Command Center
:2. Log into your FTP client. ([https://www.survivalservers.com/wiki/index.php?title=FTP_Access Info here for FTP])
:2. Log in with your FTP program (FileZilla). How to connect: [[FTP Access|FTP Access]].
:3. Head into the following directory: /mpmissions/dayzOffline.chernarusplus
:3. Open this folder: /mpmissions/dayzOffline.chernarusplus (on Livonia dayzOffline.enoch, on Frostline dayzOffline.sakhal, on&nbsp;Badlands&nbsp;dayzOffline.nasdara)
:4. Use [https://filehippo.com/download_notepad/ Notepad++] to edit the init.c file within the above directory.
:4. Use [https://notepad-plus-plus.org/downloads/ Notepad++] to edit the init.c file in that folder.
::::*Look for the following area:
::::*Find this section:
<pre> override void StartingEquipSetup(PlayerBase player, bool clothesChosen)
<pre> override void StartingEquipSetup(PlayerBase player, bool clothesChosen)
{
{
Line 18: Line 19:
EntityAI item3 = player.GetInventory().CreateInInventory(shoesArray.GetRandomElement());
EntityAI item3 = player.GetInventory().CreateInInventory(shoesArray.GetRandomElement());
*/
*/
EntityAI itemTop;
EntityAI itemClothing;
EntityAI itemEnt;
EntityAI itemEnt;
ItemBase itemBs;
ItemBase itemBs;
float rand;
float rand;


itemTop = player.FindAttachmentBySlotName("Body");
itemClothing = player.FindAttachmentBySlotName("Body");


if ( itemTop )
if ( itemClothing )
{
{
itemEnt = itemTop.GetInventory().CreateInInventory("Rag");
itemEnt = itemClothing.GetInventory().CreateInInventory("Rag");
if ( Class.CastTo(itemBs, itemEnt ) )
if ( Class.CastTo(itemBs, itemEnt ) )
itemBs.SetQuantity(4);
itemBs.SetQuantity(4);
Line 36: Line 37:
itemBs = ItemBase.Cast(itemEnt);
itemBs = ItemBase.Cast(itemEnt);
itemEnt = itemTop.GetInventory().CreateInInventory("RoadFlare");
itemEnt = itemClothing.GetInventory().CreateInInventory("RoadFlare");
SetRandomHealth(itemEnt);
SetRandomHealth(itemEnt);


itemEnt = itemTop.GetInventory().CreateInInventory("CombatKnife");
itemEnt = itemClothing.GetInventory().CreateInInventory("CombatKnife");
SetRandomHealth(itemEnt);
SetRandomHealth(itemEnt);
Line 68: Line 69:
</pre>
</pre>


:5. From there you will want to grab the new classnames from the link listed at the top of the page. Simply change the <br>
:5. Take the new class names from the DayZ SA ClassName Dump on GitHub. Swap the <br>
current list out with the new items you wish to have or copy the code line and create a new item to add onto the list. <br>
current items for the ones you want, or copy a code line to add a new item to the list. <br>
Do note however that the inventory can only hold so much.
The inventory can only hold so much.


<pre> itemEnt = itemTop.GetInventory().CreateInInventory("Battery9V");
<pre> itemEnt = itemClothing.GetInventory().CreateInInventory("Battery9V");
SetRandomHealth(itemEnt);
SetRandomHealth(itemEnt);
</pre>
</pre>


:6. Once you have made your edits simply save and re upload to the FTP client.
:6. Once you've made your edits, save the file and upload it back over FTP.
:7. Start DayZ Standalone back online and join the server
:7. Start the server again and join it in DayZ
::::*Do note that you will only get these items when starting a fresh character
::::*You only get these items on a new character


:: This page will be updated more as time goes on.
[https://www.survivalservers.com/services/game_servers/dayz/ Rent a DayZ server] from Survival Servers with instant setup.

Latest revision as of 09:05, 17 November 2026

Setting up a custom loadout

First, get the item class names from this list:
DayZ SA ClassName Dump on GitHub (thanks to ravmustang)

1. Stop the server: click STOP on the Game Server page in the Command Center
2. Log in with your FTP program (FileZilla). How to connect: FTP Access.
3. Open this folder: /mpmissions/dayzOffline.chernarusplus (on Livonia dayzOffline.enoch, on Frostline dayzOffline.sakhal, on Badlands dayzOffline.nasdara)
4. Use Notepad++ to edit the init.c file in that folder.
  • Find this section:
			override void StartingEquipSetup(PlayerBase player, bool clothesChosen)
	{
/*
		player.RemoveAllItems();

		EntityAI item = player.GetInventory().CreateInInventory(topsMissionArray.GetRandomElement());
		EntityAI item2 = player.GetInventory().CreateInInventory(pantsArray.GetRandomElement());
		EntityAI item3 = player.GetInventory().CreateInInventory(shoesArray.GetRandomElement());
*/
		EntityAI itemClothing;
		EntityAI itemEnt;
		ItemBase itemBs;
		float rand;

		itemClothing = player.FindAttachmentBySlotName("Body");

		if ( itemClothing )
		{
			itemEnt = itemClothing.GetInventory().CreateInInventory("Rag");
			if ( Class.CastTo(itemBs, itemEnt ) )
		itemBs.SetQuantity(4);

			SetRandomHealth(itemEnt);

			itemEnt = player.GetInventory().CreateInInventory("MP5K");
			itemBs = ItemBase.Cast(itemEnt);
			
			itemEnt = itemClothing.GetInventory().CreateInInventory("RoadFlare");
			SetRandomHealth(itemEnt);

			itemEnt = itemClothing.GetInventory().CreateInInventory("CombatKnife");
			SetRandomHealth(itemEnt);
			
			itemEnt = player.GetInventory().CreateInInventory("AssaultBag_Green");
			itemBs = ItemBase.Cast(itemEnt);
		}

		rand = Math.RandomFloatInclusive(0.0, 1.0);
		if ( rand < 0.25 )
			itemEnt = player.GetInventory().CreateInInventory("SodaCan_Cola");
		else if ( rand > 0.75 )
			itemEnt = player.GetInventory().CreateInInventory("SodaCan_Spite");
		else
			itemEnt = player.GetInventory().CreateInInventory("SodaCan_Pipsi");

		SetRandomHealth(itemEnt);

		rand = Math.RandomFloatInclusive(0.0, 1.0);
		if ( rand < 0.35 )
			itemEnt = player.GetInventory().CreateInInventory("Apple");
		else if ( rand > 0.65 )
			itemEnt = player.GetInventory().CreateInInventory("Pear");
		else
			itemEnt = player.GetInventory().CreateInInventory("Plum");

		SetRandomHealth(itemEnt);
	}
5. Take the new class names from the DayZ SA ClassName Dump on GitHub. Swap the

current items for the ones you want, or copy a code line to add a new item to the list.
The inventory can only hold so much.

 itemEnt = itemClothing.GetInventory().CreateInInventory("Battery9V");
			SetRandomHealth(itemEnt);
6. Once you've made your edits, save the file and upload it back over FTP.
7. Start the server again and join it in DayZ
  • You only get these items on a new character

Rent a DayZ server from Survival Servers with instant setup.