Need weapon help

Archive of the old editing forum
Forum rules
Before asking on how to use a ZDoom feature, read the ZDoom wiki first. This forum is archived - please use this set of forums to ask new questions.
Locked
User avatar
Jimmy
 
 
Posts: 4728
Joined: Mon Apr 10, 2006 1:49 pm
Preferred Pronouns: He/Him
Contact:

Need weapon help

Post by Jimmy »

I need some help. Again. 8-)

All I want to have is a Supershotgun that requires you to manually reload by pressing altfire. I suck at A_JumpIfInventory. :cry:

Code: Select all

actor IDSuperShotgun : SuperShotgun
{
  Inventory.PickupMessage "You got the UAC standard-issue combat shotgun!"
  AttackSound "ultrasg/fire"
  States
  {
  Select:
    SHT2 A 0 A_Raise
    SHT2 A 1 A_Raise
    Goto Select
  Deselect:
    SHT2 A 0 A_Lower
    SHT2 A 1 A_Lower
    Goto Deselect
  Hold:
  Fire:
    SHT2 A 0 A_JumpIfInventory("IDSuperShotgunLoad",0,5)
    SHT2 A 3
    SHT2 A 0 A_FireBullets (11.2, 7.1, 20, 5, "BulletPuff")
    SHT2 A 5 A_GunFlash
    SHT2 A 0 A_TakeInventory("IDSuperShotgunLoad",1)
    SHT2 A 0
    Goto Ready
  AltFire:
    SHT2 B 4 A_JumpIfInventory("IDSuperShotgunLoad",1,9)
    SHT2 C 4 A_CheckReload
    SHT2 D 5 A_PlaySound("weapons/sshoto")
    SHT2 E 5
    SHT2 F 4 A_PlaySound("weapons/sshotl")
    SHT2 G 4
    SHT2 H 0 A_PlaySound("weapons/sshotc")
    SHT2 H 5
    SHT2 A 3 A_GiveInventory("IDSuperShotgunLoad",1)
    SHT2 A 0
    Goto Ready
  Flash:
    SHT2 I 2 Bright A_Light1
    SHT2 J 2 Bright A_Light2
    SHT2 J 0 Bright A_Light0
    Stop
  }
}

actor IDSuperShotgunLoad : Ammo
{
  Inventory.PickupMessage "If you read this then your dumb"
  Inventory.Amount 1
  Inventory.Maxamount 1
  Ammo.Backpackamount 1
  Ammo.Backpackmaxamount 1
}
User avatar
chaoscentral
Posts: 677
Joined: Sun Feb 27, 2005 4:32 pm
Location: Revere, MA
Contact:

Post by chaoscentral »

well, you can have a look at the shotgun in my Doom 3 weapons mod(a couple topics down)

It loads per shell, and it is interruptable. Although the animation is a bit off when interrupted, but only because theres no way of knowing if the key is held down or not
User avatar
TheDarkArchon
Posts: 7656
Joined: Sat Aug 07, 2004 5:14 am
Location: Some cold place

Post by TheDarkArchon »

Add the +AMMO_OPTIONAL flag.
User avatar
Jimmy
 
 
Posts: 4728
Joined: Mon Apr 10, 2006 1:49 pm
Preferred Pronouns: He/Him
Contact:

Post by Jimmy »

@TDA: I'm getting exactly the same behavior - which I don't want. It doesn't do anything with fire or altfire. :cry:
ant1991331
Posts: 598
Joined: Fri Jun 24, 2005 3:19 am
Location: Makin tracks with jetboots

Post by ant1991331 »

Code: Select all

A_JumpIfInventory("IDSuperShotgunLoad",0,5)
The 0 checks for the maximum amount that the inventory can have, that maybe your problem here.
User avatar
TheDarkArchon
Posts: 7656
Joined: Sat Aug 07, 2004 5:14 am
Location: Some cold place

Post by TheDarkArchon »

Besides, A_JumpIfInventory is <=, not =. Swapping the A_GiveInventory's for A_TakeInventory's and vice versa would fix things.
User avatar
Jimmy
 
 
Posts: 4728
Joined: Mon Apr 10, 2006 1:49 pm
Preferred Pronouns: He/Him
Contact:

Post by Jimmy »

Nothing's happening. :cry: Sorry.
User avatar
Zippy
Posts: 3302
Joined: Wed Mar 23, 2005 5:31 pm
Location: New Jersey

Re: Need weapon help

Post by Zippy »

Code: Select all

  Fire:
    SHT2 A 0 A_JumpIfInventory("IDSuperShotgunLoad",1,2)
    SHT2 A 1
    Goto Ready
    SHT2 A 3
    SHT2 A 0 A_FireBullets (11.2, 7.1, 20, 5, "BulletPuff")
    SHT2 A 5 A_GunFlash
    SHT2 A 0 A_TakeInventory("IDSuperShotgunLoad",1)
    Goto Ready
Changing to this would be a step in the right direction, but you're still going to have to make some changes to get sound and to get it working a bit better (you can load it when you have no shells left over but can't fire it, etc.)
User avatar
Jimmy
 
 
Posts: 4728
Joined: Mon Apr 10, 2006 1:49 pm
Preferred Pronouns: He/Him
Contact:

Post by Jimmy »

Thx Zippy, from there I should be able to fix it. :D
User avatar
Anakin S.
Posts: 1067
Joined: Fri Nov 28, 2003 9:39 pm
Location: A long time ago in a galaxy far, far away...

Post by Anakin S. »

TheDarkArchon wrote:Besides, A_JumpIfInventory is <=, not =. Swapping the A_GiveInventory's for A_TakeInventory's and vice versa would fix things.
Don't you mean >=?
Locked

Return to “Editing (Archive)”