[SBARINFO] Armor "mugshot"

Post a reply

Smilies
:D :) :( :o :shock: :? 8-) :lol: :x :P :oops: :cry: :evil: :twisted: :roll: :wink: :geek: :ugeek: :!: :?: :idea: :arrow: :| :mrgreen: :3: :wub: >:( :blergh:
View more smilies

BBCode is OFF
Smilies are ON

Topic review
   

Expand view Topic review: [SBARINFO] Armor "mugshot"

Re: [SBARINFO] Armor "mugshot"

by DoomRater » Tue Sep 08, 2009 12:17 am

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.

Re: [SBARINFO] Armor "mugshot"

by Project Shadowcat » Mon Sep 07, 2009 9:37 am

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?

Re: [SBARINFO] Armor "mugshot"

by Gez » Mon Sep 07, 2009 9:07 am

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.

Re: [SBARINFO] Armor "mugshot"

by Project Shadowcat » Mon Sep 07, 2009 8:51 am

Then how come an icon of what you're wearing shows up on both the full-screen and alternate HUDs?

Re: [SBARINFO] Armor "mugshot"

by Gez » Mon Sep 07, 2009 6:09 am

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.

Re: [SBARINFO] Armor "mugshot"

by Nash » Mon Sep 07, 2009 6:03 am

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

[SBARINFO] Armor "mugshot"

by Project Shadowcat » Sun Sep 06, 2009 11:21 pm

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.

Top