Monster Targeting Preferences?

Discuss anything ZDoom-related that doesn't fall into one of the other categories.
Post Reply
User avatar
Boingo_the_Clown
Posts: 139
Joined: Mon Sep 17, 2012 7:25 am
Location: Canada
Contact:

Monster Targeting Preferences?

Post by Boingo_the_Clown »

Is it possible to set up character classes in a way that monsters will attack one class more often than the other?

For example: A barbarian and a hobbit walk into a room full of goblins. The goblins see the barbarian as a bigger threat, and will attack the barbarian more often. So when the barbarian and the hobbit encounter the goblins, each goblin has a 75% chance of targeting the barbarian, and only a 25% chance of targeting the hobbit.

Is this possible?
User avatar
Cherno
Posts: 1311
Joined: Tue Dec 06, 2016 11:25 am

Re: Monster Targeting Preferences?

Post by Cherno »

You could override Tick() of the monster and inside, check for different player classes via CheckProximity or LineTrace or whatever, add them to an array if found and then use the array contents to determine which player class to target.

So, yes, it's possible if you know how to zScript.
Post Reply

Return to “General”