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

How to make a spreadshot weapon?

Question

Posted (edited)

I want to make a weapon that fires a cluster of projectiles that either

 

1. go in an arc (left projectile travels 45 degrees left, middle goes straight, right goes 45 degrees right) 

 

Or

 

2. Travel like a wide wall of projectiles but when some of them get caught in a wall or enemy, the rest keeps going.

 

I have no idea if the 1st one is even possible. But what about the 2nd? Should I spawn like 10 projectiles with every shot, each touching the one next to it? Could you help me code it?

 

Here is a very rough visualization of what i mean.

 

 

 

Capture+_2019-08-17-07-09-10.png

Share this post


Link to post

4 answers to this question

Recommended Posts

  • 0

My Contra spread gun with regular fire being horizontal and altfire being vertical like Contra:


ACTOR ContraSpread : DoomWeapon 2036
{
  SpawnID 245
  Weapon.SelectionOrder 105
  Weapon.SlotNumber 7
  Weapon.AmmoUse 1
  Weapon.AmmoGive 80
  Weapon.AmmoType "Cell"
  Weapon.AmmoUse2 1
  Weapon.AmmoType2 "Cell"
  Inventory.pickupsound "contra"
  Inventory.PickupMessage "You got the Spreadgun"
  Obituary "%o couldn't dodge %k's Contra gun"
  States  
  {
  Ready:
    PLSG B 1 A_WeaponReady
    Loop
  Deselect:
    PLSG B 1 A_Lower
    Loop
  Select:
    PLSG B 1 A_Raise
    Loop
  Fire:
    PLSG A 0 A_GunFlash
    PLSG A 0 A_FireCustomMissile("ContraBullet",random(-20,-13),1,0,0,0,0)
    PLSG A 0 A_FireCustomMissile("ContraBullet",random(-11,-5),1,0,0,0,0)    
    PLSG A 0 A_FireCustomMissile("ContraBullet",random(-3,3),1,0,0,0,0)
    PLSG A 0 A_FireCustomMissile("ContraBullet",random(5,11),1,0,0,0,0)
    PLSG A 9 A_FireCustomMissile("ContraBullet",random(13,20),1,0,0,0,0)
    PLSG A 20 A_ReFire
    Goto Ready
  AltFire:
    PLSG A 0 A_GunFlash
    PLSG A 0 A_FireCustomMissile("ContraBullet",0,1,0,0,0,random(-20,-13))
    PLSG A 0 A_FireCustomMissile("ContraBullet",0,1,0,0,0,random(-11,-5))    
    PLSG A 0 A_FireCustomMissile("ContraBullet",0,1,0,0,0,random(-3,3))
    PLSG A 0 A_FireCustomMissile("ContraBullet",0,1,0,0,0,random(5,11))
    PLSG A 9 A_FireCustomMissile("ContraBullet",0,1,0,0,0,random(13,20))
    PLSG A 20 A_ReFire
    Goto Ready
  Flash:
    PLSF C 4 Bright A_Light1
    PLSF D 4 Bright A_Light1
    Goto LightDone
  Spawn:
    PLAS C -1
    Stop
  }
}

ACTOR ContraBullet
{
  Radius 5
  Height 8
  Speed 20
  FastSpeed 20
  Damage 4
  Projectile
  +RANDOMIZE
  RenderStyle Add
  Alpha 1
  SeeSound "spread"
  States
  {
  Spawn:
    FLMB N 3 Bright
  Loop
  Death:
    FLMB HIJK 4 Bright
    Stop
  }
}

 

Could put it in its own wad with gfx and sounds and upload it if you want?  The gun itself just uses the plasma rifle graphics, but holding it diagonal for the regular idle/ready frame.

Share this post


Link to post
  • 0

Yeah i will use this as a basis. You are amazing. Thank you!

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
×