something like
Code: Select all
AltFire:
{
A_JumpIfInventory("Spinner",1,3)
A_GiveInventory("Spinner", 1)
goto Ready
A_TakeInventory("Spinner",1)
goto Ready
}I haven't tried this type of thing, i don't like idle sounds
Code: Select all
AltFire:
{
A_JumpIfInventory("Spinner",1,3)
A_GiveInventory("Spinner", 1)
goto Ready
A_TakeInventory("Spinner",1)
goto Ready
}Okay, yeah I did that. I didn't seem to do anything ingame though.Matt wrote:A ZScript lump is just a file called "zscript" like a Decorate lump is just a file called "decorate".
Spoiler:
I did, and this is what I get:Matt wrote:Did you do the other stuff in that post though? (and do *not* try to combine what I'm saying with what Dan is saying, I believe we are working at cross purposes here)Spoiler:
Oh, got it.Alexagon wrote:I want it so that while holding the altfire key, the barrel on the minigun spins and only spins. Then if I press fire while the barrel is spinning, I want it to fire without any delay.Void Weaver wrote:Alexagon, maybe my english are too bad but I still don't understand what (alt-)firing effects you want to achieve? Should is Altfire mode supposed to be are sorta of toggleable (by alt-fire button) wind-up "awaited-for-Fire-button" state?
Essentially I want to be able to be prepared to shoot with the minigun instead of waiting for the first few frames to pass before actually firing.
Code: Select all
Actor WindUpChecker : Inventory {Inventory.MaxAmount 1}
Actor HoldChaingun : Chaingun replaces Chaingun
{
Weapon.AmmoUse1 1
Weapon.AmmoUse2 1
Weapon.AmmoType1 "Clip"
Weapon.AmmoType2 "Clip"
Weapon.SlotNumber 4
States
{
Fire:
TNT1 A 0 A_JumpIfNoAmmo("Dryfire")
TNT1 A 0 A_PlaySound ("weapons/minig/start")
TNT1 A 0 A_JumpIfInventory("WindUpChecker",1,"Hold")
CHGG B 2
TNT1 A 0 A_WeaponReady(WRF_NoFire|WRF_NoSwitch)
CHGG CD 1 A_WeaponReady(WRF_NoFire|WRF_NoSwitch)
TNT1 A 0 A_WeaponReady(WRF_NoFire|WRF_NoSwitch)
CHGG ABCD 1 A_WeaponReady(WRF_NoFire|WRF_NoSwitch)
TNT1 A 0 A_WeaponReady(WRF_NoFire|WRF_NoSwitch)
TNT1 A 0 A_Refire
TNT1 A 0 A_WeaponReady(WRF_NoFire|WRF_NoSwitch)
CHGG ABCD 1 A_WeaponReady(WRF_NoFire|WRF_NoSwitch)
TNT1 A 0 A_WeaponReady(WRF_NoFire|WRF_NoSwitch)
CHGG ABC 2 A_WeaponReady
CHGG DABCDAB 3 A_WeaponReady
CHGG CD 4 A_WeaponReady
Goto Ready
Altfire:
TNT1 A 0 A_TakeInventory("WindUpChecker")
TNT1 A 0 A_PlaySound ("weapons/minig/start")
AltHold:
TNT1 A 0 A_PlaySound("weapons/minig/spin",6)
CHGG ABCD 1
{
A_WeaponReady(WRF_DISABLESWITCH|WRF_NOSWITCH|WRF_NOSECONDARY);
A_GiveInventory("WindUpChecker");
}
VLCN A 0 A_Refire
AltWinddown:
CHGG ABCDAABBCCDD 1
TNT1 A 0 A_TakeInventory("WindUpChecker")
goto ready
Hold:
TNT1 A 0 A_TakeInventory("WindUpChecker")
TNT1 A 0 A_JumpIf(ACS_NamedExecuteWithResult("ToggleMinigun")==0, "NoReloadHold")
TNT1 A 0 A_JumpIfNoAmmo("EmptyWindDown")
TNT1 A 0 A_AlertMonsters
TNT1 A 0 A_PlaySound("weapons/minig/spin",6)
TNT1 A 0 A_GunFlash
CHGG A 1 Offset(0,35) A_FireBullets (5, 5, 1, 8, "BulletPuff")
TNT1 A 0 Radius_Quake (1, 2, 0, 1, 0)
TNT1 A 0 A_WeaponReady(WRF_NoFire|WRF_NoSwitch)
TNT1 A 0 A_SetPitch(pitch-1.0)
TNT1 A 0 A_WeaponReady(WRF_NoFire|WRF_NoSwitch)
CHGG B 1 Offset(0,37) A_Firecustommissile("ChaingunCasingSpawner",0,0,-12,-18)
TNT1 A 0 A_WeaponReady(WRF_NoFire|WRF_NoSwitch)
CHGG C 1 Offset(0,39) A_FireBullets (5, 5, 1, 8, "BulletPuff")
TNT1 A 0 A_WeaponReady(WRF_NoFire|WRF_NoSwitch)
TNT1 A 0 A_SetPitch(pitch-0.6)
TNT1 A 0 A_WeaponReady(WRF_NoFire|WRF_NoSwitch)
TNT1 A 0 A_Firecustommissile("ChaingunCasingSpawner",0,0,-12,-18)
TNT1 A 0 A_WeaponReady(WRF_NoFire|WRF_NoSwitch)
CHGG D 1 Offset(0,37)
TNT1 A 0 A_WeaponReady(WRF_NoFire|WRF_NoSwitch)
TNT1 A 0 A_SetPitch(pitch+1.6)
TNT1 A 0 A_WeaponReady(WRF_NoFire|WRF_NoSwitch)
TNT1 A 0 A_ReFire
Goto Ready
}
}Code: Select all
Actor ToggleChaingun : Chaingun replaces Chaingun
{
Weapon.AmmoUse1 1
Weapon.AmmoUse2 1
Weapon.AmmoType1 "Clip"
Weapon.AmmoType2 "Clip"
Weapon.SlotNumber 4
States
{
Fire:
TNT1 A 0 A_JumpIfNoAmmo("Dryfire")
TNT1 A 0 A_PlaySound ("weapons/minig/start")
TNT1 A 0 A_JumpIfInventory("WindUpChecker",1,"Hold")
TNT1 A 0 A_WeaponReady(WRF_NoFire|WRF_NoSwitch)
CHGG B 2
TNT1 A 0 A_WeaponReady(WRF_NoFire|WRF_NoSwitch)
CHGG CD 1 A_WeaponReady(WRF_NoFire|WRF_NoSwitch)
TNT1 A 0 A_WeaponReady(WRF_NoFire|WRF_NoSwitch)
CHGG ABCD 1 A_WeaponReady(WRF_NoFire|WRF_NoSwitch)
TNT1 A 0 A_WeaponReady(WRF_NoFire|WRF_NoSwitch)
TNT1 A 0 A_Refire
TNT1 A 0 A_WeaponReady(WRF_NoFire|WRF_NoSwitch)
CHGG ABCD 1 A_WeaponReady(WRF_NoFire|WRF_NoSwitch)
TNT1 A 0 A_WeaponReady(WRF_NoFire|WRF_NoSwitch)
CHGG ABC 2 A_WeaponReady
CHGG DABCDAB 3 A_WeaponReady
CHGG CD 4 A_WeaponReady
Goto Ready
Altfire:
CHGG ABCD 1
TNT1 A 0 A_JumpIfInventory("WindUpChecker",1,3)
TNT1 A 0 A_GiveInventory("WindUpChecker")
TNT1 A 0 A_PlaySound ("weapons/minig/start")
Goto AltHoldd
TNT1 A 0 A_TakeInventory("WindUpChecker")
Goto AltWinddown
AltHoldd:
TNT1 A 0 A_PlaySound("weapons/minig/spin",6)
CHGG ABCD 1
{
A_WeaponReady(WRF_DISABLESWITCH|WRF_NOSWITCH);
If(CountInv("WindUpChecker")==0){Return state("AltWinddown");}
Else{Return state("");}
}
Loop
AltWinddown:
CHGG ABCDAABBCCDD 1
CHGG AABBCCDD 2
Goto Ready
Hold:
TNT1 A 0 A_JumpIf(ACS_NamedExecuteWithResult("ToggleMinigun")==0, "NoReloadHold")
TNT1 A 0 A_JumpIfNoAmmo("EmptyWindDown")
TNT1 A 0 A_AlertMonsters
TNT1 A 0 A_PlaySound("weapons/minig/spin",6)
TNT1 A 0 A_GunFlash
CHGG A 1 Offset(0,35) A_FireBullets (5, 5, 1, 8, "BulletPuff")
TNT1 A 0 Radius_Quake (1, 2, 0, 1, 0)
TNT1 A 0 A_WeaponReady(WRF_NoFire|WRF_NoSwitch)
TNT1 A 0 A_SetPitch(pitch-1.0)
TNT1 A 0 A_WeaponReady(WRF_NoFire|WRF_NoSwitch)
CHGG B 1 Offset(0,37) A_Firecustommissile("ChaingunCasingSpawner",0,0,-12,-18)
TNT1 A 0 A_WeaponReady(WRF_NoFire|WRF_NoSwitch)
CHGG C 1 Offset(0,39) A_FireBullets (5, 5, 1, 8, "BulletPuff")
TNT1 A 0 A_WeaponReady(WRF_NoFire|WRF_NoSwitch)
TNT1 A 0 A_SetPitch(pitch-0.6)
TNT1 A 0 A_WeaponReady(WRF_NoFire|WRF_NoSwitch)
TNT1 A 0 A_Firecustommissile("ChaingunCasingSpawner",0,0,-12,-18)
TNT1 A 0 A_WeaponReady(WRF_NoFire|WRF_NoSwitch)
CHGG D 1 Offset(0,37)
TNT1 A 0 A_WeaponReady(WRF_NoFire|WRF_NoSwitch)
TNT1 A 0 A_SetPitch(pitch+1.6)
TNT1 A 0 A_WeaponReady(WRF_NoFire|WRF_NoSwitch)
TNT1 A 0 A_ReFire
TNT1 A 0 A_JumpIfInventory("WindUpChecker",1,"AltHoldd")
Goto Ready
}
}I added that first line.Void Weaver wrote:Glad to help. ^_^
But I forget to place else one "TNT1 A 0 A_TakeInventory("WindUpChecker")" line right after entering into "Hold" state of the 1st variant - without it a some glitch are possible.
Also "TNT1 A 0 A_JumpIfInventory("WindUpChecker",1,"Hold")" lines in both variants should be logically moved down and placed after "TNT1 A 0 A_PlaySound ("weapons/minig/start")".
try add an "+ALWAYSPICKUP" flag to the chaingun?Alexagon wrote: I added that first line.
I'm having an issue now: Chaingun drops from chaingunners can't be picked up anymore. I added the spawn function to the HoldChaingun actor to get them to even appear but now they don't do anything. I added a pickup line after the spawn one but that didn't do anything.
I tried that, it makes so it says "You got a pickup" and does nothing else. i know how to get it to give me ammo but how do i make it so that it gives me the actual weapon?Dan_The_Noob wrote:try add an "+ALWAYSPICKUP" flag to the chaingun?Alexagon wrote: I added that first line.
I'm having an issue now: Chaingun drops from chaingunners can't be picked up anymore. I added the spawn function to the HoldChaingun actor to get them to even appear but now they don't do anything. I added a pickup line after the spawn one but that didn't do anything.
Spoiler:
if you have 1 working example of an ammo pickup you can pretty much just copy it with different values to make another.Alexagon wrote: I tried that, it makes so it says "You got a pickup" and does nothing else. i know how to get it to give me ammo but how do i make it so that it gives me the actual weapon?
Also, do either of you know how to make a custom ammo drop? I'm trying to make a box of bolts for my cryobow, but when I do a randomspawner for the rocket box and box of bolts, it doesn't spawn the bolts. I made a custom ammo for single bolts with a randomspawner for single rockets and that works just fine. It's the box that doesn't work. Here's the code for that:
Spoiler: