Jump to content
Redrumovy

Disabling random headgear for unit in config

Recommended Posts

I'm trying to make my own faction and I encountered a problem that units get random facewear if they don't have specifically set one up and it's looking terrible.

 

4zmwd02.jpg

 

How can I disable it?

2nd question - how can I set up my custom icon for units instead of default 'addon' icon?

3rd question - there seems to be something wrong with identities in my config because units spawn with default face instead of Persian head I choosen.

Here's my base class config.

 

	class O_Soldier_F;
	class r_ypg_base: O_Soldier_F
{
	displayName = "YPG Base"; 
	genericnames = "TakistaniMen";
	scope = 0;
	scopeCurator = 0;
	faction = "[R] YPG";
	modelsides[] = {1,2};
	side = 1;
	vehicleClass = "R_YPG"; 
	icon = "iconMan"; 
	nakedUniform = "U_BasicBody";
	uniformClass = "LOP_U_ISTS_Fatigue_27"; 
	camouflage = 1;
	hiddenSelections[] = {"Camo","Insignia"};
	linkedItems[] = {"OTK_L_Chestrig_Khaki1","shemagh_loosetan","LOP_H_Beanie_marpat","ItemMap","ItemCompass","ItemWatch","ItemRadio"};
	respawnLinkedItems[] = {"OTK_L_Chestrig_Khaki1","shemagh_loosetan","LOP_H_Beanie_marpat","ItemMap","ItemCompass","ItemWatch","ItemRadio"};
	weapons[] = {"rhs_weap_akms","Binocular","Throw","Put"}; 
	respawnWeapons[] = {"rhs_weap_akms","Binocular","Throw","Put"}; 
	magazines[] = {"rhs_30Rnd_762x39mm","rhs_30Rnd_762x39mm","rhs_30Rnd_762x39mm","rhs_30Rnd_762x39mm","rhs_30Rnd_762x39mm","rhs_30Rnd_762x39mm","rhs_30Rnd_762x39mm","rhs_30Rnd_762x39mm","HandGrenade","SmokeShell","SmokeShell",};
	respawnMagazines[] = {"rhs_30Rnd_762x39mm","rhs_30Rnd_762x39mm","rhs_30Rnd_762x39mm","rhs_30Rnd_762x39mm","rhs_30Rnd_762x39mm","rhs_30Rnd_762x39mm","rhs_30Rnd_762x39mm","rhs_30Rnd_762x39mm","HandGrenade","SmokeShell","SmokeShell",};
	identityTypes[] = {"NoGlasses", "LanguagePER_F", "Head_Persian", "G_IRAN_default"};
	
		class EventHandlers
	{
		init = "[(_this select 0),""ypg1""] call BIS_fnc_setUnitInsignia;";
	};
};	

 

Share this post


Link to post
Share on other sites

init = "(_this select 0) setVariable ["BIS_enableRandomization",false]; [(_this select 0),""ypg1""] call BIS_fnc_setUnitInsignia;";

 

should work. Not tested.

Share this post


Link to post
Share on other sites

Sadly it doesn't work. I tried to put it with insignia line, but then game didn't want to start. I tried using only one disabling randomization, but the facewear still were appearing.

 

However I made some changes to in config

I removed 

identityTypes[] = {"NoGlasses", "LanguagePER_F", "Head_Persian", "G_IRAN_default"};

and added this line to set faces I wanted for units (it works) 

 

face = ("PersianHead_A3_01","PersianHead_A3_02","PersianHead_A3_03");

Now it seems like not all headgear is spawning at random, only googles. Any idea how can I remove them too? I'm out of ideas.

 

My current base soldier config:

 

	class O_Soldier_F;
	class r_ypg_base: O_Soldier_F
{
	displayName = "YPG Base"; 
	genericnames = "TakistaniMen";
	scope = 0;
	scopeCurator = 0;
	faction = "[R] YPG";
	modelsides[] = {1,2};
	side = 1;
	vehicleClass = "R_YPG"; 
	icon = "iconMan"; 
	nakedUniform = "U_BasicBody";
	uniformClass = "LOP_U_ISTS_Fatigue_27"; 
	camouflage = 1;
	face = ("PersianHead_A3_01","PersianHead_A3_02","PersianHead_A3_03");
	linkedItems[] = {"OTK_L_Chestrig_Khaki1","LOP_H_Beanie_marpat","ItemMap","ItemCompass","ItemWatch","ItemRadio"};
	respawnLinkedItems[] = {"OTK_L_Chestrig_Khaki1","LOP_H_Beanie_marpat","ItemMap","ItemCompass","ItemWatch","ItemRadio"};
	weapons[] = {"rhs_weap_akms","Binocular","Throw","Put"}; 
	respawnWeapons[] = {"rhs_weap_akms","Binocular","Throw","Put"}; 
	magazines[] = {"rhs_30Rnd_762x39mm","rhs_30Rnd_762x39mm","rhs_30Rnd_762x39mm","rhs_30Rnd_762x39mm","rhs_30Rnd_762x39mm","rhs_30Rnd_762x39mm","rhs_30Rnd_762x39mm","rhs_30Rnd_762x39mm","HandGrenade","SmokeShell","SmokeShell",};
	respawnMagazines[] = {"rhs_30Rnd_762x39mm","rhs_30Rnd_762x39mm","rhs_30Rnd_762x39mm","rhs_30Rnd_762x39mm","rhs_30Rnd_762x39mm","rhs_30Rnd_762x39mm","rhs_30Rnd_762x39mm","rhs_30Rnd_762x39mm","HandGrenade","SmokeShell","SmokeShell",};

	class EventHandlers
	{
		init = "[(_this select 0),""ypg1""] call BIS_fnc_setUnitInsignia;";
	};

 

Share this post


Link to post
Share on other sites

For a while, After having editing an unit, I am using this in the unit "init" ...

this setVariable ["BIS_enableRandomization", false];

... and it works .

Share this post


Link to post
Share on other sites
19 minutes ago, oldbear said:

For a while, After having editing an unit, I am using this in the unit "init" ...


this setVariable ["BIS_enableRandomization", false];

... and it works .

 

It works when I put it in init in the editor, but I want to make it work from config so my units just spawn how I wanted them to be without having to edit them in editor.

Share this post


Link to post
Share on other sites

All right, I think I found a soluton:

I added these lines to my config and now facewear doesn't randomize anymore.

 

	facewear = "";
	allowedfacewear[] = {""};
	allowedHeadgear[] = {""};
	allowedHeadgearB[] = {""};
	headgearList[] = {""};

 

  • Like 1

Share this post


Link to post
Share on other sites
40 minutes ago, Redrumovy said:

 

It works when I put it in init in the editor, but I want to make it work from config so my units just spawn how I wanted them to be without having to edit them in editor.

I wrote some typo errors with the single/double quotes:

Read:

init = "(_this select 0) setVariable [""BIS_enableRandomization"",false]; [(_this select 0),""ypg1""] call BIS_fnc_setUnitInsignia;";

  • Like 1

Share this post


Link to post
Share on other sites

I came upon this post looking for something else. It is about that net headgear in the picture. Which mod is that? I know it's been 2 years, but I am getting desperate.

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

×