by Matt » Sun Jan 21, 2007 3:52 am
Yes, this is another "not a huge functional difference but makes DECORATE vastly easier to read and write" suggestion...
Wouldn't it be great if we can define a set of zero-frame frames and then call them again and again as a single function?
For instance, suppose I had five different monsters with a standard, slightly complex baron-like attack looking something like this:
Code: Select all
Missile:
MNST E 6 A_FaceTarget
MNST F 4
MNST G 0 A_JumpIfCloser (48, 11)
MNST G 0 A_Jump (256, 1, 4, 7)
MNST G 0 A_CustomMissile ("BaronBall", 32, -5, 0)
MNST G 0 A_CustomMissile ("BaronBall", 32, 5, 0)
MNST G 0 A_Jump (256, 8)
MNST G 0 A_CustomMissile ("BaronBall", 32, -10, 0)
MNST G 0 A_CustomMissile ("BaronBall", 32, 0, 0)
MNST G 0 A_Jump (256, 5)
MNST G 0 A_CustomMissile ("BaronBall", 32, 0, 0)
MNST G 0 A_CustomMissile ("BaronBall", 32, 10, 0)
MNST G 0 A_Jump (256, 2)
MNST G 0 A_FireBullets (4, 4, 1, 4, "ClawPuff", 4, 32) //temp until A_CustomMeleeAttack is available
MNST G 8
goto See
Now every time I have to change this attack I'd have to go through all five actors to make the change. This isn't much by itself, but if you've got sequences like this repeated for various different things (dodging, standardized weapons, characters that behave similarly but act differently, etc.) it really starts to add up.
So I thought it would be great if the following were possible:
Code: Select all
action A_MonstAttack
{
MNST G 0 A_JumpIfCloser (48, 8)
MNST G 0 A_Jump (256, 1, 3, 5)
MNST G 0 A_CustomMissile ("BaronBall", 32, -5, 0)
MNST G 0 A_CustomMissile ("BaronBall", 32, 5, 0)
return
MNST G 0 A_CustomMissile ("BaronBall", 32, -10, 0)
MNST G 0 A_CustomMissile ("BaronBall", 32, 0, 0)
return
MNST G 0 A_CustomMissile ("BaronBall", 32, 0, 0)
MNST G 0 A_CustomMissile ("BaronBall", 32, 10, 0)
return
MNST G 0 A_FireBullets (4, 4, 1, 4, "ClawPuff", 4, 32) //temp until A_CustomMeleeAttack is available
return
}
Leaving us with the following in the monster's actual missile state:
Code: Select all
Missile:
MNST E 6 A_FaceTarget
MNST F 4
MNST G 8 A_MonstAttack
goto See
I'd ask for custom parameters to be possible too, but I suspect that would be pushing my luck a bit. ^^;
Yes, this is another "not a huge functional difference but makes DECORATE vastly easier to read and write" suggestion...
Wouldn't it be great if we can define a set of zero-frame frames and then call them again and again as a single function?
For instance, suppose I had five different monsters with a standard, slightly complex baron-like attack looking something like this:
[code]Missile:
MNST E 6 A_FaceTarget
MNST F 4
MNST G 0 A_JumpIfCloser (48, 11)
MNST G 0 A_Jump (256, 1, 4, 7)
MNST G 0 A_CustomMissile ("BaronBall", 32, -5, 0)
MNST G 0 A_CustomMissile ("BaronBall", 32, 5, 0)
MNST G 0 A_Jump (256, 8)
MNST G 0 A_CustomMissile ("BaronBall", 32, -10, 0)
MNST G 0 A_CustomMissile ("BaronBall", 32, 0, 0)
MNST G 0 A_Jump (256, 5)
MNST G 0 A_CustomMissile ("BaronBall", 32, 0, 0)
MNST G 0 A_CustomMissile ("BaronBall", 32, 10, 0)
MNST G 0 A_Jump (256, 2)
MNST G 0 A_FireBullets (4, 4, 1, 4, "ClawPuff", 4, 32) //temp until A_CustomMeleeAttack is available
MNST G 8
goto See[/code]
Now every time I have to change this attack I'd have to go through all five actors to make the change. This isn't much by itself, but if you've got sequences like this repeated for various different things (dodging, standardized weapons, characters that behave similarly but act differently, etc.) it really starts to add up.
So I thought it would be great if the following were possible:
[code]action A_MonstAttack
{
MNST G 0 A_JumpIfCloser (48, 8)
MNST G 0 A_Jump (256, 1, 3, 5)
MNST G 0 A_CustomMissile ("BaronBall", 32, -5, 0)
MNST G 0 A_CustomMissile ("BaronBall", 32, 5, 0)
return
MNST G 0 A_CustomMissile ("BaronBall", 32, -10, 0)
MNST G 0 A_CustomMissile ("BaronBall", 32, 0, 0)
return
MNST G 0 A_CustomMissile ("BaronBall", 32, 0, 0)
MNST G 0 A_CustomMissile ("BaronBall", 32, 10, 0)
return
MNST G 0 A_FireBullets (4, 4, 1, 4, "ClawPuff", 4, 32) //temp until A_CustomMeleeAttack is available
return
}
[/code]
Leaving us with the following in the monster's actual missile state:
[code]Missile:
MNST E 6 A_FaceTarget
MNST F 4
MNST G 8 A_MonstAttack
goto See
[/code]
I'd ask for custom parameters to be possible too, but I suspect that would be pushing my luck a bit. ^^;