ZDoom Line Specials

177:Thing_Hate

Name

Thing_Hate — controls what or who a monster hates.

Synopsis

Thing_Hate (hater, hatee, type);
Thing_Hate (
  hater,     // TID of the monsters to do the hating
  hatee,     // TID of the monsters to be hated
  type       // Modifies how hater hates hatee
);

Parameters

hater
Every monster with this Thing ID will hate anything with Thing ID hatee.
hatee
Anything with this Thing ID will be hated by monsters with Thing ID hater. The hatee monsters will not normally attack the hater monsters without being struck first. If you want them to also hate the hater monsters, you need to use another Thing_Hate special with the hater and hatee parameters swapped.
type
Controls the behavior of the hater monsters. It can be one of the following values:
ValueDescription
0 Just hate the first actor with TID hatee. Once it is dead, the monster will behave normally, as if Thing_Hate had never been used on it.
1 Hate every actor with TID hatee. Whenever a monster with TID hatee comes into view, it will be attacked. If the hated monster dies, the hater will attack other hatee monsters it can see, or it will wait for more to come into view if it cannot see any. The hater monster will attack a player if the player attacks it first, but it will not actively hunt players.
2 This type is like 1, except the hater monster will not wait for hatee monsters to come into view before chasing after them. If it can find a target with TID hatee on the other side of the map, it will go after it, whether it can see the hatee or not, although it will prefer to attack closer hatees over far ones.
3 This is the same as hate type 1, except the monster will actively hunt players as well as hatee actors. It does not wait for the player to first attack before retaliating.
4 This is like hate type 3, but like type 2, the hater monster will chase after targets even if it cannot see them first.
5 This is like hate type 1, except the monster completely ignores players. A player can kill monsters with this hate type, and the monster will never retaliate.
6 This is like hate type 5, but the hater monster will chase after hatees even if it cannot see them.

Except for hate type 0, the odd-numbered types cause the haters to wait until they can see a hatee before chasing after it, and the even-numbered types make the haters immediately go after hatees, whether they can be seen or not.

ACS

This special works equally well whether you use it in a script or on a line, although it is probably most useful in a script.

Remarks

Although this special will usually be used to pit groups of monsters against each other, hatee does not necessarilly need to refer to a monster. It only needs to be shootable for a hater to attack it. Thing 9076 has been provided so that you can make monsters attack some part of the level. It is an invisible, shootable thing that you can use with Thing_Hate. Its angle determines how much health it has; give it an angle of 1 degree, and it has 10 points; 2 degrees will give it 20 points; etc. If its angle is 0, then it has infinite health and never dies. If it dies, then it will execute its death special.

To return a monster to its normal behavior of hating only players and ignoring other monsters unless attacked, you can use Thing_Hate with hatee and type both set to 0.

Examples

Make monsters with TID 4 hunt other things with TID 5 and ignore the player:

Thing_Hate (4, 5, 6);

Make monsters with TIDs 4 and 5 attack each other, as well as the player, on sight:

Thing_Hate (4, 5, 3);
Thing_Hate (5, 4, 3);

Make monsters with TID 3 hunt the player without waiting for the player to come into view first:

Thing_Hate (3, 0, 4);

Make monsters with TID 6 attack anything with TID 10 on sight, but ignore players unless players attack them:

Thing_Hate (6, 10, 1);

Remove the effect of any previous Thing_Hate on monsters with TID 8:

Thing_Hate (8, 0, 0);

First Available In

ZDoom 2.0.???
ZDoom 2.0.37 added hate types 1 and 2
ZDoom 2.0.38 added hate types 3–6

See Also