Jump to content
🛡️FORUMS ARE IN READ-ONLY MODE Read more... ×
Sign in to follow this  
drunken officer

set Variable from mission to CfgUnitInsignia ?

Recommended Posts

Hello.

I've question. In my addon, i've a class inside the CfgUnitInsignia

class CfgUnitInsignia
{
class DOF_RANK_SYSTEM
{
	displayName = ""; // Name displayed in Arsenal
	author = "Drunken Officer"; // Author displayed in Arsenal
	texture = "\bw_zusatz\texturen\Dienstgrade\gef_ca.paa"; // Image path
	textureVehicle = ""; // Does nothing currently, reserved for future use
};
};
[/Code]

With a script, i check the rank of player and set a this
[code]
.....
case 6 : {DOF_EIGENES_RANKICON_Display_arm = "\bw_zusatz\texturen\Dienstgrade\Fw_ca.paa"};
case 7 : {DOF_EIGENES_RANKICON_Display_arm = "\bw_zusatz\texturen\Dienstgrade\OFw_ca.paa"};
case 8 : {DOF_EIGENES_RANKICON_Display_arm = "\bw_zusatz\texturen\Dienstgrade\HFW_ca.paa"};
.....

Now i tried to set

configFile>>"CfgUnitInsignia">>"DOF_RANK_SYSTEM">>"texture">>DOF_EIGENES_RANKICON_Display_arm;

But it doesnt works. The texture is a string and the DOF_EIGENES_RANKICON_Display_arm is a string too. It's a doubelstring and it'S not possible.

Compiling of DOF_EIGENES_RANKICON_Display_arm returns a code.

Is there a way, to set texture?

At the moment, i've a own class inside the CfgUnitInsignia for each rank. It's monster hpp :mad:

Share this post


Link to post
Share on other sites

//[ player, DOF_EIGENES_RANKICON_Display_arm ] call fnc_setInsignia;

fnc_setInsignia = {

_unit = _this select 0;
_texture = _this select 1;

_uniform = getText ( configFile >> "CfgWeapons" >> uniform _unit >> "ItemInfo" >> "uniformClass" );
{
	if (_x == "insignia") exitWith {
		_unit setVariable [ "bis_fnc_setUnitInsignia_class", "DOF_RANK_SYSTEM", true ];
		_unit setObjectTextureGlobal [ _forEachIndex, _texture ];
	};
}forEach getArray ( configFile >> "CfgVehicles" >> _uniform >> "hiddenSelections" );

};

modified from the BIS_fnc_setUnitInsignia. Is this what your trying to do?

Its not possible to inject the texture path back into the config but you can use setObjectTextureGlobal to set the units arm patch.

Edited by Larrow

Share this post


Link to post
Share on other sites

setovjecttextureglobal, yeah. Sometimes, i'm really blind.

It's so simple...

Edited by Drunken Officer

Share this post


Link to post
Share on other sites
Sign in to follow this  

×