Monster Targeting Preferences?

Discuss anything ZDoom-related that doesn't fall into one of the other categories.

Monster Targeting Preferences?

Postby Boingo_the_Clown » Fri May 17, 2019 10:25 am

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
Boingo_the_Clown
 
Joined: 17 Sep 2012
Location: Canada

Re: Monster Targeting Preferences?

Postby Cherno » Fri May 17, 2019 10:58 am

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.
User avatar
Cherno
 
Joined: 06 Dec 2016


Return to General

Who is online

Users browsing this forum: Discord [Bot], furyweb, Google [Bot], Undead and 2 guests