For the most part I guess I get it except the JumpIfIventory and ChargeFlag. Like how does JumpIfinventory exactly work?. Also, is ChargeFlag like a script I have to write out separately? Lastly, sorry if I sounded like a jerk. I'm just trying to understand everything fully.
Edit:
I think I get it I hope. Because it's technically giving you the flag to check instead of shooting something, it holds off until you finally release it. I had thought maybe I had to create a special item indicating this. Well, for now, I will test making a gun using these guidelines.
Edit2:
Well, the gun charges (i.e. it holds as I hold the fire button), however, it does not discharge the charged up shot like it should. Unless I botched something (still tinkering around with it), I've used the exact same coding you provided and for the most part understand how it works.
Edit3:
I was looking through a similar charged weapon, and realized some things that were missing. I hadn't identified an ammo for the charge and was not taking the ammo away after the charge was done. However, it completely crashes the games when I attempt to charge. Normal quick shots though seem ok though..
Here is the Decorate for the current charge weapon...
actor Delta-Wave3 : Weapon
{
Weapon.SelectionOrder 400
Weapon.AmmoUse 2
Weapon.AmmoGive 8
Weapon.AmmoType "Shell"
Inventory.PickupMessage "Obtained Delta-Wave"
Obituary "%o was splattered by %k's Delta-Wave!"
States
{
Ready:
SHTG A 1 A_WeaponReady
Loop
Deselect:
SHTG A 0 A_TakeInventory("ChargeFlag",999)
SHTG A 1 A_Lower
Loop
Select:
SHTG A 0 A_TakeInventory("ChargeFlag",999)
SHTG A 1 A_Raise
Loop
Fire:
SHTG B 0 A_JumpIfInventory("ChargeFlag", 5, "FullCharge")
//You can put an animations and sounds that you want to play here. I already went over animations in an earlier code. Keep in mind that the more stuff you put here, the longer it will take the weapon to charge.
SHTG B 1 A_GiveInventory("ChargeFlag", 1)
SHTG B 0 A_Refire
Goto Shot
FullCharge:
//You can put an animations and sounds that you want to play here. I already went over animations in an earlier code.
SHTG D 1 A_Refire
Goto ChargeShot
Shot:
//Put the effect for shooting an uncharged shot (animations, sounds, A_FireCustomMissile, etc.) here.
SHTG GF 2 A_TakeInventory("ChargeFlag",999)
SHTG E 2 A_FireCustomMissile("oddproj",0,0)
SHTG E 0 A_FireCustomMissile("oddproj",0,0,25)
SHTG E 0 A_FireCustomMissile("oddproj",0,0,-25)
SHTG GF 2
SHTG E 2 A_FireCustomMissile("oddproj",0,0)
SHTG E 0 A_FireCustomMissile("oddproj",0,0,25)
SHTG E 0 A_FireCustomMissile("oddproj",0,0,-25)
SHTG GF 2
SHTG E 2 A_FireCustomMissile("oddproj",0,0)
SHTG E 0 A_FireCustomMissile("oddproj",0,0,25)
SHTG E 0 A_FireCustomMissile("oddproj",0,0,-25)
SHTG BCDCB 4 //More animation and delays!
Goto Ready
ChargeShot:
//Put the effect for shooting a charged shot (animations, sounds, A_FireCustomMissile, etc.) here.
SHTG GF 2 A_TakeInventory("ChargeFlag",999)
SHTG E 0 A_FireCustomMissile("oddproj",0,0)
SHTG E 0 A_FireCustomMissile("oddproj",0,0,25)
SHTG E 0 A_FireCustomMissile("oddproj",0,0,-25)
SHTG GF 2
SHTG E 0 A_FireCustomMissile("oddproj",0,0)
SHTG E 0 A_FireCustomMissile("oddproj",0,0,25)
SHTG E 0 A_FireCustomMissile("oddproj",0,0,-25)
SHTG GF 2
SHTG E 0 A_FireCustomMissile("oddproj",0,0)
SHTG E 0 A_FireCustomMissile("oddproj",0,0,25)
SHTG E 0 A_FireCustomMissile("oddproj",0,0,-25)
SHTG GF 2
SHTG E 0 A_FireCustomMissile("oddproj",0,0)
SHTG E 0 A_FireCustomMissile("oddproj",0,0,25)
SHTG E 0 A_FireCustomMissile("oddproj",0,0,-25)
SHTG E 0 A_FireCustomMissile("oddrocket",0,0,35)
SHTG E 0 A_FireCustomMissile("oddrocket",0,0,-35)
SHTG BCDCB 4 //More animation and delays!
Goto Ready
AltFire:
SHTG GF 2
SHTG E 2 A_FireCustomMissile("oddrocket",0,0)
SHTG BCDCB 4
SHTG BCDCB 4
SHTG B 0 A_Refire
Goto Ready
Flash:
Spawn:
SHOT A -1
Stop
}
}
actor ChargeFlag : Ammo
{
Inventory.MaxAmount 5
+INVENTORY.IGNORESKILL
}