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

Custom weapons don't have firing sprites.

Question

Not sure how to phrase what I mean so here's a screenshot:

123.png.a0202dd48123aa6da73bf9030e4ae879.png

I made a copy-paste of default pistol with some small changes in zscript and that sprite which shows up when you fire, well, doesn't show up and I can't figure out why. Same goes for every default doom weapon that I copy-pasted into different weapon.

 

Here is the code:

pistol.png.d9c8f3e2948abb48e75164d482366de1.png

 

Edited by LukeGaming

Share this post


Link to post

4 answers to this question

Recommended Posts

  • 0
3 hours ago, Kan3 said:

The Flash state, that will let the shooting weapon flash overlay sprites to be shown, is entered when the Fire state gets called, so that should just work.

Since I see that you just added and AltFire state to your weapon, I believe that you're missing the flash when you're using the secondary fire and to fix that you just need to add a AltFlash state (You can just copy and paste the Flash state or even jump from the AltFlash to the normal Flash immeditaly).

flash.png.d04975f41e8b7902050ff395eecfad41.png

Turns out I had to include A_GunFlash, idk why default weapons don't have it but still have flash.

 

Edit:

1 hour ago, Kan3 said:

Here's why

Default weapon's functions always call for A_GunFlash

 

Edited by LukeGaming

Share this post


Link to post
  • 0

This code does use that sprite (PISFA0), it's in Flash.

Flash:
		PISF A 7 Bright A_Light1;
		Goto LightDone;
		PISF A 7 Bright A_Light1;
		Goto LightDone;

Also, if you are looking to make small changes to the weapons you should be using inheritance. The ZDoom wiki warns of just copying and pasting the existing weapon code.

Share this post


Link to post
  • 0

The Flash state, that will let the shooting weapon flash overlay sprites to be shown, is entered when the Fire state gets called, so that should just work.

Since I see that you just added and AltFire state to your weapon, I believe that you're missing the flash when you're using the secondary fire and to fix that you just need to add a AltFlash state (You can just copy and paste the Flash state or even jump from the AltFlash to the normal Flash immeditaly).

Share this post


Link to post
  • 0
1 hour ago, LukeGaming said:

Turns out I had to include A_GunFlash, idk why default weapons don't have it but still have flash.

flash.png.d04975f41e8b7902050ff395eecfad41.png

Here's why

Default weapon's functions always call for A_GunFlash

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
×