Grouped action specials in DECORATE

Moderator: GZDoom Developers

Post Reply
jmickle
Posts: 92
Joined: Wed Feb 19, 2014 9:43 am

Grouped action specials in DECORATE

Post by jmickle »

Instead of having to have multiple null states to call more than one action in a frame, it'd be more user-friendly to be able to group them in a syntax like this:

Code: Select all

POSS A 5 {
  A_Flash
  A_FacePlayer
}
this could be implemented with a quick pre-parse to change those sections to look like this:

Code: Select all

TNT1 A 0 A_Flash
TNT1 A 0 A_FacePlayer
POSS A 5
Gez
 
 
Posts: 17938
Joined: Fri Jul 06, 2007 3:22 pm

Re: Grouped action specials in DECORATE

Post by Gez »

jmickle wrote:Instead of having to have multiple null states to call more than one action in a frame, it'd be more user-friendly to be able to group them in a syntax like this:

Code: Select all

POSS A 5 {
  A_Flash
  A_FacePlayer
}
this could be implemented with a quick pre-parse to change those sections to look like this:

Code: Select all

TNT1 A 0 A_Flash
TNT1 A 0 A_FacePlayer
POSS A 5
Why do people always use TNT1 for zero length states?

Anyway:

Code: Select all

POSS A 0 A_Flash
POSS A 5 A_FacePlayer
The state structure would have to be heavily changed to allow a list of actions instead of just one action pointer. And it's planned for DoomScript (whenever it happens) to allow you to define your own action functions, so you'll be able to do something like this (no idea what the syntax would actually be, bear with me here):

Code: Select all

Function A_FlashPlayer
{
	A_Flash;
	A_FacePlayer;
}
Then:

Code: Select all

POSS A 5 A_FlashPlayer
RaveYard
Posts: 194
Joined: Fri Apr 12, 2013 10:51 am

Re: Grouped action specials in DECORATE

Post by RaveYard »

I don't wanna sound like an a**hole, but is there any reason to implement this feature besides just... making the syntax look fancy and complex?

I'd WFDS
User avatar
Enjay
 
 
Posts: 26935
Joined: Tue Jul 15, 2003 4:58 pm
Location: Scotland
Contact:

Re: Grouped action specials in DECORATE

Post by Enjay »

Given that Doomscript is meant to be on the way and this might mess with it and, when it comes down to it, typing

Code: Select all

POSS A 0 A_Flash
POSS A 5 A_FacePlayer
Isn't particularly difficult or messy, I personally don't see any real need for this.
jmickle
Posts: 92
Joined: Wed Feb 19, 2014 9:43 am

Re: Grouped action specials in DECORATE

Post by jmickle »

RaveYard wrote:I don't wanna sound like an a**hole, but is there any reason to implement this feature besides just... making the syntax look fancy and complex?
No, it's to make the syntax easier to write and read.

Enjay: my example was only 2 lines but it becomes a pain for more actions, and having to do it repetitively. It's a convenience issue.

Gez: While I normally hate the excuse of "It's fixed in a feature that's coming eventually", I guess for such a small thing as I'm suggesting it probably isn't worth the hassle in changing syntax. This is the first I've heard of DoomScript, is there anything I can read about it?
User avatar
Snarboo
Posts: 2599
Joined: Tue Nov 29, 2005 4:37 am

Re: Grouped action specials in DECORATE

Post by Snarboo »

I dunno, in lieu of DoomScript, this doesn't seem all that bad. Then again, it would take up the same number of lines so what do I know! :p
User avatar
Enjay
 
 
Posts: 26935
Joined: Tue Jul 15, 2003 4:58 pm
Location: Scotland
Contact:

Re: Grouped action specials in DECORATE

Post by Enjay »

jmickle wrote:Enjay: my example was only 2 lines but it becomes a pain for more actions, and having to do it repetitively. It's a convenience issue.
Given that your suggestion only saves on a sprite name and duration for each pointer, I personally don't really think it makes that much difference. Copying and pasting isn't that tough and I'm not convinced that the new code is any more readable or approachable from an end user perspective. I've nothing particularly against the idea but I don't see it being hugely beneficial, especially if it might interfere with or be superseded by DoomScript at some point.
User avatar
Major Cooke
Posts: 8206
Joined: Sun Jan 28, 2007 3:55 pm
Preferred Pronouns: He/Him
Operating System Version (Optional): Windows 10
Graphics Processor: nVidia with Vulkan support
Location: GZBoomer Town
Contact:

Re: Grouped action specials in DECORATE

Post by Major Cooke »

This is, in short, DoomScript-esque materials that can be combined, once doomscript is made. Randy's showing more life in the project again, so who knows. Maybe it won't be long now. Maybe there's still a while to go.
Gez
 
 
Posts: 17938
Joined: Fri Jul 06, 2007 3:22 pm

Re: Grouped action specials in DECORATE

Post by Gez »

jmickle wrote:Enjay: my example was only 2 lines but it becomes a pain for more actions, and having to do it repetitively. It's a convenience issue.
There's a trick where you use a [wiki]CustomInventory[/wiki] item to accomplish all the actions at once. It's a bit hacky though.
jmickle wrote:This is the first I've heard of DoomScript, is there anything I can read about it?
[wiki]DoomScript[/wiki]
User avatar
NeuralStunner
 
 
Posts: 12328
Joined: Tue Jul 21, 2009 12:04 pm
Preferred Pronouns: No Preference
Operating System Version (Optional): Windows 11
Graphics Processor: nVidia with Vulkan support
Location: capital N, capital S, no space
Contact:

Re: Grouped action specials in DECORATE

Post by NeuralStunner »

I always imagined you'd be able to make your own "action pointers", making it trivial to stack elaborate functinos onto a single state.
User avatar
Snarboo
Posts: 2599
Joined: Tue Nov 29, 2005 4:37 am

Re: Grouped action specials in DECORATE

Post by Snarboo »

At this point, all I want from DoomScript is to extend the existing DECORATE language with custom functions, but I suppose an all encompassing language that even lets us define new linedef types would be interesting, too.

I wonder if that DDF converter that was promised will make it in? :p
User avatar
Major Cooke
Posts: 8206
Joined: Sun Jan 28, 2007 3:55 pm
Preferred Pronouns: He/Him
Operating System Version (Optional): Windows 10
Graphics Processor: nVidia with Vulkan support
Location: GZBoomer Town
Contact:

Re: Grouped action specials in DECORATE

Post by Major Cooke »

NeuralStunner wrote:I always imagined you'd be able to make your own "action pointers", making it trivial to stack elaborate functions onto a single state.
You will be able to with doomscript. According to Graf, it's a lower level language than DECORATE and ACS, but still higher than C++.

You'll be able to modify, and create your own pointers (I think), functions (for sure) to do what you like. Oh, and you won't have to compile it either. :D
User avatar
Fishytza
Posts: 791
Joined: Wed Feb 23, 2011 11:04 am
Preferred Pronouns: They/Them
Contact:

Re: Grouped action specials in DECORATE

Post by Fishytza »

Major Cooke wrote:...but still higher than C++.
So I guess being able to access internal actor functions like OkayToSwitchTarget and TakeSpecialDamage, etc would still be forbidden, huh?
User avatar
Matt
Posts: 9696
Joined: Sun Jan 04, 2004 5:37 pm
Preferred Pronouns: They/Them
Operating System Version (Optional): Debian Bullseye
Location: Gotham City SAR, Wyld-Lands of the Lotus People, Dominionist PetroConfederacy of Saudi Canadia
Contact:

Re: Grouped action specials in DECORATE

Post by Matt »

Gez wrote:Why do people always use TNT1 for zero length states?
If you really want an answer, it just looks neater and easier to keep that way if you're copying code from multiple different actors. ("What's this TROO H doing in this shotgun guy?")

For what it's worth, here's how the proposed syntax would look:

Code: Select all

FOOB R 12
{
 A_Foobar("Foobar")
 A_Foobar1
 A_Foobar2("Foobar")
 goto Foobar
 A_Foobar2If(user_foobar==2,"Foobar",1,2,3,4,5,6,7,8,9)
 A_Foobar3(15,"Foobar")
 A_Foobar4(111,222,333)
 A_FoobarEx("FoobarFatShot",1,2,3,4,5,6,7,8,9)
}
compared to the current equivalent:

Code: Select all

FOOB R 0 A_Foobar("Foobar")
FOOB R 0 A_Foobar1
FOOB R 0 A_Foobar2("Foobar")
goto Foobar
FOOB R 0 A_Foobar2If(user_foobar==2,"Foobar",1,2,3,4,5,6,7,8,9)
FOOB R 0 A_Foobar3(15,"Foobar")
FOOB R 0 A_Foobar4(111,222,333)
FOOB R 12 A_FoobarEx("FoobarFatShot",1,2,3,4,5,6,7,8,9)
EDIT: How would goto and jump work in the suggested syntax anyway? would they just not be allowed?
User avatar
Enjay
 
 
Posts: 26935
Joined: Tue Jul 15, 2003 4:58 pm
Location: Scotland
Contact:

Re: Grouped action specials in DECORATE

Post by Enjay »

Vaecrius wrote:if you're copying code from multiple different actors.
That's usually when I use it. Generally, I use sprite appropriate to the actor but if I am copying between a bunch of different actors using different sprites, then I will tend to use TNT1 for 0 duration frames to save me having to edit the text every time I paste it into a new actor.
Post Reply

Return to “Closed Feature Suggestions [GZDoom]”