Jump to content
Gilatar

Add Insignia to CfgRespawnInventory?

Recommended Posts

I'm using MenuInventory for a mission and I'm wondering if there is a way to add a unit insignia to the CfgRespawnInventory in the description.ext. 

 

Here is what that part of the description.ext looks like:

class CfgRespawnInventory
{
class TeamLeader
{
displayName = "Team Leader"; // Name visible in the menu
icon = "\A3\Ui_f\data\GUI\Cfg\Ranks\sergeant_gs.paa";

weapons[] = {
"SMA_AAC_MPW_16_Black",
"rhsusf_weap_glock17g4",
"Rangefinder"
};

magazines[] = {
"ACE_M84",
"ACE_M84",
"SmokeShell",
"SmokeShell",
"SmokeShell",
"HandGrenade",
"HandGrenade",
"HandGrenade",
"B_IR_Grenade",
"B_IR_Grenade",
"SmokeShellGreen",
"SmokeShellGreen",
"SmokeShellRed",
"SmokeShellRed",
"SmokeShellBlue",
"SmokeShellBlue",
"Chemlight_green",
"Chemlight_green",
"SMA_30Rnd_762x35_SS",
"SMA_30Rnd_762x35_SS",
"SMA_30Rnd_762x35_SS",
"SMA_30Rnd_762x35_SS",
"SMA_30Rnd_762x35_Ball",
"SMA_30Rnd_762x35_Ball",
"SMA_30Rnd_762x35_Ball",
"SMA_30Rnd_762x35_Ball",
"DemoCharge_Remote_Mag",
"rhsusf_mag_17Rnd_9x19_FMJ",
"rhsusf_mag_17Rnd_9x19_FMJ"
};

items[] = {
"SMA_AAC_762_sdn6",
"FHQ_optic_TWS3050",
"A3_GPNVG18_F",
"ACE_EarPlugs",
"ItemcTabHCam",
"ACE_epinephrine",
"ACE_epinephrine",
"ACE_morphine",
"ACE_morphine",
"ACE_quikclot",
"ACE_quikclot",
"ACE_quikclot",
"ACE_quikclot",
"ACE_quikclot",
"ACE_quikclot",
"ACE_quikclot",
"ACE_quikclot",
"ACE_quikclot",
"ACE_quikclot",
"ACE_MapTools",
"ACE_CableTie",
"ACE_CableTie",
"ACE_CableTie",
"ACE_CableTie",
"ACE_M26_Clacker",
"ACE_HuntIR_monitor"
};

linkedItems[] = {
"ItemMap",
"ItemcTab",
"ItemRadio",
"ItemCompass",
"ACE_Altimeter",
"AV_PlateCarrier1_OCP",
"JSOC_OCP_OpsCore_FBJ",
"SMA_eotech552_3XDOWN",
"rhsusf_acc_anpeq15side"
};

uniformClass = "JSOC_OCP_CRYE";
backpack = "TRYK_B_Belt_CYT";
};

I've tried putting this insignia code into the unit's init line, but it seems like CfgRespawnInventory overrides it by adding a new uniform when the game initializes.

[this,"111thID"] call BIS_fnc_setUnitInsignia;

Share this post


Link to post
Share on other sites

I've tried putting this insignia code into the unit's init line, but it seems like CfgRespawnInventory overrides it by adding a new uniform when the game initializes.

As youve likely got respawnOnSart set in your description.ext so that players can choose their loadout from the menuInventory, anything in the units init will be wiped.

As the unit is being respawned then you can add your line in the onPlayerRespawn.sqf.

If you want each loadout in CfgRespawnInventory to have a specific insignia you could add to a loadout..

class CfgRespawnInventory
{
	class TeamLeader
	{
		displayName = "Team Leader"; // Name visible in the menu
		icon = "\A3\Ui_f\data\GUI\Cfg\Ranks\sergeant_gs.paa";
	
		weapons[] = {
			"SMA_AAC_MPW_16_Black",
			"rhsusf_weap_glock17g4",
			"Rangefinder"
		};
		
		magazines[] = {
			"ACE_M84",
			"ACE_M84",
			"SmokeShell",
			"SmokeShell",
			"SmokeShell",
			"HandGrenade",
			"HandGrenade",
			"HandGrenade",
			"B_IR_Grenade",
			"B_IR_Grenade",
			"SmokeShellGreen",
			"SmokeShellGreen",
			"SmokeShellRed",
			"SmokeShellRed",
			"SmokeShellBlue",
			"SmokeShellBlue",
			"Chemlight_green",
			"Chemlight_green",
			"SMA_30Rnd_762x35_SS",
			"SMA_30Rnd_762x35_SS",
			"SMA_30Rnd_762x35_SS",
			"SMA_30Rnd_762x35_SS",
			"SMA_30Rnd_762x35_Ball",
			"SMA_30Rnd_762x35_Ball",
			"SMA_30Rnd_762x35_Ball",
			"SMA_30Rnd_762x35_Ball",
			"DemoCharge_Remote_Mag",
			"rhsusf_mag_17Rnd_9x19_FMJ",
			"rhsusf_mag_17Rnd_9x19_FMJ"
		};
		
		items[] = {
			"SMA_AAC_762_sdn6",
			"FHQ_optic_TWS3050",
			"A3_GPNVG18_F",
			"ACE_EarPlugs",
			"ItemcTabHCam",
			"ACE_epinephrine",
			"ACE_epinephrine",
			"ACE_morphine",
			"ACE_morphine",
			"ACE_quikclot",
			"ACE_quikclot",
			"ACE_quikclot",
			"ACE_quikclot",
			"ACE_quikclot",
			"ACE_quikclot",
			"ACE_quikclot",
			"ACE_quikclot",
			"ACE_quikclot",
			"ACE_quikclot",
			"ACE_MapTools",
			"ACE_CableTie",
			"ACE_CableTie",
			"ACE_CableTie",
			"ACE_CableTie",
			"ACE_M26_Clacker",
			"ACE_HuntIR_monitor"
		};
		
		linkedItems[] = {
			"ItemMap",
			"ItemcTab",
			"ItemRadio",
			"ItemCompass",
			"ACE_Altimeter",
			"AV_PlateCarrier1_OCP",
			"JSOC_OCP_OpsCore_FBJ",
			"SMA_eotech552_3XDOWN",
			"rhsusf_acc_anpeq15side"
		};
		
		uniformClass = "JSOC_OCP_CRYE";
		backpack = "TRYK_B_Belt_CYT";
		
		insignia = "111thID";
	};
};
For instance here at the end of the TeamLeader loadout a insignia = "111thID" and then handle it yourself in the onPlayerRespawn.sqf. e.g

onPlayerRespawn.sqf

params[
	"_unit",
	"_oldUnit",
	"_respawn",
	"_respawnDelay"
];


_selected = BIS_fnc_respawnMenuInventory_selected;

if ( _selected != "" ) then {
	_insignia = getText( missionConfigFile >> "CfgRespawnInventory" >> _selected >> "insignia" );
	if !( _insignia == "" ) then {
		//remoteExec with JIP so JIP see previous set insignia, format unique JIP queue name so each respawn overwrites existing queue item
		[ _unit, _insignia ] remoteExec [ "BIS_fnc_setUnitInsignia", 0, format[ "%1insignia", name _unit ] ];
	};
};
Quick and slighlty dirty way using BIS_fnc_setUnitInsignia as each insignia will be reapplied every time a player joins but works as an example.

The better way would be to use BIS_fnc_setUnitInsignia on respawn but to only que up a setObjectTexture (local) for JIPs.

Share this post


Link to post
Share on other sites

 

Quick and slighlty dirty way using BIS_fnc_setUnitInsignia as each insignia will be reapplied every time a player joins but works as an example.

The better way would be to use BIS_fnc_setUnitInsignia on respawn but to only que up a setObjectTexture (local) for JIPs.

 

 

Thanks for the reply! I'm sorry if I'm coming across as a moron, but my scripting experience is pretty much equal to nothing, so I'm not sure how to utilize the text you gave me for OnPlayerRespawn.sqf. Am I supposed to change it in any way?

 

Unchanged it does nothing. Starting the mission it doesn't apply the insignia, and it goes unchanged when respawning. I've tried toying around with the -

if ( _selected != "" ) then {
if !( _insignia == "" ) then {

- lines by inserting the classname of the loadout and insignia, but this still appears to do nothing. Again, zero experience with scripting so I'm just grasping at straws here.

 

The only way I've made this work so far is to put this line I found on the BIS_fnc_setUnitInsignia page in OnPlayerRespawn.sqf:

[[ player, "111thID"], "BIS_fnc_setUnitInsignia", nil, true, true] call BIS_fnc_MP;

But the problem with this is that it applies the same insignia to everbody. I only want to have two separate insignias though, one for pilots and one for infantry. Would it be possible to use classnames, say if it calls for a classname and it returns "b_Helipilot_F" it applies one texture, if it returns anything other than that it applies an other texture?

Share this post


Link to post
Share on other sites

Disregard my previous post. I did some efficient googling and found this,  and by modifying it slightly to this and putting it into onPlayerRespawn.sqf:

 

private ["_RANKICON"];


{_RANKICON = [_x,"texture"] call BIS_fnc_rankParams;


if (_x isKindOf "b_Helipilot_F") then
           {
[[ _x, "160th_patch"], "BIS_fnc_setUnitInsignia", nil, true, true] call BIS_fnc_MP;
}
else
{
[[ _x, "75th_patch"], "BIS_fnc_setUnitInsignia", nil, true, true] call BIS_fnc_MP;
};


} forEAch allunits

No idea how I got it working, but it does. So thank you for your help! 

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

×