Custom/batch action functions

Post a reply

Smilies
:D :) :( :o :shock: :? 8-) :lol: :x :P :oops: :cry: :evil: :twisted: :roll: :wink: :geek: :ugeek: :!: :?: :idea: :arrow: :| :mrgreen: :3: :wub: >:( :blergh:
View more smilies

BBCode is OFF
Smilies are ON

Topic review
   

Expand view Topic review: Custom/batch action functions

by Matt » Fri Oct 26, 2007 5:47 pm

@Gez: They're considered fired by the monster. Heck, I'd wish there were any way to access the properties of the pickup actor in the pickup state, but I can't find anything.

@Graf: I'm not asking this to be added, this method works already - I only posted the hack in case someone else comes across this thread later on and nothing better is available by then. I certainly wouldn't ask for a hack like this after the near-identical but clean version was no'd...

by Gez » Fri Oct 26, 2007 2:15 am

Awful but nifty. Vaecrius is not asking for it to be added, since it already works!

Simple question, are the projectiles considered fired by the pickup or by the monster? That is to say, do they hurt monsters of the same species or not?

by Graf Zahl » Fri Oct 26, 2007 2:06 am

No, no, no!

This is an awful hack and I won't even think about it.

As I said in the other thread, I won't add any new DECORATE features and I most certainly won't add any hacks anymore. This is as dirty as they come.

by Matt » Fri Oct 26, 2007 1:27 am

For the record
Being the person who made this suggestion I'm quite aware of this thread's age. :P

I'm really just adding this here in case someone searches for something similar and isn't aware of this trick, which had never occurred to me until I saw this.

That, and to make sure there's an objection at hand in case some overconscientious person decides to suggest that an item's pickup state should be changed so that it only works if the actual on-the-map actor is picked up. I seriously doubt any such change would be done, but after I had to edit every single DECORATE lump in Hideous Destructor because the SVN suddenly stopped taking non-quotemarked custom state names in A_Jump(If), I've learned not to take these things for granted.


Anyway, since I'm here here's the OP for anyone else trying to create a set of repeatable batch actions effectively acting as a combo action function:

Code: Select all

actor A_MonstAttack : CustomInventory
{
states:
{
pickup:
 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)
 stop

 MNST G 0 A_CustomMissile ("BaronBall", 32, -10, 0)
 MNST G 0 A_CustomMissile ("BaronBall", 32, 0, 0)
 stop

 MNST G 0 A_CustomMissile ("BaronBall", 32, 0, 0)
 MNST G 0 A_CustomMissile ("BaronBall", 32, 10, 0)
 stop

 MNST G 0 A_FireBullets (4, 4, 1, 4, "ClawPuff", 4, 32) //temp until A_CustomMeleeAttack is available
 stop
}
}
And putting it in the monster's actual missile state:

Code: Select all

Missile:
 MNST E 6 A_FaceTarget
 MNST F 4
 MNST G 8 A_GiveInventory("A_MonstAttack", 1)
 goto See

I should note as well that this method effectively lets you call any DECORATE function in ACS.

by TheDarkArchon » Wed Oct 24, 2007 3:57 am

Uh, look at the last post date...

by Matt » Tue Oct 23, 2007 10:47 am

For the record, I've found that the effect I wanted could be approximated by CustomInventory pickup states. Pretty useful thing to have...

by skadoomer » Sat Jan 27, 2007 12:03 am

MasterOFDeath wrote:WHERE IS POLYMOST?
Hopefully gone for good.

by Kirby » Mon Jan 22, 2007 12:52 am

Waiting for Mordeth to be released, of course

by MasterOFDeath » Sun Jan 21, 2007 6:19 pm

Speaking of Doomscript and old stuff... WHERE IS POLYMOST?

by Kirby » Sun Jan 21, 2007 5:59 pm

ROFL! :laff: He has a point too :)

by Graf Zahl » Sun Jan 21, 2007 9:07 am

Enjay wrote:I was a young man when I started waiting for doomscript Image



;)

Maybe Randy can say something?

by Nash » Sun Jan 21, 2007 9:03 am

LOL!

by Enjay » Sun Jan 21, 2007 8:19 am

I was a young man when I started waiting for doomscript Image



;)

by Graf Zahl » Sun Jan 21, 2007 5:07 am

That's a classic 'Wait for Doomscript' thing.

Custom/batch action functions

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. ^^;

Top