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

Modifying monster sight.

Question

Hello,

 

So I have been working on a good stealth mechanic for a while now but what has really been bugging me is that once the monster sights the player it immediately attacks.

 

Now what I want to do is if the player peeks around the corner and sees that a monster, he has 3 seconds to go back to cover before the monster attacks him or goes into search mode.

 

Any ideas would be appreciated!

 

Share this post


Link to post

4 answers to this question

Recommended Posts

  • 1

Are you using DECORATE or ZScript? (Or something else!) It sounds like you want a variable attached to the actor that will get incremented while the actor is in its “See” loop, continuously checking for line of sight to the player, and then to break out of that loop if the variable reaches over 105 (105 tics = 3 seconds)

Share this post


Link to post
  • 0
34 minutes ago, DavidN said:

Are you using DECORATE or ZScript? (Or something else!) It sounds like you want a variable attached to the actor that will get incremented while the actor is in its “See” loop, continuously checking for line of sight to the player, and then to break out of that loop if the variable reaches over 105 (105 tics = 3 seconds)

 

I am using ZScript. But yes, that does sound like it might work.

 

Share this post


Link to post
  • 0

don#t know about zscript but here's what you can do with decorate alone

use an alternate state for the actual chase function and use the see state just for pause and after the pausecheck if the player is still in sight with A_LookEx, and send him to the chase state and type goto spawn in case the player isn't in sight anymore

something like this:

Spawn:
	WALK A 0 A_Wander
	WALK ABCD 5 A_Look
	Loop
See:
	IDlE A 1 A_Facetarget
	IDLE A 50
	IDlE A 1 A_LookEx(LOF_NOSOUNDCHECK, 0, 256, 0, 180, "Chase")
	goto Spawn
Chase:
	CHSE ABCD 5 A_Chase
	Loop

 

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
×