Jump to content
  • 0

Monster firing a string of missiles in one direction?


Szuran

Question

I'm trying to make an enemy that, when he spots, you, fires a barrage of bullets - like chaingunner, but using projectiles - but when he starts firing, he continues in one direction until he's done. However, my enemy spirte stays turned to this initial direction, but his projectiles keep aiming at the player. So I can circle around the monster who looks north, but when I'm behind him, he's still shooting at me - from his behind.

 

How to make these projectiles go in a single direction and not chase me?

 

I've removed A_FaceTarget so the enemy sprite acts like it should, but that doesn't help with the projectiles.


Example code:


 

Quote

 

  Missile:
    ZHRT E 20 A_Playsound ("dune/sight")
    ZHRT E 10
    ZHRT FE 2 Bright A_CustomMissile("Bolt",32,0,random(-12,12),0)
    ZHRT F 2
    ZHRT FE 2 Bright A_CustomMissile("Bolt",32,0,random(-12,12),0)
    ZHRT F 2
    ZHRT FE 2 Bright A_CustomMissile("Bolt",32,0,random(-12,12),0)
    ZHRT F 2
    ZHRT FE 2 Bright A_CustomMissile("Bolt",32,0,random(-12,12),0)
    ZHRT F 2
    ZHRT FE 2 Bright A_CustomMissile("Bolt",32,0,random(-12,12),0)
    ZHRT F 2

Goto See

 

 

And the projectile:
 

Quote


ACTOR Bolt
{
  Radius 3
  Height 14
  Speed 34
  FastSpeed 34
  Damage 2
  Projectile
  +RANDOMIZE
  RenderStyle Add
  Alpha 1
  SeeSound "spread"
  Decal "BulletPuff"
  States
  {
  Spawn:
    BOLT A 1 Bright
    Loop
  Death:
    BOLT CDE 1 Bright
    Stop
  }
}

 

 

Share this post


Link to post

2 answers to this question

Recommended Posts

  • 0

Add flag CMF_AIMDIRECTION to your A_CustomMissile actions, this'll make your actor fire the missile in the aim direction rather than at the target:

 

A_CustomMissile("Bolt",32,0,random(-12,12),CMF_AIMDIRECTION)

Edited by tempdecal.wad

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...