[SBARINFO] Armor "mugshot"

Moderator: GZDoom Developers

User avatar
Project Dark Fox
Posts: 9369
Joined: Thu Jul 14, 2005 8:33 pm
Twitch ID: ProjectDarkFox
Graphics Processor: nVidia with Vulkan support
Location: Blacksburg, SC USA

[SBARINFO] Armor "mugshot"

Post by Project Dark Fox »

It'll be a lot easier to do for editors than, say, a more "live" mugshot. But basically, think of an icon or graphic that degrades as it takes damage. One example is to put the shoulder pads of DoomGuy's green armor on, and as it absorbs more and more damage it gets worn down.
Each armor type would need its own set of icons/graphics instead of using one, so a line of DECORATE may be needed for SBARINFO to know what graphics to pull up -- and give the status bar that much more of an aesthetic appeal.

In SBARINFO:

Code: Select all

drawarmor [levels of condition], [maximum armor to honor], [X], [Y];
In DECORATE:

Code: Select all

armor.icon [sprite]
Graphics would take a numeric approach like mugshots. GREEN0, 1, 2, 3, 4, etc.

Discuss.
User avatar
Nash
 
 
Posts: 17283
Joined: Mon Oct 27, 2003 12:07 am
Twitch ID: nashmuhandes
Github ID: nashmuhandes
Location: Kuala Lumpur, Malaysia

Re: [SBARINFO] Armor "mugshot"

Post by Nash »

I have this disturbing imagination right now... what if the armor icon turns to face the direction of damage just like the mugshot...

(Picture an icon resembling a man's chest, constantly turning left and right)

XD
Gez
 
 
Posts: 17636
Joined: Fri Jul 06, 2007 3:22 pm

Re: [SBARINFO] Armor "mugshot"

Post by Gez »

While we're talking about armor and sbarinfo, I don't think sbarinfo has a way to know which armor type you are wearing -- since in your inventory, all you have is a [wiki=Classes:BasicArmor]BasicArmor[/wiki]. I added functions to identify armor type in [wiki=A_JumpIfArmorType]DECORATE[/wiki] and [wiki=GetArmorType]ACS[/wiki], but I didn't touch sbarinfo and I don't think it's been added to it since.
User avatar
Project Dark Fox
Posts: 9369
Joined: Thu Jul 14, 2005 8:33 pm
Twitch ID: ProjectDarkFox
Graphics Processor: nVidia with Vulkan support
Location: Blacksburg, SC USA

Re: [SBARINFO] Armor "mugshot"

Post by Project Dark Fox »

Then how come an icon of what you're wearing shows up on both the full-screen and alternate HUDs?
Gez
 
 
Posts: 17636
Joined: Fri Jul 06, 2007 3:22 pm

Re: [SBARINFO] Armor "mugshot"

Post by Gez »

Project Dark Fox wrote:Then how come an icon of what you're wearing shows up on both the full-screen and alternate HUDs?
Simply put, the player has a BasicArmor item in his inventory. Inventory items have several properties, including one that's the icon.

Here is what happens when you use a BasicArmorPickup (keep in mind that armors from Doom and Heretic are used immediately when picked up):

Code: Select all

bool ABasicArmorPickup::Use (bool pickup)
{
	ABasicArmor *armor = Owner->FindInventory<ABasicArmor> ();

	if (armor == NULL)
	{
		armor = Spawn<ABasicArmor> (0,0,0, NO_REPLACE);
		armor->BecomeItem ();
		Owner->AddInventory (armor);
	}
	else
	{
		// If you already have more armor than this item gives you, you can't
		// use it.
		if (armor->Amount >= SaveAmount + armor->BonusCount)
		{
			return false;
		}
		// Don't use it if you're picking it up and already have some.
		if (pickup && armor->Amount > 0 && MaxAmount > 0)
		{
			return false;
		}
	}
	armor->SavePercent = SavePercent;
	armor->Amount = SaveAmount + armor->BonusCount;
	armor->MaxAmount = SaveAmount;
	armor->Icon = Icon;
	armor->MaxAbsorb = MaxAbsorb;
	armor->MaxFullAbsorb = MaxFullAbsorb;
	armor->ArmorType = this->GetClass()->TypeName;
	return true;
}
Scroll down to see this line:

Code: Select all

	armor->Icon = Icon;
So it's not the status bar code that knows which icon to use, it's simply the BasicArmor's icon that's updated.
User avatar
Project Dark Fox
Posts: 9369
Joined: Thu Jul 14, 2005 8:33 pm
Twitch ID: ProjectDarkFox
Graphics Processor: nVidia with Vulkan support
Location: Blacksburg, SC USA

Re: [SBARINFO] Armor "mugshot"

Post by Project Dark Fox »

Interesting. See, I don't look at the source, because I wouldn't know where to look. Else I'd probably make much wiser feature suggestions and patches for them on the go.
Though... this isn't out of the question yet, I hope?
User avatar
DoomRater
Posts: 8265
Joined: Wed Jul 28, 2004 8:21 am
Discord: DoomRater#6308
Location: WATR HQ

Re: [SBARINFO] Armor "mugshot"

Post by DoomRater »

I do need the ability to do different things in the HUD based on what type of armor the player is wearing so if that could be added that'd be great.

Return to “Closed Feature Suggestions”