Forum rules
Before asking on how to use a ZDoom feature, read the ZDoom wiki first. If you still don't understand how to use a feature, then ask here.
Please bear in mind that the people helping you do not automatically know how much you know. You may be asked to upload your project file to look at. Don't be afraid to ask questions about what things mean, but also please be patient with the people trying to help you. (And helpers, please be patient with the person you're trying to help!)
I've been wanting to learn how to make input special moves for doom weapons (I.E. Back, Crouch, Forward + Primary fire in a second or less does a dumbell throw) but i do not know how to make it in decorate, does anyone here know?
Last edited by Tohg7. on Tue Jun 02, 2020 12:57 pm, edited 1 time in total.
ACTOR ComboShotgun : Shotgun replaces Shotgun
{
Weapon.SlotNumber 3
States
{
Select:
SHTG A 0 A_Overlay(-2,"ComboOverlay")
Goto Super::Select
Fire:
SHTG A 3 A_JumpIfInventory("ComboPower",1,"Fire2")
TNT1 A 0 A_Overlay(-2,"ComboOverlay")
SHTG A 7 A_FireShotgun
SHTG BC 5
SHTG D 4
SHTG CB 5
SHTG A 3
SHTG A 7 A_ReFire
Goto Ready
Fire2:
SHTG A 3
SHTG A 7 A_FireShotgun2
Goto Fire+3
ComboOverlay:
TNT1 A 0 A_TakeInventory("ComboPower",1)
TNT1 A 1 {If(GetPlayerInput(MODINPUT_OLDBUTTONS,-1)&BT_MOVERIGHT){}Else{If(GetPlayerInput(MODINPUT_BUTTONS,-1)&BT_MOVERIGHT){A_Overlay(-2,"ComboOverlay2");}}}
Loop
ComboOverlay2:
TNT1 AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA 1 {If(GetPlayerInput(MODINPUT_OLDBUTTONS,-1)&BT_MOVELEFT){}Else{If(GetPlayerInput(MODINPUT_BUTTONS,-1)&BT_MOVELEFT){A_Overlay(-2,"ComboOverlay3");}}}
Goto ComboOverlay
ComboOverlay3:
TNT1 AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA 1 {If(GetPlayerInput(MODINPUT_OLDBUTTONS,-1)&BT_FORWARD){}Else{If(GetPlayerInput(MODINPUT_BUTTONS,-1)&BT_FORWARD){A_Overlay(-2,"ComboOverlay4");}}}
Goto ComboOverlay
ComboOverlay4:
TNT1 AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA 1 A_GiveInventory("ComboPower",1)
Goto ComboOverlay
}
}
ACTOR ComboPower : Inventory {Inventory.MaxAmount 1}
Firing this shotgun will shoot it like usual.
However if the player pressed right, left and forward in that order, it will shoot like a super shotgun.
This creates an overlay that reads player's input with GetPlayerInput and proceeds forwards with it.
In ComboOverlay4 it gives the player a dummy inventory item for 1 second, (35 tics) and if the player fires the gun with this item, it will jump to Fire2 state.
ACTOR ComboShotgun : Shotgun replaces Shotgun
{
Weapon.SlotNumber 3
States
{
Select:
SHTG A 0 A_Overlay(-2,"ComboOverlay")
Goto Super::Select
Fire:
SHTG A 3 A_JumpIfInventory("ComboPower",1,"Fire2")
TNT1 A 0 A_Overlay(-2,"ComboOverlay")
SHTG A 7 A_FireShotgun
SHTG BC 5
SHTG D 4
SHTG CB 5
SHTG A 3
SHTG A 7 A_ReFire
Goto Ready
Fire2:
SHTG A 3
SHTG A 7 A_FireShotgun2
Goto Fire+3
ComboOverlay:
TNT1 A 0 A_TakeInventory("ComboPower",1)
TNT1 A 1 {If(GetPlayerInput(MODINPUT_OLDBUTTONS,-1)&BT_MOVERIGHT){}Else{If(GetPlayerInput(MODINPUT_BUTTONS,-1)&BT_MOVERIGHT){A_Overlay(-2,"ComboOverlay2");}}}
Loop
ComboOverlay2:
TNT1 AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA 1 {If(GetPlayerInput(MODINPUT_OLDBUTTONS,-1)&BT_MOVELEFT){}Else{If(GetPlayerInput(MODINPUT_BUTTONS,-1)&BT_MOVELEFT){A_Overlay(-2,"ComboOverlay3");}}}
Goto ComboOverlay
ComboOverlay3:
TNT1 AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA 1 {If(GetPlayerInput(MODINPUT_OLDBUTTONS,-1)&BT_FORWARD){}Else{If(GetPlayerInput(MODINPUT_BUTTONS,-1)&BT_FORWARD){A_Overlay(-2,"ComboOverlay4");}}}
Goto ComboOverlay
ComboOverlay4:
TNT1 AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA 1 A_GiveInventory("ComboPower",1)
Goto ComboOverlay
}
}
ACTOR ComboPower : Inventory {Inventory.MaxAmount 1}
Firing this shotgun will shoot it like usual.
However if the player pressed right, left and forward in that order, it will shoot like a super shotgun.
This creates an overlay that reads player's input with GetPlayerInput and proceeds forwards with it.
In ComboOverlay4 it gives the player a dummy inventory item for 1 second, (35 tics) and if the player fires the gun with this item, it will jump to Fire2 state.
Is it possible to make "Charged" moves with this code? Take for example, hold backwards for 2 seconds then press forwards and primary fire to execute a dash punch.