Jump to content
Search In
  • More options...
Find results that contain...
Find results in...
Sign in to follow this  
Sigvatr

Automatically chase the player

Recommended Posts

Hey,

Is there a way to make a monster automatically chase the player even if he hasn't seen him? If distracted, I want the monster to get involved in the infighting too, but initially, I want the monster to start chasing the player no matter where he is.

Any ideas?

Share this post


Link to post

You could have it so the monster can see the player from the start, but that would get kinda nasty with hidden "sight tunnels" everywhere. Alternatively, you could use ZDoom's Thing_Hate() function in a script at level start.

Actually this is something I did recently and never really thought much of it. You could use dehacked to make select monster types skip to their seeking frames. I'm unsure of how this works in all ports, though. Only tested it in ZDoom and ZDaemon, but theoretically, it should work in any port.

Share this post


Link to post

Will the monsters attack eachother if they get caught in cross fire, or will they ignore it to attack the player?

Share this post


Link to post
Sigvatr said:

Will the monsters attack eachother if they get caught in cross fire, or will they ignore it to attack the player?


I think Thing_Hate has different degrees of hate, you'll have to look at the ZDoom wiki for information on the various settings.

    * Thing_Hate (hater, hatee, hate type) 

Hater: The TID of the Hater (monster that will hate and attack)
Hatee: The TID of the Hatee (monster that is to be hated by the hater)
Hate Type: The type of hate that this will be >    
       0 - Just hate one specific actor
       1 - Hate actors with given TID and attack players when shot
       2 - Same as 1, but will go after enemies without seeing them first
       3 - Hunt actors with given TID and also players
       4 - Same as 3, but will go after monsters without seeing them first
       5 - Hate actors with given TID and ignore player attacks
       6 - Same as 5, but will go after enemies without seeing them first

Share this post


Link to post

Alright.

How do I set the hate target to be the player? I set it to the player spawn point and it didn't work :(

Share this post


Link to post

Hmm, good question. Usually a TID of zero affects the activator of the script, but in this case, you might try to assign a TID to the player starts and use that. Other than that, I don't know what else to suggest to you, other than the dehacked thing.

EDIT: Zero it is: http://www.zdoom.org/wiki/Thing_Hate

Share this post


Link to post

Make the monster go straight into it's active state so it will move towards the player using Dehacked?

(for once the "Uhhhhh" actually fits)

Share this post


Link to post
deathbringer said:

Make the monster go straight into it's active state so it will move towards the player using Dehacked?


Yup. It works in ZDaemon and ZDoom, but in ZDaemon it can get kinda tricky if you have more than one player on the server. They seem to always go after the first player unless they see another player.

Share this post


Link to post

I was gonna say you could replicate the map "Hunted" from plutonia, where the monsters (archviles) see you at the start, and then walk into a teleport that warps them to some other part of the map.

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
Sign in to follow this  
×