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

gun casings

Recommended Posts

I am trying to add empty bullets to eject from most of my guns. For example, Brutal Dooms Pistol ejects bullets from the right side of the gun when the player fires the gun. I want to do this for my weapons, as I said before. I made individual sprites for different types of bullets that I want to
eject from the guns. I got the pistol to get the bullets to apper, but the problem is that when the pistol fires, multiple abullets appear on the floor from thin air. How do I get the bullet to eject from the side of the gun where the player clearly sees it. I did not want to muck up this thread with code, but the explanation is rather long, sorry for that.

Share this post


Link to post

I have seen the bullet casing spawner, although I'm not to goo with the decorate scripting lump and I tried adding it to the pistol and I get the same results.

Share this post


Link to post

Could someone help me understand how the lump for casing spawners work? I am very confused. I do not know the commands I would have to put in my weapons scripting lump.

Share this post


Link to post

I also believe that the CasingSpawner is only for scenery in a map. I looked at the info in the wad and the author said something about three arguments. The argumentswere used to put the bullets in the map. it also said something sbout adding your own. I don't know how to work with this so that it could work with my gun properly.

Share this post


Link to post

Haven't used the casing spawner for a while, but using it is a matter of adding a spawn line at a suitable spot in the weapon fire state. In the following examples the spawn lines are in bold and seem to work fairly well.

ACTOR Handgun : Pistol replaces Pistol
{
	Weapon.AmmoGive 50
	Weapon.SlotNumber 2
	States
	{
	Fire:
		PISG A 4
		PISG B 6 A_FirePistol
		TNT1 A 0 A_SpawnItemEx("DeadBulletCasing", Random(-16, 16), Random(-16, 16), 0, 0, 0, 0, Random(0, 360), 128)
		PISG C 4
		PISG B 5 A_ReFire
		Goto Ready
	}
}

ACTOR Boomstick : Shotgun replaces Shotgun
{
	Weapon.SlotNumber 3
	States
	{
	Fire:
		SHTG A 3
		SHTG A 7 A_FireShotgun
		SHTG BC 5
		SHTG D 4
		TNT1 A 0 A_SpawnItemEx("DeadShotgunCasing", Random(-16, 16), Random(-16, 16), 0, 0, 0, 0, Random(0, 360), 128)
		SHTG CB 5
		SHTG A 3
		SHTG A 7 A_ReFire
		Goto Ready
	}
}	

ACTOR SuperBoomstick : SuperShotgun replaces SuperShotgun
{
	Weapon.SlotNumber 3
	States
	{
	Fire:
		SHT2 A 3
		SHT2 A 7 A_FireShotgun2
		SHT2 B 7
		SHT2 C 7 A_CheckReload
		SHT2 D 7 A_OpenShotgun2
		TNT1 A 0 A_SpawnItemEx("DeadShotgunCasing", Random(-16, 16), Random(-16, 16), 0, 0, 0, 0, Random(0, 360), 128)
		TNT1 A 0 A_SpawnItemEx("DeadShotgunCasing", Random(-16, 16), Random(-16, 16), 0, 0, 0, 0, Random(0, 360), 128)
		SHT2 E 7
		SHT2 F 7 A_LoadShotgun2
		SHT2 G 6
		SHT2 H 6 A_CloseShotgun2
		SHT2 A 5 A_ReFire
		Goto Ready
	}
}

ACTOR BigGun : Chaingun replaces Chaingun
{
	Weapon.SlotNumber 4
	States
	{
	Fire:
		CHGG AB 4 A_FireCGun
		TNT1 A 0 A_SpawnItemEx("DeadBulletCasing", Random(-16, 16), Random(-16, 16), 0, 0, 0, 0, Random(0, 360), 128)
		CHGG B 0 A_ReFire
		Goto Ready
	}
}
You'll notice I used two spawn lines for the super shotgun since it's ejecting two casings at once.

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
×