Burktross Posted July 20, 2016 Can someone help me with a custom weapon? I'm following Weasel's tutorial here http://gunlabs.blogspot.com/2011/01/tutorial-how-to-make-your-first-basic.html Everything works fine and dandy until I throw custom sprites into the mix. Even sprites from Realm 667 flat out break the weapon, rendering it incapable of being picked up. What's wrong here? It's driving me crazy! 0 Share this post Link to post
Nevander Posted July 20, 2016 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. 0 Share this post Link to post
Burktross Posted July 20, 2016 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. 0 Share this post Link to post
scifista42 Posted July 20, 2016 The parameter "1" (FBF_EXPLICITANGLE) in the "flags" field is the most likely cause. 0 Share this post Link to post
Nevander Posted July 20, 2016 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. 0 Share this post Link to post
Burktross Posted July 20, 2016 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. 0 Share this post Link to post
scifista42 Posted July 20, 2016 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 0 Share this post Link to post
Burktross Posted July 20, 2016 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 } } 0 Share this post Link to post
Burktross Posted July 20, 2016 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? 0 Share this post Link to post
scifista42 Posted July 20, 2016 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. 0 Share this post Link to post
Burktross Posted July 20, 2016 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. 0 Share this post Link to post