How to make those ranks appear on either sleeves or torso?


(*NOB* Perica) #1

I did a search on this forum but there was no specific mention of the exact procedure.
I’m using both Milkshape and 3dmax but I don’t know how can I attach the rank_helmet.md3 to sleeves (arms) or body (torso).

Any ideas?

Thx,

PP


(ikanatto) #2

In cg_players.c near line 2120


				case ACC_HAT:			//hat
				case ACC_RANK:
					if( cent->currentState.eFlags & EF_HEADSHOT ) {
						continue;
					}
				case ACC_MOUTH2:		// hat2
				case ACC_MOUTH3:		// hat3					

					if( i == ACC_RANK ) {
						if( ci->rank == 0 ) {
							continue;
						}
						acc.customShader = rankicons[ ci->rank ][ 1 ].shader;
					}

					CG_PositionEntityOnTag( &acc,	&head,	"tag_mouth", 0, NULL);
					break;

This should be the code to attach a rank model to “tag_mouth” of head model.
I think that changing &head and “tag_mouth” would fill your purpose.


([RW]FRED) #3

If you want add ranks on a body part (sleeves, arms or whatever u want) u have two solutions
1 - Modify player models and add tags in the good place, it’s possible if u have skill to modify player models with ikanatto hack tools
2 - modify player skin + creating associated shader to draw on player model in on pass two shader.
instead drawing the default skin given from body_XXXX.skin, u must create a skin file body_XXXX_R1.skin to body_XXXX_R7.skin with in each file for tag u_body or u_rthand… u specify a shader corresponding to the rank.

example

body_engineer_r1.skin

md3_back, “models/players/temperate/axis/engineer/acc/backpack.md3”
md3_hat, “models/players/temperate/axis/helmet.md3”
md3_rank, “models/players/temperate/common/rank_helmet.md3”

l_legs, “models/players/temperate/axis/legs01.tga”
u_body, “models/players/temperate/axis/engineer/body_engineer_r1”
u_rthand, “models/players/temperate/axis/body_r1”
u_lfthand, “models/players/temperate/axis/body_r1”

md3_back, “models/players/temperate/axis/engineer/acc/backpack.md3”
md3_hat, “models/players/temperate/axis/helmet.md3”
md3_rank, “models/players/temperate/common/rank_helmet.md3”

l_legs, “models/players/temperate/axis/legs01.tga”
u_body, “models/players/temperate/axis/engineer/body_engineer_r2”
u_rthand, “models/players/temperate/axis/body_r2”
u_lfthand, “models/players/temperate/axis/body_r2”

etc.

becareful, skin names are 64 cars max length.

to apply skin corresponding to the player ranking, explore CG_Payer and affect customshader to the according shader

regards


(*NOB* Perica) #4

Wow! Thanks guys!


([RW]FRED) #5

you are welcome


(*NOB* Perica) #6

In the cg_players.c I changed

CG_PositionEntityOnTag( &acc, &head, “tag_mouth”, 0, NULL);
break;

to

CG_PositionEntityOnTag( &acc, &body, “tag_u_rthand”, 0, NULL);
break;

and the rank DID appear on the right hand but both with the helmet attached to it ?
Oups! :clap:


(No1_sonuk) #7

Ermm. The rank panel is a part of the helmet model - there’s a square of model geometry that the rank shader is pasted onto.

You’re better off trying to change the shaders used on the arms.