Jump to content
  • 0

How to stop "monster" from turning towards target during attack


asd1994

Question

What I'm trying to do is make a statue actor that does an archvile attack when you step into it's view. However I can't get it to not constantly turn towards the player once it's alerted. I want to get it to where it only ever faces a single direction so the player wouldn't be attacked if they run behind it. Any suggestions? Is this even possible to do? 

 

Here's what I have so far:

 

ACTOR Sentry 1963
{
    Radius 20
    Height 56
    MaxTargetRange 896
    +FLOORCLIP
    +NOTARGET
    +MISSILEMORE
    +MISSILEEVENMORE
    +SOLID
    Obituary "A Sentry spotted %o"
    States
    {
    Spawn:
        SENT A 1 A_Look
        Loop
    See:
        SENT A 1 A_Chase (0,"Missile",CHF_DONTMOVE|CHF_DONTTURN)
        Loop
    Missile:
        SENT A 8 A_VileTarget
        SENT A 48
        SENT A 8 A_VileAttack
        Goto See
    }
}

Share this post


Link to post

4 answers to this question

Recommended Posts

  • 0

Both A_VileTarget and A_VileAttack do call A_FaceTarget within them.

 

I would suggest saving old angle into a variable, before the A_VileTarget is called, and restore this angle immidiatly after calling A_VileTarget and A_VileAttack.

Share this post


Link to post
  • 0
1 minute ago, jaeden said:

Both A_VileTarget and A_VileAttack do call A_FaceTarget within them.

 

I would suggest saving old angle into a variable, before the A_VileTarget is called, and restore this angle immidiatly after calling A_VileTarget and A_VileAttack.

That sounds interesting, but how would I do that?

Share this post


Link to post
  • 0
17 hours ago, jaeden said:

Save into user variable

https://zdoom.org/wiki/User_variable

https://zdoom.org/wiki/A_SetUserVar

 

then restore angle by A_SetAngle.

 

 

Tho this way should prevent it from turning, but it still could attack player that is behind. I don't currently know how to solve it without zscript.

I'm a bit confused. It seems like user variables are for inventory stuff rather than an actor's angle or anything else.

Share this post


Link to post

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Answer this question...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...