Always hostile monster flag?

Archive of the old editing forum
Forum rules
Before asking on how to use a ZDoom feature, read the ZDoom wiki first. This forum is archived - please use this set of forums to ask new questions.
Locked
User avatar
Jaxxoon R
Posts: 772
Joined: Sun May 04, 2014 7:22 pm

Always hostile monster flag?

Post by Jaxxoon R »

Is there any sort of decorate flag that will make a monster seek out and attack any monster/player it sees?
User avatar
edward850
Posts: 5890
Joined: Tue Jul 19, 2005 9:06 pm
Location: New Zealand
Contact:

Re: Always hostile monster flag?

Post by edward850 »

No. Your only option is [wiki]Thing_Hate[/wiki]. Anything more than that would require some rather expensive lookups.
User avatar
Matt
Posts: 9696
Joined: Sun Jan 04, 2004 5:37 pm
Preferred Pronouns: They/Them
Operating System Version (Optional): Debian Bullseye
Location: Gotham City SAR, Wyld-Lands of the Lotus People, Dominionist PetroConfederacy of Saudi Canadia
Contact:

Re: Always hostile monster flag?

Post by Matt »

Would it be possible to constantly toggle +friendly before every A_Look call, so that one frame it's looking for monsters and the next frame it's looking for players?
User avatar
edward850
Posts: 5890
Joined: Tue Jul 19, 2005 9:06 pm
Location: New Zealand
Contact:

Re: Always hostile monster flag?

Post by edward850 »

A_Look actually doesn't look for monsters if a friendly monster isn't already awake.
User avatar
Fishytza
Posts: 793
Joined: Wed Feb 23, 2011 11:04 am
Preferred Pronouns: They/Them
Contact:

Re: Always hostile monster flag?

Post by Fishytza »

Odd.
I just tested a small test map where a friendly cyberdemon would attack a bunch of barons as soon as the map starts (you would hear the iconic MOOO!) while the player was out of the cyberdemon's signt.

Specifically, cybie and the barons were in one enclosed sector while the player starts were in another enclosed sector.
(You couldn't reach the other sector without noclipping.)

So, could you please elaborate what you mean by "isn't already awake"?
User avatar
Matt
Posts: 9696
Joined: Sun Jan 04, 2004 5:37 pm
Preferred Pronouns: They/Them
Operating System Version (Optional): Debian Bullseye
Location: Gotham City SAR, Wyld-Lands of the Lotus People, Dominionist PetroConfederacy of Saudi Canadia
Contact:

Re: Always hostile monster flag?

Post by Matt »

Either way I think this could be a workaround:
Spoiler:
User avatar
edward850
Posts: 5890
Joined: Tue Jul 19, 2005 9:06 pm
Location: New Zealand
Contact:

Re: Always hostile monster flag?

Post by edward850 »

FishyClockwork wrote:So, could you please elaborate what you mean by "isn't already awake"?
Seems the behavior might have changed, because looking at the code now, FRIENDLY monsters will look for monsters within the next 10 blocks. What hasn't changed, however, is the inverse (normal monsters don't look for friendly ones, regardless of possible sight).
User avatar
Fishytza
Posts: 793
Joined: Wed Feb 23, 2011 11:04 am
Preferred Pronouns: They/Them
Contact:

Re: Always hostile monster flag?

Post by Fishytza »

Actually, Vaecrius, I think your first idea about toggling FRIENDLY before calling A_Look seems to make more sense.

Here's a working example:

Code: Select all

Actor RabidCyberdemon : Cyberdemon
{
	States
	{
	Spawn:
		CYBR AB 10 A_GiveInventory("LookForAnything")
		Loop
	}
}

Actor LookForAnything : CustomInventory
{
	States
	{
	Pickup:
		TNT1 A 0 A_RearrangePointers(AAPTR_NULL) //Clear false positives for A_CheckFlag
		//A_ClearTarget also clears 'LastHeard' which isn't wanted
		TNT1 A 0 A_Look //Look for players
		TNT1 A 0 A_CheckFlag("SHOOTABLE", "DoneLooking", AAPTR_TARGET)
		TNT1 A 0 A_ChangeFlag("FRIENDLY", 1)
		TNT1 A 0 A_Look //Look for monsters
		TNT1 A 0 A_ChangeFlag("FRIENDLY", 0)
	DoneLooking:
		TNT1 A 0
		Stop
	}
}
Locked

Return to “Editing (Archive)”