header general

[SUBMISSION] Mismatched Pistols

  • ctlcdn
  • ctlcdn's Avatar Topic Author
  • Dark Imp
  • Dark Imp
More
3 years 7 months ago #11 by ctlcdn
Replied by ctlcdn on topic [SUBMISSION] Mismatched Pistols
I'm not sure on how to achieve that. Any pointers on how I could do it?

Please Log in or Create an account to join the conversation.

  • Gothic
  • Gothic's Avatar
  • Moderator
  • Moderator
More
3 years 7 months ago - 3 years 7 months ago #12 by Gothic
Replied by Gothic on topic [SUBMISSION] Mismatched Pistols
Using A_CheckReload right before they fire (not inside the anonymous function) makes them lower if they run out of ammo:

Code:
  Fire:     Goto Ready      // - - - - - - - - VSP STATES - - - - - - - -   IdleL:     TNT1 A 0 A_JumpIf(GetPlayerInput(INPUT_BUTTONS) & BT_RELOAD,     "ReloadL")     // Note: Swap BT_ALTATTACK with BT_ATTACK to swap handing.     VSPI A 1 A_JumpIf(GetPlayerInput(INPUT_BUTTONS) & BT_ALTATTACK, "FireL")     Loop        FireL:     TNT1 A 0 A_CheckReload     VSPF A 1 Bright {         A_FireBullets(2, 1, -1, 4);         A_PlaySound("Weapon/VSPFire", 5, 1);         A_GiveInventory("VSPAmmo", 1);         A_AlertMonsters;         A_ZoomFactor(0.966 + 0.001 * Random(0, 5));         A_Light2;     }     VSPF B 2 Bright {         A_ZoomFactor(1);         A_Light1;     }     TNT1 A 0 Offset(-2, -1)     TNT1 A 0 A_CheckReload     VSPF A 1 Bright {         A_FireBullets(4, 1, -1, 4);         A_PlaySound("Weapon/VSPFire", 5, 0.66);         A_AlertMonsters;         A_ZoomFactor(0.975 + 0.001 * Random(0, 5));         A_Light2;     }     VSPF B 2 Bright {         A_ZoomFactor(1);         A_Light1;     }     TNT1 A 0 Offset(-2, -1)     TNT1 A 0 A_CheckReload     VSPF A 1 Bright {         A_FireBullets(6, 2, -1, 4);         A_PlaySound("Weapon/VSPFire", 5, 0.50);         A_AlertMonsters;         A_ZoomFactor(0.990 + 0.001 * Random(0, 5));         A_Light2;     }     VSPF B 2 Bright {         A_ZoomFactor(1);         A_Light1;     }     goto EndFireL        EndFireL:     VSPF C 2 A_Light0     TNT1 A 0 Offset(2, 1)     TNT1 A 0 A_JumpIfInventory("VSPAmmo", 6, "LastL")    // Keeps slide open if last bullet was fired     VSPF D 2 Offset(2, 1)     VSPI A 1     Goto IdleL        LastL:     VSPF C 2 Offset(-2, -1)     VSPI B 1 Offset(2, 1)     Goto ReloadL   ReloadL:      TNT1 A 0 A_PlaySound("Weapon/WhooshSFX", 7, 1)     VSPE ABC 1     TNT1 A 4     TNT1 A 3 A_PlaySound("Weapon/VSPR1", 6, 1)     TNT1 A 2 A_TakeInventory("VSPAmmo")     TNT1 A 2 A_PlaySound("Weapon/VSPR2", 6, 1)     TNT1 A 3 A_PlaySound("Weapon/VSPR3", 6, 1)     TNT1 A 4 A_PlaySound("Weapon/WhooshSFX", 6, 1)     VSPR ABC 1     Goto IdleL // - - - - - - - - SPECTRE STATES - - - - - - - -   IdleR:     TNT1 A 0 A_JumpIf(GetPlayerInput(INPUT_BUTTONS) & BT_RELOAD, "ReloadR")     // Note: Swap BT_ATTACK with BT_ALTATTACK to swap handing.     BASI A 1 A_JumpIf(GetPlayerInput(INPUT_BUTTONS) & BT_ATTACK, "FireR")     Loop        FireR:     TNT1 A 0 A_CheckReload     BASF A 1 Bright {         A_FireBullets(1, 0, -1, 6);         A_PlaySound("Weapon/SpectreFire", 1, 1);         A_GiveInventory("SpectreAmmo", 1);         A_AlertMonsters;         A_ZoomFactor(0.980 + 0.001 * Random(0, 5));         A_Light2;     }     BASF B 2 Bright {         A_Light1;         A_ZoomFactor(1);     }     BASF C 2 A_Light0     BASF C 0 A_JumpIfInventory("SpectreAmmo", 18, "LastR")    // Keeps slide open if last bullet was fired     BASF D 4     Goto IdleR        LastR:     BASF C 1 Offset(2, -1) A_Light0     BASI B 1 Offset(-2, 1)     Goto ReloadR        ReloadR:     TNT1 A 0 A_PlaySound("Weapon/WhooshSFX", 7, 1)     BASE ABC 1     TNT1 A 5     TNT1 A 4 A_PlaySound("Weapon/SpectreR1", 7, 1)     TNT1 A 3 A_TakeInventory("SpectreAmmo")     TNT1 A 3 A_PlaySound("Weapon/SpectreR2", 7, 1)     TNT1 A 4 A_PlaySound("Weapon/SpectreR3", 7, 1)     TNT1 A 5 A_PlaySound("Weapon/WhooshSFX", 7, 1)     BASR ABC 1     Goto IdleR

One thing that I can't figure out yet is when you have 1 clip left and you fire the Spectre (right gun), it doesn't trigger the firing animation, but it shots anyway.
Last edit: 3 years 7 months ago by Gothic.

Please Log in or Create an account to join the conversation.

  • ctlcdn
  • ctlcdn's Avatar Topic Author
  • Dark Imp
  • Dark Imp
More
3 years 7 months ago #13 by ctlcdn
Replied by ctlcdn on topic [SUBMISSION] Mismatched Pistols
Thanks with the help for the checkreload statement, I'll look into trying to fix the issue regarding the spectre firing strangely, maybe I'll have to restructure the code.

Please Log in or Create an account to join the conversation.

  • ctlcdn
  • ctlcdn's Avatar Topic Author
  • Dark Imp
  • Dark Imp
More
3 years 7 months ago #14 by ctlcdn
Replied by ctlcdn on topic [SUBMISSION] Mismatched Pistols
After multiple days I am still unsure about how to fix the issue regarding the right hand's weird firing animation on the final bullet. I'm quite lost on how to fix it.

Please Log in or Create an account to join the conversation.

  • Gothic
  • Gothic's Avatar
  • Moderator
  • Moderator
More
3 years 7 months ago #15 by Gothic
Replied by Gothic on topic [SUBMISSION] Mismatched Pistols
I might add this anyway if other people don't see it as a big issue. Any opinions?

Please Log in or Create an account to join the conversation.

  • Blue Shadow
  • Blue Shadow's Avatar
  • Administrator
  • Administrator
More
3 years 7 months ago - 3 years 7 months ago #16 by Blue Shadow
Replied by Blue Shadow on topic [SUBMISSION] Mismatched Pistols
I took a look and did some testing. Here's what to change to hopefully solve the problem:
  • Disable firing completely by passing WRF_NOFIRE flag to A_WeaponReady. Since you're not relying on the native system here to handle player input, you'd want that disabled as not to get in the way.
  • Remove the ammo check from both IdleR and IdleL state sequences. Because, overlays run at the same time, if you're firing one gun, the other could be idling. If it's idling, then it keeps checking for ammo and initiates deselecting as soon as you run out of ammo without caring about what the other gun is doing at the time.
  • Perform the A_CheckReload calls at the end of the fire sequences instead of at the start. You probably want to account for the last-bullet/keep-slide-open case, too.
Last edit: 3 years 7 months ago by Blue Shadow.

Please Log in or Create an account to join the conversation.

  • ctlcdn
  • ctlcdn's Avatar Topic Author
  • Dark Imp
  • Dark Imp
More
3 years 7 months ago #17 by ctlcdn
Replied by ctlcdn on topic [SUBMISSION] Mismatched Pistols
Alright, I'll fix those and upload a new version later today.

Please Log in or Create an account to join the conversation.

  • ctlcdn
  • ctlcdn's Avatar Topic Author
  • Dark Imp
  • Dark Imp
More
3 years 7 months ago - 3 years 7 months ago #18 by ctlcdn
Replied by ctlcdn on topic [SUBMISSION] Mismatched Pistols
Alright, I was kinda busy for most of the week so apologies for the late update but I applied the fixes that Blue Shadow mentioned and it functions properly now. I've also updated the data of the weapon to fit the changes made since the first version.

INFORMATION
NAME: Mismatched Pistols
CLASS2 or 4
TYPE: Hitscan
Palette: Doom
Summon: Pistols
Ammo Type: Clip
Altfire: Yes
Powered Mode: No
Brightmaps: None
Actor Modifications: None
ACS: None

CREDITS:
Code: ctlcdn
Sounds: Valve
Sprites: Jredalert, Millenia, Kimono, Thanez, Naky, MG, Kais, LAM, Dayofdefeat123, Teh Snake, CadeOpreto, PillowBlaster, and ID Software
Sprite Edit: ctlcdn
Idea Base: Very loosely based on Dante's Ebony & Ivory pistols from Devil May Cry

Description:
A pair of mismatched pistols, miraculously they use the same ammunition. The pistol on the right is rather accurate and hits with moderate force, taking most small demons down in a few shots. On the other hand, while the left pistol lacks in firepower it has a deadly, albeit inaccurate, 3-shot burst firemode. You are able to reload them at lightning speed, so reloading them, albeit tedious, shouldn't be much of an issue.

(No changes to the sprites so I'm not uploading them again)

Download Link:
https://drive.google.com/file/d/1eWkyffogn7q2WjlYCPXeYs8ZROyDVvVk/view?usp=sharing
Last edit: 3 years 7 months ago by ctlcdn. Reason: Accidentally forgot to put the download link

Please Log in or Create an account to join the conversation.

  • Blue Shadow
  • Blue Shadow's Avatar
  • Administrator
  • Administrator
More
3 years 7 months ago - 3 years 7 months ago #19 by Blue Shadow
Replied by Blue Shadow on topic [SUBMISSION] Mismatched Pistols
Approved.

Edit: Added .
Last edit: 3 years 7 months ago by Blue Shadow.

Please Log in or Create an account to join the conversation.