Page 1 of 1

Decorate weapon problem

Posted: Tue Sep 27, 2005 1:56
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.

Posted: Tue Sep 27, 2005 8:41
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.

Posted: Tue Sep 27, 2005 11:42
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
}
}

Posted: Wed Sep 28, 2005 9:54
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) 

Posted: Wed Sep 28, 2005 14:17
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

Posted: Wed Sep 28, 2005 14:20
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.

Posted: Wed Sep 28, 2005 14:50
by Zeg-Vok
Thanks!