Jump to content
Guest

BI Itens with no UI

Recommended Posts

Guest

Hi,

I did a loot system. And in this loot system i have those items:

 

SOUND SUPRESSORS:

"muzzle_snds_L"
 
UNIFORMS:
"U_BG_Guerilla3_1"
"U_BG_Guerilla3_2"
"U_IG_Guerilla3_1"
"U_IG_Guerilla3_2"
"U_OG_Guerilla3_1"
"U_OG_Guerilla3_2"
 
VESTS:
"V_TacVest_blk"
"V_TacVest_brn"
"V_TacVest_khk"
"V_TacVest_oli"
 
Those items are put in a weaponHolder to players to pick up.
In my tests, when i try to get those items, i receive a missing image error.
After that, if i get the item it does not appears on my inventory.
 
PS: The loot system have other items, but those are the ones that give the errors.
 
See in the image below the Tak Vest with no item image:
 
n968lKT.jpg
 
Those items indeed have this problem or i an doing something wrong at my side?

Share this post


Link to post
Share on other sites
Guest

Here the error message when i try to get the Guerrilla uniform (Guerrilla Smocks) from the ground:

 

0uL6qi4.jpg

Share this post


Link to post
Share on other sites
Guest

Like you guys can see, there is no: icon_u_g_gerrilla3_x_ca.paa file.

 

hCt5YfD.jpg

Share this post


Link to post
Share on other sites

Just tried spawning all the uniforms and vests mentioned in the OP into a weaponHolderSimulated and receive no errors and all pictures are present.

Checked all related configs for each item and all pictures point to the correct .paa's.

Using current Stable 1.58.

test code from debug console

_pos = player getPos [ 3, getDir player ];
_wh = createVehicle ["WeaponHolderSimulated", _pos, [], 0, "CAN_COLLIDE"];
{
	_wh addItemCargoGlobal _x;
}forEach [
	[ "U_BG_Guerilla3_1", 1 ], 
	[ "U_BG_Guerilla3_2", 1 ], 
	[ "U_IG_Guerilla3_1", 1 ], 
	[ "U_IG_Guerilla3_2", 1 ], 
	[ "U_OG_Guerilla3_1", 1 ], 
	[ "U_OG_Guerilla3_2", 1 ],
	[ "V_TacVest_blk", 1 ], 
	[ "V_TacVest_brn", 1 ], 
	[ "V_TacVest_khk", 1 ], 
	[ "V_TacVest_oli", 1 ]
];
Whats your code for spawning and adding to weaponHolder look like?

Share this post


Link to post
Share on other sites
Guest

Thanks a lot for your help, larrow.

Indeed i believe to be doing something wrong when adding the loot to the weapon holder. This is the code that add the items:

_addLoot = {
	params ["_holder","_itemsAll"];
	{
		_isM = isClass (configFile >> "CfgMagazines" >> _x);
		if (_isM) then {
			_holder addMagazineCargoGlobal [_x,1];
		} else {
			_isW = isClass (configFile >> "CfgWeapons" >> _x);
			if (_isW) then {
				_holder addWeaponCargoGlobal [_x,1];
			} else {
				_isV = isClass (configFile >> "CfgVehicles" >> _x);
				if (_isV) then {
					_holder addBackpackCargoGlobal [_x,1];
				} else {
					diag_log "[MTDR LOOT] TIPO DE LOOT NAO IDENTIFICADO!";
				};
			};
		};
	} forEach _itemsAll;
};

_itemsAll is an array with many loot classnames.

This code is from when the mod was in Arma 2 OA where items are weapons and backpacks are vehicles. Just noticed i need to update it for Arma 3.

 

Some help please:

 

How do i detect the classname is from a uniform? Uniforms are CfgVehicles?

Sound Supressors are CfgWeapons?

Share this post


Link to post
Share on other sites
Guest

Found the solution. Testing it now:

_mtdr_addLoot = {
	params ["_holder","_itemsAll"];
	{
		_isM = isClass (configFile >> "CfgMagazines" >> _x);
		if (_isM) then {
			_holder addMagazineCargoGlobal [_x,1];
		} else {
			_isW = isClass (configFile >> "CfgWeapons" >> _x);
			if (_isW) then {
                                //CHANGED BEGIN
				_isItem = _x isKindOf ["ItemCore",configFile >> "CfgWeapons"];
				if (_isItem) then {
					_holder addItemCargoGlobal [_x,1];
				} else {
					_holder addWeaponCargoGlobal [_x,1];
				};
                                //CHANGED END
			} else {
				_isV = isClass (configFile >> "CfgVehicles" >> _x);
				if (_isV) then {
					_holder addBackpackCargoGlobal [_x,1];
				} else {
					diag_log "[MTDR LOOT] TIPO DE LOOT NAO IDENTIFICADO!";
				};
			};
		};
	} forEach _itemsAll;
};

Share this post


Link to post
Share on other sites
Guest

Confirming: Problem solved with the code above!

Thankyou!

Share this post


Link to post
Share on other sites

BI have a handy function for sorting item types..

{
	_item = _x;
	_type = ( [ _item ] call BIS_fnc_itemType ) select 0;
	switch ( toUpper _type ) do {
		case "MINE";
		case "MAGAZINE" : {
			_holder addMagazineCargoGlobal [ _item, 1 ];
		};
		case "ITEM" : {
			_holder addItemCargoGlobal [ _item, 1 ];
		};
		case "WEAPON" : {
			_holder addWeaponCargoGlobal [ _item, 1 ];
		};
		case "EQUIPMENT" : {
			//backpack
			if ( isClass( configFile >> "CfgVehicles" >> _item ) ) then {
				_holder addBackpackCargoGlobal [ _item, 1 ];
			}else{
				_holder addItemCargoGlobal [ _item, 1 ];
			};
		};
	};
}forEach _allItems;
OR

{
	_item = _x;
	_type = [ _item ] call BIS_fnc_itemType;
	switch ( toUpper ( _type select 0 ) ) do {
		case "MINE";
		case "MAGAZINE" : {
			_holder addMagazineCargoGlobal [ _item, 1 ];
		};
		case "ITEM" : {
			_holder addItemCargoGlobal [ _item, 1 ];
		};
		case "WEAPON" : {
			_holder addWeaponCargoGlobal [ _item, 1 ];
		};
		case "EQUIPMENT" : {
			//backpack
			if ( _type select 1 == "backpack" ) then {
				_holder addBackpackCargoGlobal [ _item, 1 ];
			}else{
				_holder addItemCargoGlobal [ _item, 1 ];
			};
		};
	};
}forEach _allItems;
  • Like 2

Share this post


Link to post
Share on other sites
Guest

Thankyou!

 

All working great.

 

I am having this problem, not 100% related:

 

When the player uses a civilian uniform (i use player forceAddUniform "civilian_uniform_class") and i try to addItem and assignItem to the player, a NVGoggles or a ItemMap for example, it does not work and i see those errors on the RPT:

22:45:55 Inventory item with given name: [ItemMap] not found
22:45:55 Inventory item with given name: [NVGoggles] not found

I need to test again, but i believe this also happens with the Guerrilla Smocks.

Share this post


Link to post
Share on other sites
Guest

Problem solved. Thankyou for all the help.

 

This code don't work for Civilian Uniforms, may be because they was added to the player with forceAddUniform:

{player addItem _x;player assignItem _x;} forEach _allAssignedItems;

But this code works:

{player addWeapon _x;} forEach _allAssignedItems;

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

×