Decorate weapon problem

Advanced OpenGL source port fork from ZDoom, picking up where ZDoomGL left off.
[Home] [Download] [Git builds (Win)] [Git builds (Mac)] [Wiki] [Repo] [Bugs&Suggestions]

Moderator: Graf Zahl

Locked
User avatar
Zeg-Vok
Posts: 233
Joined: Wed Sep 21, 2005 18:04
Location: Up the creek without a paddle
Contact:

Decorate weapon problem

Post by Zeg-Vok »

This is the fireing code for my AssultRifle for a project im hoping to complete soon
Fire:
ARFL A 0 A_PlayWeaponSound("Bullet/BulletA")
ARFL B 2 BRIGHT A_FireBullets(4, 4, 1, 6, 1, 1)
ARFL A 3
ARFL A 0 A_PlayWeaponSound("Bullet/BulletA")
ARFL B 2 BRIGHT A_FireBullets(4, 4, 1, 6, 1, 1)
ARFL A 3
Goto Ready
AltFire:
ARFL B 0 A_PlayWeaponSound("SMG/AltFire")
ARFL B 2 BRIGHT A_FireBullets(4, 4, 7, 6, 1, 1)
ARFL A 12
Goto Ready

Now before I brought it over to GZDoom, I was using the latest Unofficial ZDoom build and I only had

ARFL A 0 A_PlayWeaponSound("Bullet/BulletA")
ARFL B 2 BRIGHT A_FireBullets(4, 4, 1, 6, 1, 1)
ARFL A 3
Goto Ready
As the frames and such in the Fire State (As with ZDoom, it would just skip the Firestate and go to the Hold stat if you had A_ReFire and a Hold state to go to). And it worked well, the first shot was pinpoint and the rest as long as it was held down, were all random. The AltFire worked fine aswell. But when I moved it over to GZDoom, it made it so every bullet from the normal fire was pinpoint, so I added a second bullet and a Refire Hold setup. It worked fine for when I was using the primary fire, bu the Altfire just acted as the Primary fire. I looked to see if I messed up the keybindings, but they were as they should be. I have no idea what is going on with this, but after looking over my coding, I honestly couldnt see why it would replace the AltFire with the Primary fire.

It seemed to happen when I added the second bullet stuff to the primary Fire State, as it did it without a Hold state. So I would assume this is some form of Bug.
User avatar
Graf Zahl
GZDoom Developer
GZDoom Developer
Posts: 7148
Joined: Wed Jul 20, 2005 9:48
Location: Germany
Contact:

Post by Graf Zahl »

Could you please post the complete old and the new weapon definition. I'm sorry that with these fragments alone I can't help you.
User avatar
Zeg-Vok
Posts: 233
Joined: Wed Sep 21, 2005 18:04
Location: Up the creek without a paddle
Contact:

Post by Zeg-Vok »

One with no hold, but still replaces the AltFire

actor AssultRifle : weapon 10029
{
Obituary "%o was power owned by %k's Assult Rifle."
Scale 0.125
Inventory.Pickupmessage "You got the Assult Rifle."
Weapon.SelectionOrder 64
States
{
Spawn:
ARFL C 1
Loop
Ready:
ARFL A 1 A_WeaponReady
Loop
Select:
ARFL A 1 A_Raise
Loop
Deselect:
ARFL A 1 A_Lower
Loop
Fire:
ARFL A 0 A_PlayWeaponSound("Bullet/BulletA")
ARFL B 2 BRIGHT A_FireBullets(4, 4, 1, 6, 1, 1)
ARFL A 3
ARFL A 0 A_PlayWeaponSound("Bullet/BulletA")
ARFL B 2 BRIGHT A_FireBullets(4, 4, 1, 6, 1, 1)
ARFL A 3
Goto Ready
AltFire:
ARFL B 0 A_PlayWeaponSound("SMG/AltFire")
ARFL B 2 BRIGHT A_FireBullets(4, 4, 7, 6, 1, 1)
ARFL A 12
Goto Ready
}
}

One with 1 bullet attack called in the fire state, and the AltFire works, but the primary fire is always pinpoint

actor AssultRifle : weapon 10029
{
Obituary "%o was power owned by %k's Assult Rifle."
Scale 0.125
Inventory.Pickupmessage "You got the Assult Rifle."
Weapon.SelectionOrder 64
States
{
Spawn:
ARFL C 1
Loop
Ready:
ARFL A 1 A_WeaponReady
Loop
Select:
ARFL A 1 A_Raise
Loop
Deselect:
ARFL A 1 A_Lower
Loop
Fire:
ARFL A 0 A_PlayWeaponSound("Bullet/BulletA")
ARFL B 2 BRIGHT A_FireBullets(4, 4, 1, 6, 1, 1)
ARFL A 3
Goto Ready
AltFire:
ARFL B 0 A_PlayWeaponSound("SMG/AltFire")
ARFL B 2 BRIGHT A_FireBullets(4, 4, 7, 6, 1, 1)
ARFL A 12
Goto Ready
}
}
User avatar
TheDarkArchon
Posts: 1000
Joined: Wed Jul 06, 2005 11:58
Location: What's that fucking smell
Contact:

Post by TheDarkArchon »

Code: Select all

 ARFL B 2 BRIGHT A_FireBullets(4, 4, 1, 6, 1, 1) 
should read

Code: Select all

 ARFL B 2 BRIGHT A_FireBullets(4, 4, -1, 6, 1, 1) 
User avatar
Zeg-Vok
Posts: 233
Joined: Wed Sep 21, 2005 18:04
Location: Up the creek without a paddle
Contact:

Post by Zeg-Vok »

Worked like a champion. BUt as Im a very Curious George, if someone wouldnt mind explaining the -1 rather than 1 thing to me, I would be grateful
User avatar
Graf Zahl
GZDoom Developer
GZDoom Developer
Posts: 7148
Joined: Wed Jul 20, 2005 9:48
Location: Germany
Contact:

Post by Graf Zahl »

Simple:

-1 means to fire one non-precise bullet
0 means fire one precise bullet
1 means fire one bullet which is precise unless A_ReFire is called to loop the attack.

You are not calling A_ReFire.
User avatar
Zeg-Vok
Posts: 233
Joined: Wed Sep 21, 2005 18:04
Location: Up the creek without a paddle
Contact:

Post by Zeg-Vok »

Thanks!
Locked

Return to “GZDoom”