Always hostile monster flag?
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.
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.
Always hostile monster flag?
Is there any sort of decorate flag that will make a monster seek out and attack any monster/player it sees?
Re: Always hostile monster flag?
No. Your only option is [wiki]Thing_Hate[/wiki]. Anything more than that would require some rather expensive lookups.
- 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?
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?
Re: Always hostile monster flag?
A_Look actually doesn't look for monsters if a friendly monster isn't already awake.
Re: Always hostile monster flag?
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"?
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"?
- 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?
Either way I think this could be a workaround:
Spoiler:
Re: Always hostile monster flag?
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).FishyClockwork wrote:So, could you please elaborate what you mean by "isn't already awake"?
Re: Always hostile monster flag?
Actually, Vaecrius, I think your first idea about toggling FRIENDLY before calling A_Look seems to make more sense.
Here's a working example:
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
}
}