[Modding] Adding flag textures & flag cloth item - CommanderBeelo/DayZ-Expansion-Scripts GitHub Wiki

ExpansionSample-LoadingScreen

Click on the picture to be redirected on our sample flag textures mod.

DISCLAIMER !

We are not going to teach you how to create a mod or convert images to .paa/.edds.

Contents

You will need to setup a mod with the usual config.cpp for a basic mod. All the files we will create will need to add new flags.

The hierarchy of the mod we have provided looks like this.

Hierachy mod

config.cpp

	class CfgPatches
	{
		class ExpansionFlagSample
		{
			units[] = {};
			weapons[] = {};
			requiredVersion = 0.1;
			requiredAddons[] = {"DZ_Data", "DayZExpansion_BaseBuilding_Scripts"};
		};
	};
	class CfgMods
	{
		class ExpansionFlagSample
		{
			dir = "ExpansionFlagSample";
			picture = "";
			action = "";
			hideName = 1;
			hidePicture = 1;
			name = "ExpansionFlagSample";
			credits = "Not A Banana";
			author = "Not A Banana";
			authorID = "0";
			version = "1.0";
			extra = 0;
			type = "mod";
			dependencies[] = {"Game"};
			class defs
			{
				class gameScriptModule
				{
					value = "";
					files[] = {"ExpansionFlagSample/scripts/3_Game"};
				};
			};
		};
	};
	//! Flag cloth item
	class CfgVehicles
	{
		class Flag_Base;
		class Expansion_Flag_BohemiaInteractive: Flag_Base
		{
			scope=2;
			hiddenSelectionsTextures[]=
			{
				"\ExpansionFlagSample\data\flag_bohemiainteractive_co.paa"
			};
		};
	};

FlagSample.c

To add a flag texture you need to add the following lines and modifications to your mod within the game script module (3_Game):

	modded class ExpansionFlagTextures
	{
		override void Load()
		{
			super.Load();
			// This is where you want to add or remove flags !
			Add("<path to flag texture>", "Flag Example 1");
		};
	};

To add a flag you need to add the following line:

	Add("ModName\\data\\flag_name_co.paa", "MyFlagName");

If you want to remove a flag that is arleady added by expansion you will need to add the following line to that modification:

	Remove("DayZExpansion\\Objects\\Structures\\Flags\\data\\logos\\flag_expansion_co.paa");

This is an example for adding 2 new flags and remove the expansion logo flag from the expansion mod:

	modded class ExpansionFlagTextures
	{
		override void Load()
		{
			super.Load();
			// This is where you want to add or remove flags !
			Add("ModName\\data\\flag_name_co.paa", "MyFlagName");
			Add("ModName\\data\\flag_name2_co.paa", "MyFlagName2");
			Remove("DayZExpansion\\Objects\\Structures\\Flags\\data\\logos\\flag_expansion_co.paa");
		};
	};

Flag dimensions

The texture need to have 2:1 dimensions. For example a texture of 512 pixels by 256 pixels will work.