Jump to content
Search In
  • More options...
Find results that contain...
Find results in...
  • 0

How do I use DECORATE to check wether a monster has a target?


I'm making some custom monsters, and I want them to be able to change targets very frequently. I wanted to use A_JumpIf to change the monster's behaviour, depending on whether it has a target or not, but I'm not sure how to write that as an expression. Do I just use "target == 0"? Does that work?

Share this post

Link to post

1 answer to this question

Recommended Posts

  • 0

No, that doesn't work.


It really depends on what you want to achieve here. Like, "change targets very frequently"... what does this mean? All monsters have one single target after being woken up in single player: the player. They don't target other monsters unless damaged by that monster.


If you want a monster to switch its target to a monster that just damaged it, use the thing flag QUICKTORETALIATE for immediately retaliation. The Archvile exhibits this behaviour.


You can check which Thing is a monster's current target by having it call a script and use SetActivatorToTarget to switch to its target and examinate. Remember the special use of tid = 0 for meaning the activator of the script, in this case the target of your monster after the SetActivatorToTarget call. You can then switch back to your original activator and use HateThing (or something, forgot) to target a different monster instead.

Share this post

Link to post

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now