Jump to content
Sign in to follow this  
mr_shadow

Random civ headgear

Recommended Posts

Hello guys, on arma 3 beta, BIS have added random headgear for civ team, is there any way to disable it?

Using add headgear can't help me, because in my mission they are able to select the headgear they want.

Probably there can be another solution, every time when new player joins the game its setting random headgear to every civ, so is it possible to fix that?

Share this post


Link to post
Share on other sites
Is that impossible?

removeheadgear this;

If you are using an array, replace "this" by the array you're using.

Let's say _unit this select 0;

you just need to change it to removeheadgear _unit;

Edited by Vegatry

Share this post


Link to post
Share on other sites
BIS have added random headgear for civ team, is there any way to disable it?

Never realized civs had random headgear assigned. So out of curiosity I checked for their default headgear but apparently the majority of civilians do not have any default headgear.

_typeArray = ["Asian","European","Afroamerican","Men"];
_cfg = configFile >> "cfgVehicles";

for "_i" from 0 to count _cfg - 1 do {
_sel = _cfg select _i;
_className = configName _sel;

if (isClass _sel) then {
	_side = getNumber (_cfg >> _className >> "side");
	_linkedItems = getArray (_cfg >> _className >> "linkedItems");
	_scope = getNumber (_cfg >> _className >> "scope");
	_vehClass = getText (_cfg >> _className >> "vehicleClass");

	if (_side == 3 && {_scope >= 2 && {count _linkedItems > 0 && {_vehClass in _typeArray}}}) then {
		diag_log format ["%1", _linkedItems];
	};
};
};

As you can see from the rpt output below, one civilian has a boonie cap in the linked items array.

"["ItemMap","ItemCompass","ItemWatch"]"
"["ItemMap","ItemCompass","ItemWatch"]"
"["ItemMap","ItemCompass","ItemWatch"]"
"["ItemMap","ItemCompass","ItemWatch"]"
"["ItemMap","ItemCompass","ItemWatch"]"
"["ItemMap","ItemCompass","ItemWatch"]"
"["ItemMap","ItemCompass","ItemWatch"]"
"["ItemMap","ItemCompass","ItemWatch"]"
"["ItemMap","ItemCompass","ItemWatch"]"
"["ItemMap","ItemCompass","ItemWatch"]"
"["ItemMap","ItemCompass","ItemWatch"]"
"["ItemMap","ItemCompass","ItemWatch"]"
"["ItemMap","ItemCompass","ItemWatch"]"
"["ItemMap","ItemCompass","ItemWatch"]"
"["ItemMap","ItemCompass","ItemWatch"]"
"["ItemMap","ItemCompass","ItemWatch"]"
"["ItemMap","ItemCompass","ItemWatch"]"
"["ItemMap","ItemCompass","ItemWatch"]"
"["ItemMap","ItemCompass","ItemWatch"]"
"["H_Booniehat_grn","ItemMap","ItemCompass","ItemWatch"]"
"["ItemMap","ItemCompass","ItemWatch"]"
"["ItemMap","ItemCompass","ItemWatch"]"
"["ItemMap","ItemCompass","ItemWatch"]"
"["ItemMap","ItemCompass","ItemWatch"]"
"["ItemMap","ItemCompass","ItemWatch"]"
"["ItemMap","ItemCompass","ItemWatch"]"
"["ItemMap","ItemCompass","ItemWatch"]"
"["ItemMap","ItemCompass","ItemWatch"]"
"["ItemMap","ItemCompass","ItemWatch"]"
"["ItemMap","ItemCompass","ItemWatch"]"
"["ItemMap","ItemCompass","ItemWatch"]"
"["ItemMap","ItemCompass","ItemWatch"]"
"["ItemMap","ItemCompass","ItemWatch"]"
"["ItemMap","ItemCompass","ItemWatch"]"
"["ItemMap","ItemCompass","ItemWatch"]"
"["ItemMap","ItemCompass","ItemWatch"]"
"["ItemMap","ItemCompass","ItemWatch"]"
"["ItemMap","ItemCompass","ItemWatch"]"
"["ItemMap","ItemCompass","ItemWatch"]"
"["ItemMap","ItemCompass","ItemWatch"]"
"["ItemMap","ItemCompass","ItemWatch"]"
"["ItemMap","ItemCompass","ItemWatch"]"
"["ItemMap","ItemCompass","ItemWatch"]"
"["ItemMap","ItemCompass","ItemWatch"]"
"["ItemMap","ItemCompass","ItemWatch"]"
"["ItemMap","ItemCompass","ItemWatch"]"
"["ItemMap","ItemCompass","ItemWatch"]"
"["ItemMap","ItemCompass","ItemWatch"]"
"["ItemMap","ItemCompass","ItemWatch"]"
"["ItemMap","ItemCompass","ItemWatch"]"
"["ItemMap","ItemCompass","ItemWatch"]"
"["ItemMap","ItemCompass","ItemWatch"]"
"["ItemMap","ItemCompass","ItemWatch"]"
"["ItemMap","ItemCompass","ItemWatch"]"
"["ItemMap","ItemCompass","ItemWatch"]"
"["ItemMap","ItemCompass","ItemWatch"]"
"["ItemMap","ItemCompass","ItemWatch"]"
"["ItemMap","ItemCompass","ItemWatch"]"
"["ItemMap","ItemCompass","ItemWatch"]"

Aside from simply removing all civ's headgear, you can do something like this to force them to wear default headgear (which obviously for the majority of civ's is NONE)

{
if (side _x == CIVILIAN) then {
	removeHeadGear _x;
	_linkedItems = getArray (configfile >> "CfgVehicles" >> typeOf _x >> "linkedItems");
	for "_i" from 0 to count _linkedItems - 1 do {
		_selection = _linkedItems select _i;
		_item = [_selection] call BIS_fnc_itemType;
		_type = _item select 1;
		if (_type == "Headgear") exitWith {
			_x addheadGear _selection;
		};
	};
};
} forEach allUnits;

Edited by Iceman77

Share this post


Link to post
Share on other sites

I have tested all civ units in editor, and its really random and all of them have that, steps to repeat:

Open editor and place any same civs on a map. For exaple 10.

Like Civilian 1.

All of them exept 1 will have a random head gear.

I know this was made to make them unique, but if the new player joins the MP mission he well make other civs wearing random headgear.

Share this post


Link to post
Share on other sites

Setting this should fix it.

_unit setVariable["BIS_randomSeed1",3,TRUE];

I am not entirely sure if that will work as I do it via a server-side mod but technically should work?

Without setting that variable it won't matter if you remove the headgear or they change it because the method in which they do is currently bugged and every time a person joins it re-adds the same hat.

The random hat / clothing is a script, traced through it's config init EVH.

class EventHandlers: EventHandlers
{
init = "(_this select 0) execVM ""\A3\characters_f\civil\scripts\randomize_civ1.sqf""";
};

Edited by Tonic-_-

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
Sign in to follow this  

×