Hinny 0 Posted April 16, 2004 Ok, this is for MP games. For my squad there are various people of different ranks, and I would like to make these ranks displayable in game. I have a way of doing this in script form, but the tricky bit is assigning them to players. As we don't necessarily know who will be playing the game that evening it's impossible to edit the mission so the appropriate script for each person is initiated in the unit's init line. Instead I want to create a 'rank box', like an ammo box except people go up to it, pick the appropriate rank and have the appropriate script run to display it. However I have no clue as how to code this. Anyone care to help? Share this post Link to post Share on other sites
MrZig 0 Posted April 16, 2004 In init.sqs put something like <table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE">_Captain = "mrzig" _Sarge = "gutterfunk" _Private = "zig566" ?(Name player == _Captain) : hint format ["You are Captain %1",name player] ?(Name player == _Sarge) : hint format ["You are Seargent %1",name player] ?(Name player == _Private) : hint format ["You are Private %1",name player] Something along those lines, I think your trying to do that. Share this post Link to post Share on other sites
Hinny 0 Posted April 16, 2004 That would actually be quite good, not quite what I was looking for, but good nonetheless However it suffers one problem. I want it to work globally rather than just locally. With that method the assigned textures only appear to the person they were activated on, whereas I want everyone to see them. Share this post Link to post Share on other sites
Hinny 0 Posted April 16, 2004 Here's the code I'm using. <table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE">_Bob = "[CPL] Bob" _Joe = "[CPL] Joe" _Tim = "[LCP] Tim" _Tom = "[LCP] Tom" #CPL ?(Name player == _Bob) : player setObjectTexture [2,"\rank_cpl.paa"] ?(Name player == _Joe) : player setObjectTexture [2,"\rank_cpl.paa"] #LCP ?(Name player == _Tim) : player setObjectTexture [2,"\rank_lcpl.paa"] ?(Name player == _tom) : player setObjectTexture [2,"\rank_lcpl.paa"] Share this post Link to post Share on other sites
MrZig 0 Posted April 16, 2004 I thought init.sqs IS completley public? Er, nevermind, I see.. Share this post Link to post Share on other sites
Hinny 0 Posted April 16, 2004 It is public, but the script only initiates the texture for the player, rather than everyone else too. Share this post Link to post Share on other sites
Hinny 0 Posted April 16, 2004 Woo, took me some time but I've done it Thanks for your help. Share this post Link to post Share on other sites
Hinny 0 Posted April 17, 2004 I did the same as I orignally posted but also added the lines: <table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE">?(name player == Bob) : a = player; publicvariable "a" ?(name player == Joe) : b = player; publicvariable "b" ?(name player == Tim) : c = player; publicvariable "c" ?(name player == Tom) : d = player; publicvariable "d" Then called another script with the lines: <table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE">a setObjectTexture [2,"\rank_cpl.paa"] b setObjectTexture [2,"\rank_cpl.paa"] c setObjectTexture [2,"\rank_lcpl.paa"] d setObjectTexture [2,"\rank_lcpl.paa"] Share this post Link to post Share on other sites
vektorboson 8 Posted April 17, 2004 Hi, there is another possibility: All units have a "rating" which you get through the rating-command. The higher the rank the higher the initial rating. Just look for the initial rating (I can't provide you the rating for every rank, you can find them out yourself ) Share this post Link to post Share on other sites
Hinny 0 Posted April 17, 2004 Ah, but for that you'd have had to set the original unit ranks which would kinda go against the point of this script. Which is to allow players to have the right rank slide despite what slot they decide to put themselves in MP games. Share this post Link to post Share on other sites