Check for Monster Armor

Forum rules
Before asking on how to use a ZDoom feature, read the ZDoom wiki first. If you still don't understand how to use a feature, then ask here.

Please bear in mind that the people helping you do not automatically know how much you know. You may be asked to upload your project file to look at. Don't be afraid to ask questions about what things mean, but also please be patient with the people trying to help you. (And helpers, please be patient with the person you're trying to help!)

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: Check for Monster Armor

Re: Check for Monster Armor

by Blue Shadow » Sun Mar 17, 2019 11:42 am

Okay, switch to using [wiki]CheckActorInventory[/wiki]. It allows you to pass a [wiki]TID[/wiki]:

Code: Select all

enemyarmor = CheckActorInventory(new_tid, "BasicArmor"); 

Re: Check for Monster Armor

by Grey-Wolf » Sun Mar 17, 2019 10:38 am

Blue Shadow wrote:Change s:enemyarmor to d:enemyarmor in the HudMessage call.
Of course, I'm such an idiot -_-"
But still, something's not right. When I spawn an enemy wearing armor and aim at them, I just see a "0" under their health. Then, after some seconds, the zero turns into a "200", no matter the kind of armor they're wearing.

To make things clearer:
This is the updated code for the hud script:
Spoiler:
This is the Custom armor I'm using for the monster:
Spoiler:
And this is the spawn state of said monster:
Spoiler:
Note that I get the same results with other monster and other armor types, so I think the problem is elsewhere.

Re: Check for Monster Armor

by Blue Shadow » Sun Mar 17, 2019 10:13 am

Change s:enemyarmor to d:enemyarmor in the HudMessage call.

Re: Check for Monster Armor

by Grey-Wolf » Sun Mar 17, 2019 6:44 am

Code: Select all

//GET ACTOR INFO
			enemyname = GetActorProperty(new_tid, APROP_NameTag);			//name
			enemyhealthmax = GetActorProperty(new_tid, APROP_SpawnHealth);	//max hp
			enemyhealth = GetActorProperty(new_tid, APROP_HEALTH); 			//current hp
         enemyarmor = Checkinventory("BasicArmor");
			

			//ACTOR HEALTH DISPLAY
		if(GetActorProperty(new_tid, APROP_Speed) > 0)
		{
			if (enemyhealth >= 1)
			{
				//ACTOR NAME DISPLAY
				HudMessage(	s:"", 
						s:enemyname;
						HUDMSG_FADEOUT, 112223, CR_DARKRED, 0.5, 0.02, 0.6, 0.2);
          HudMessage(	s:"\n \n", 
						s:enemyarmor;
						HUDMSG_FADEOUT, 112226, CR_DARKGREY, 0.5, 0.02, 0.6, 0.2);

This doesn't seem to work... instead, it shows me a totally different string, "bars raised." Pretty unsure what could be causing this.

Re: Check for Monster Armor

by Blue Shadow » Thu Mar 14, 2019 11:28 am

Grey-Wolf wrote:Do any of you have some ideas to share?
Yeah, ZScript. Create a function that would allow you to get the information you need about the armor. After you do that, you can use [wiki]ScriptCall[/wiki] to use that function in ACS (if you need to use it in ACS that is).


Edit: If all you want to know is how much armor points the actor has, then you don't need ZScript. You can just use ACS's CheckInventory() while passing "BasicArmor" as the item to check for.

Re: Check for Monster Armor

by Grey-Wolf » Thu Mar 14, 2019 11:14 am

They can. I gave it to them with a_giveinventory in their spawn state, and it works as intended.

Re: Check for Monster Armor

by TDRR » Thu Mar 14, 2019 10:19 am

Um, i'm pretty sure enemies can't carry armor.

Check for Monster Armor

by Grey-Wolf » Sun Mar 10, 2019 1:24 pm

Hello!

I have some free time today, so I'm I'm back at scripting.
Currently, I'm trying to make monsters more diverse by giving them armor based on their features.
I'm using a pre-made script that was included in Brutal Doom to show monster's health when you hover the crosshair over them.
This is the one:
Spoiler:
Now, I want to also show their armor, but as you surely know, GetArmorInfo only works on players. I did some other tests, but nothing worked. Do any of you have some ideas to share?

Top