Jump to content
marker

Pulling Rank Icon From Configfile?

Recommended Posts

Can anyone show me the correct way to pull an icon from the config using rank?

Tried

_rank = rank player;
_rank = getText (configFile >> "Cfgvehicles" >> "rank" >> _rank >> "Icon");

And if possible, is there a page I can visit that will show me the paths available for grabbing stuff from configfile?

Thanks

Share this post


Link to post
Share on other sites

_rIcon = getText (configfile >> "CfgRanks" >> "3" >> "texture"); will give you the path to the texture for a lieutenant.

0 is private, 1 is corporal, 2 is sergeant, etc.

You can find all the paths in the config Viewer, in game.

Share this post


Link to post
Share on other sites

Made a quick script the other day to get a list:

[[config.bin/CfgRanks,"Private","0","","","\A3\Ui_f\data\GUI\Cfg\Ranks\private_gs.paa",""],

[config.bin/CfgRanks,"Corporal","1","","","\A3\Ui_f\data\GUI\Cfg\Ranks\corporal_gs.paa",""],

[config.bin/CfgRanks,"Sergeant","2","","","\A3\Ui_f\data\GUI\Cfg\Ranks\sergeant_gs.paa",""],

[config.bin/CfgRanks,"Lieutenant","3","","","\A3\Ui_f\data\GUI\Cfg\Ranks\lieutenant_gs.paa",""],

[config.bin/CfgRanks,"Captain","4","","","\A3\Ui_f\data\GUI\Cfg\Ranks\captain_gs.paa",""],

[config.bin/CfgRanks,"Major","5","","","\A3\Ui_f\data\GUI\Cfg\Ranks\major_gs.paa",""],

[config.bin/CfgRanks,"Colonel","6","","","\A3\Ui_f\data\GUI\Cfg\Ranks\colonel_gs.paa",""],

[config.bin/CfgRanks,"General","7","","","\A3\Ui_f\data\GUI\Cfg\Ranks\general_gs.paa",""]]

One thing to note is if you click on the .paa in the config viewer then on the preview button - it displays the picture for you.

  • Thanks 2

Share this post


Link to post
Share on other sites

Depends on how you are doing it. If you are fetching the rank of a player and want to display his rank icon you can do:

_rankIcon = [player,"texture"] call BIS_fnc_rankParams;

Or if you are just wanting the rank without passing a player object:

_rankIcon = ["PRIVATE","texture"] call BIS_fnc_rankParams;

BIS_fnc_rankParams description:

/*
Author: Karel Moricky

Description:
Return information about military rank.

Parameter(s):
0:
	NUMBER - rank ID
	STRING - rank system name (e.g. "PRIVATE", "CORPORAL", ...)
	OBJECT - person whos rank is checked
1: STRING - requited data, can be one of following:
	"displayName" - full localized name (e.g. "Major")
	"displayNameShort" - short localized name (e.g. "Maj.")
	"classname" - system name (e.g. "MAJOR")
	"texture" - path to rank insignia

Returns:
STRING
*/

No sense in reinventing the wheel when Moricky already did it inside of ARMA 3.

Edited by Tonic-_-

Share this post


Link to post
Share on other sites

Much obliged guys...

Will give them a try when I get home from work..

Many thanks again.

Share this post


Link to post
Share on other sites

Thanks Tonic.

Works perfectly..

Need to remember the config viewer :)

Share this post


Link to post
Share on other sites
9 minutes ago, TopNinjaGaming said:

Hold on, im confused ccan someone help me out?

Kind of depends what confused you.

Share this post


Link to post
Share on other sites
On October 11, 2013 at 10:37 AM, tonic-_- said:

_rankIcon = [player,"texture"] call BIS_fnc_rankParams;

In player do I put in the variable name or what and in the texture part I put in the past but when I hit enter it brings up and error box

BTW thanks for the quick response 

Share this post


Link to post
Share on other sites

This is only to return the icon, the image of the rank. Nothing else.

What is your goal?

Change the rang?

Set the insignia?

We can't guess...

Share this post


Link to post
Share on other sites

So the basic values: try a hint or copytoclipboard :

 

Hint/copytoclipboard (format["%1",[player,"texture"] call BIS_fnc_rankParams)];

But I would recommend to put that in the debug console.

 This way the path will be in your clipboard or will be shown in a hint.

 

But: way up, there already is a list of the .paa's

Share this post


Link to post
Share on other sites
6 minutes ago, Mokka said:

 

Yes, indeed he has.

I would hope you can see the difference between a joke which is pretty easy to follow as I ended with an emote and a serious suggestion.

Looks like you need to stop this whole god eye thing on my posts.

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

×