Name of weapons in color

Discussions about Chaos mapping for the UT series.
Post Reply
bebertc
Posts: 7
Joined: Sun Nov 02, 2003 12:33 am

Name of weapons in color

Post by bebertc »

Hello, i'm scripting for ut2k3 and I have a problem: I can't find the part of the code which tells to the game which color applying for the name of the weapons (when I play with hidden weapons), like "assault rifle" in pink, "rocket launcher" in red, "bio rifle" in blue...
Can someone help me, please?
Shuri
Chaotic Dreams Team
Posts: 1183
Joined: Tue Jun 10, 2003 7:27 pm
Location: india
Contact:

Post by Shuri »

I do not know this for sure, but it looks like it. In the base weapon class (like AssaultRifle.uc in this example, in defaultproperties:

Code: Select all

HudColor=(r=255,g=128,b=192,a=255)
Hope this helps.
bebertc
Posts: 7
Joined: Sun Nov 02, 2003 12:33 am

Post by bebertc »

Thanks Shuriken, that's what I was searching for.
Bye
bebertc
Posts: 7
Joined: Sun Nov 02, 2003 12:33 am

Post by bebertc »

I tried to change Hudcolor, but it doesnt change the color of weapons' name, and hudcolor doesn't match with the color of each weapon3... :cry:
jb
Posts: 9825
Joined: Fri May 03, 2002 12:29 am
Location: Coral Springs, FL
Contact:

Post by jb »

The HUDColor Is used by the base hud to change the weapon name:

Code: Select all

simulated function DrawWeaponName(Canvas C)
{
	local string CurWeaponName;
    local float XL,YL, Fade;

	if (bHideWeaponName)
    	return;

	if (WeaponDrawTimer>Level.TimeSeconds)
    {
	    C.Font = GetMediumFontFor(C);
        C.DrawColor = WeaponDrawColor;

		Fade = WeaponDrawTimer - Level.TimeSeconds;

        if (Fade<=1)
        	C.DrawColor.A = 255 * Fade;


		C.Strlen(LastWeaponName,XL,YL);
        C.SetPos( (C.ClipX/2) - (XL/2), C.ClipY*0.8-YL);
        C.DrawText(LastWeaponName);
    }

	if (  PawnOwner==None || PawnOwner.PendingWeapon==None )
    	return;

	CurWeaponName = PawnOwner.PendingWeapon.GetHumanReadableName();
    if (CurWeaponName!=LastWeaponName)
    {
    	WeaponDrawTimer = Level.TimeSeconds+1.5;
        WeaponDrawColor = PawnOwner.PendingWeapon.HudColor;
    }

   	LastWeaponName = CurWeaponName;
}
So changing the weapon's hudcolor should work...if its not post the code and we can try to see if we can help more.
Jb
bebertc
Posts: 7
Joined: Sun Nov 02, 2003 12:33 am

Post by bebertc »

it works when I change the value directly in the game code, but is it possible to change the hudcolor from the user.ini?
jb
Posts: 9825
Joined: Fri May 03, 2002 12:29 am
Location: Coral Springs, FL
Contact:

Post by jb »

Dont think so...you can change the crosshair color but thats about it AFAIK
Jb
bebertc
Posts: 7
Joined: Sun Nov 02, 2003 12:33 am

Post by bebertc »

It's working with user.ini...but there another problem: how to execute a console command from user.ini?
Post Reply