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

Custom Weapon Sprites

Recommended Posts

I may be wrong here, but your sprite graphics are not in the correct namespace. If you're working with a WAD, they go in SS_START/SS_END markers. If you're working with a PK3, they have to be in /sprites (at the minimum). Something like /sprites/weapons/ssg will also work.

Share this post


Link to post
Nevander said:

I may be wrong here, but your sprite graphics are not in the correct namespace. If you're working with a WAD, they go in SS_START/SS_END markers. If you're working with a PK3, they have to be in /sprites (at the minimum). Something like /sprites/weapons/ssg will also work.


Fantastic, that worked. But now I have another problem for some reason. The weapon deviation angles stopped working.



What could I be doing wrong? It was fine just a moment ago.

Share this post


Link to post

The parameter "1" (FBF_EXPLICITANGLE) in the "flags" field is the most likely cause.

Share this post


Link to post

Do you have A_ReFire at the end of the Fire state?

I had a similar problem before where my chaingun inherited weapon wouldn't fire with a spread pattern and it's because I didn't have that.

See this example:

Fire:
	UZIF A 0
	UZIF A 0 A_PlaySound("weapons/uzifire", CHAN_WEAPON, 1, 0, ATTN_NORM)
	UZIF B 0 A_GunFlash
	UZIF B 0 A_FireBullets(2.6, 0, 1, 6, "BulletPuff")
	UZIF B 0 A_FireCustomMissile("DummyProjectile6", 0 , 0, 0, 0, 0, 0)
	UZIF AB 1 BRIGHT
	UZIF C 1
	UZIG A 1
	UZIG A 0 A_ReFire
	Goto Ready
If you already have that then I'm not sure what's wrong without seeing the whole actor. EDIT: Or what scifista said lol.

Share this post


Link to post
scifista42 said:

The parameter "1" (FBF_EXPLICITANGLE) in the "flags" field is the most likely cause.

Weasel said that was ammo usage though, no? If I set it to zero, it uses no ammo, if I remove it outright, it doesn't do anything.

Nevander said:

Do you have A_ReFire at the end of the Fire state?

I had a similar problem before where my chaingun inherited weapon wouldn't fire with a spread pattern and it's because I didn't have that.

See this example:

Fire:
	UZIF A 0
	UZIF A 0 A_PlaySound("weapons/uzifire", CHAN_WEAPON, 1, 0, ATTN_NORM)
	UZIF B 0 A_GunFlash
	UZIF B 0 A_FireBullets(2.6, 0, 1, 6, "BulletPuff")
	UZIF B 0 A_FireCustomMissile("DummyProjectile6", 0 , 0, 0, 0, 0, 0)
	UZIF AB 1 BRIGHT
	UZIF C 1
	UZIG A 1
	UZIG A 0 A_ReFire
	Goto Ready
If you already have that then I'm not sure what's wrong without seeing the whole actor. EDIT: Or what scifista said lol.




Here's the entirety of the code. Refire definitely works, but it makes it fire at twice the rate, unfortunately.

Share this post


Link to post

When setting flags to functions in DECORATE, I recommend you to use the flag names directly (in your case, FBF_USEAMMO), as opposed to numbers (the flag value 1 apparently doesn't correspond to FBF_USEAMMO).

Also, FBF_USEAMMO is set to "true" by default anyway, so your mistake was avoidable if you just didn't set any flags.

To get a list of valid flags usable in each DECORATE function, see its reference on the zdoom wiki. In your case: http://zdoom.org/wiki/A_FireBullets

Share this post


Link to post
scifista42 said:

When setting flags to functions in DECORATE, I recommend you to use the flag names directly (in your case, FBF_USEAMMO), as opposed to numbers (the flag value 1 apparently doesn't correspond to FBF_USEAMMO).

Also, FBF_USEAMMO is set to "true" by default anyway, so your mistake was avoidable if you just didn't set any flags.

To get a list of valid flags usable in each DECORATE function, see its reference on the zdoom wiki. In your case: http://zdoom.org/wiki/A_FireBullets

I'm being completely thrown off by the inconsistency though. This code uses the flag set, but it works completely fine.

//Debug Junky
ACTOR DebugJunkyGun : Weapon 16002
{
Inventory.PickupMessage "Please God please.  Fix this code or kill me."
Weapon.AmmoType "Shell"
Weapon.AmmoUse 1
Weapon.AmmoGive 16
Weapon.SlotNumber 4
AttackSound "weapons/shotgf"
States
{
Spawn:
SHOT A -1
Stop
Ready:
SHTG B 1 A_WeaponReady
Loop
Select:
SHTG A 1 A_Raise
Loop
Deselect:
SHTG A 1 A_Lower
Loop
Fire:
SHTG A 0 A_GunFlash
SHTG A 1 A_FireBullets(5.5, 3, 8, 4, "BulletPuff", 1)
SHTG A 1 Offset(0,40)
SHTG A 1 Offset(0,48)
SHTG A 1 Offset(0,44)
SHTG A 1 Offset(0,40)
SHTG A 1 Offset(0,37)
SHTG A 1 Offset(0,35)
SHTG A 3
Goto Ready
Flash:
SHTF A 2 BRIGHT A_Light2
SHTF B 2 BRIGHT A_Light1
TNT1 A 1 A_Light0
Goto LightDone
}
}

Share this post


Link to post

Well, I found the source of the issue. When the gun fires only one bullet at a time, it ignores accuracy. 2+ hitscans at once fix it. What's the workaround for this?

Share this post


Link to post

The numbers corresponding to specific flags may* change between different versions of ZDoom or whatever ZDoom-based port you're using, which is why it's safer to use the flag names directly.

* Even though they usually don't.

EDIT:

Burktross said:

When the gun fires only one bullet at a time, it ignores accuracy.

The zdoom wiki article describes this situation. It says:

The first bullet fired in the Fire (not Hold) sequence normally ignores the spread and is always perfectly accurate. Setting numbullets to a negative value removes this effect.

Share this post


Link to post
scifista42 said:

The numbers corresponding to specific flags may* change between different versions of ZDoom or whatever ZDoom-based port you're using, which is why it's safer to use the flag names directly.

* Even though they usually don't.

EDIT:
The zdoom wiki article describes this situation. It says:

Yeah, I can't believe I missed that >.<

Thanks for the help though, y'all.

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
×