Page 1 of 1

How can I do an "IfHealth" Statement but with armor?

Posted: Mon Jul 16, 2018 7:59 am
by yunoguy123
This is something with SBARINFO, The hud I have is Similar to the resident evil hud, showing Healthy, Okay, Hurt, Critical, and dead. How can I do the same thing with armor?

Re: How can I do an "IfHealth" Statement but with armor?

Posted: Mon Jul 16, 2018 8:12 am
by Ænima
IIRC, you can just do a simple inventory check for “BasicArmor”.

Re: How can I do an "IfHealth" Statement but with armor?

Posted: Mon Jul 16, 2018 8:40 am
by yunoguy123
No, that doesnt seem to work. I made a check for it and after messing about with it for a while I cant get that to work.
If i did it using InInventory It either would not pop up or it would pop it up but never go away after a certain point.

Re: How can I do an "IfHealth" Statement but with armor?

Posted: Mon Jul 16, 2018 12:01 pm
by Ænima
Did you try just “Armor”, then?

Start a game, pick up an armor bonus or green armor and type “PrintInv” in the console. It’s one of the things that gets listed when you do that.

I did an armor amount check in Super Skulltag’s hud, it changes the color of the armor bar from green to blue if you have more than 100.

Re: How can I do an "IfHealth" Statement but with armor?

Posted: Mon Jul 16, 2018 7:49 pm
by yunoguy123
Thats what I originally tried because basic armor did nothing and Armor caused errors.

Re: How can I do an "IfHealth" Statement but with armor?

Posted: Tue Jul 17, 2018 12:35 am
by yunoguy123
Okay, im going to give this another shot, see if im missing anything
I LOVE super skulltag by the way

Re: How can I do an "IfHealth" Statement but with armor?

Posted: Tue Jul 17, 2018 1:01 am
by yunoguy123
Okay, so heres how i did it

Code: Select all

			Ifhealth not 1%
	{
	DrawString CONFONT, RED, "Dead", -600,420;
	}
	else
		Ifhealth not 26%
	{
	DrawString CONFONT, RED, "Critical", -600,420;
	}
	else
	Ifhealth not 51%
	{
	DrawString CONFONT, RED, "Hurt", -600,420;
	}
	else
		Ifhealth not 76%
	{
	DrawString CONFONT, RED, "Okay", -600,420;
	}
	else
		Ifhealth not 101%
	{
	Drawstring CONFONT, RED, "Healthy", -600,420;
	}
	
I tried to do that but like this

Code: Select all

	InInventory not armor, 25
	{
	Drawstring CONFONT, RED, "Testing 1", -100, -100;
	}
	else
		InInventory not armor, 50
	{
	Drawstring CONFONT, RED, "Testing 2", -150, -150;
	}
	
Does NOT work.

Re: How can I do an "IfHealth" Statement but with armor?

Posted: Fri Jul 20, 2018 11:10 am
by yunoguy123
Turns out this is a GZDOOM issue not a zandronum issue. sorry.