Back on topic, I find this feature extremely useful. Tons of times, particularly in weapon/projectile coding, I find myself needing to do multiple actions "per state" over several frames of an animation, leading to ugliness like this:
Code: Select all
ACTOR CrazyMagicGun: Weapon
{
...
States
{
Ready:
CMGG A 0 A_WeaponReady
CMGG A 1 A_JumpIfInventory("IsKicking", "QuickKick")
CMGG B 0 A_WeaponReady
CMGG B 1 A_JumpIfInventory("IsKicking", "QuickKick")
CMGG C 0 A_WeaponReady
CMGG C 1 A_JumpIfInventory("IsKicking", "QuickKick")
CMGG D 0 A_WeaponReady
CMGG D 1 A_JumpIfInventory("IsKicking", "QuickKick")
CMGG E 0 A_WeaponReady
CMGG E 1 A_JumpIfInventory("IsKicking", "QuickKick")
CMGG F 0 A_WeaponReady
CMGG F 1 A_JumpIfInventory("IsKicking", "QuickKick")
CMGG G 0 A_WeaponReady
CMGG G 1 A_JumpIfInventory("IsKicking", "QuickKick")
CMGG H 0 A_WeaponReady
CMGG H 1 A_JumpIfInventory("IsKicking", "QuickKick")
Loop
...
}
}
Bunch of annoying copypasta. Now it's just as easy as:
Code: Select all
ACTOR CrazyMagicGun: Weapon
{
...
States
{
Ready:
CMGG ABCDEFGH 1 { A_WeaponReady A_JumpIfInventory("IsKicking", "QuickKick") }
Loop
...
}
}
...Or however the syntax is. Cool stuff.