Yes.Snarboo wrote:Will grouped action functions be added to the main branch, or will we need to wait for DoomScript before we see this change added?
Grouped action specials in DECORATE
Moderator: GZDoom Developers
Re: Grouped action specials in DECORATE
- Graf Zahl
- Lead GZDoom+Raze Developer

- Posts: 49252
- Joined: Sat Jul 19, 2003 10:19 am
- Location: Germany
Re: Grouped action specials in DECORATE
Best non-answer ever... 
Re: Grouped action specials in DECORATE
I did another thing. And in so doing, I think I found some errors in FxConditional::Emit() that need fixing.
-
Blzut3
-

- Posts: 3215
- Joined: Wed Nov 24, 2004 12:59 pm
- Operating System Version (Optional): Kubuntu
- Graphics Processor: ATI/AMD with Vulkan/Metal Support
- Contact:
Re: Grouped action specials in DECORATE
A little harsh I think. Granted I probably don't read as much of the forums, but I would think just making sure an if statement is not followed by a semicolon would solve most cases. That's usually the error I see since most beginner tutorials use the braces all the time (or at least they probably should).Yes, the braces are required. Because I see too many instances where somebody writes an if statement in ACS and doesn't understand why it doesn't work right because they forgot braces.
More importantly right now it looks like there's no elegant "else if".
Re: Grouped action specials in DECORATE
Humbug. You're right. I suppose maybe I should change that. I don't want to spend too much time buffing up DECORATE, though.Blzut3 wrote:More importantly right now it looks like there's no elegant "else if".
Re: Grouped action specials in DECORATE
I'm curious as to how a clean (or expected) identation style would look like for this stuff. Does this look correct?
or perhaps like this?
Code: Select all
Actor Heh
{
States
{
POSS G 3
{
if (health > 1000)
{
A_Scream;
}
else
{
A_XScream;
}
}
POSS F 3
Stop
}
}
Code: Select all
Actor Heh
{
States
{
POSS G 3
{
if (health > 1000)
{
A_Scream;
}
else
{
A_XScream;
}
}
POSS F 3
Stop
}
}
-
Blzut3
-

- Posts: 3215
- Joined: Wed Nov 24, 2004 12:59 pm
- Operating System Version (Optional): Kubuntu
- Graphics Processor: ATI/AMD with Vulkan/Metal Support
- Contact:
Re: Grouped action specials in DECORATE
I think in this case using the brace on the same line style would be preferrable:
At the very least putting the first brace on the same line as the state would make it clear that it's an action function even if everything else is separate line. If you really feel like putting the opening brace on a separate line then your first example or a single tab should do. Don't try to align like your second example, large indentations become problematic to read eventually.
Code: Select all
POSS G 3 {
if (health > 1000) {
A_Scream;
} else {
A_XScream;
}
}
POSS F 3
stopRe: Grouped action specials in DECORATE
...That and it looks like if statements within if statements are not yet possible(?) Nevermind.Blzut3 wrote:More importantly right now it looks like there's no elegant "else if".
Last edited by Fishytza on Fri Jan 09, 2015 7:01 am, edited 1 time in total.
Re: Grouped action specials in DECORATE
Also, it doesn't include autoarrays, codepointer overloading, multiple inheritance, and multithreading. Boohoohoo.
-
Edward-san
- Posts: 1774
- Joined: Sat Oct 17, 2009 9:40 am
Re: Grouped action specials in DECORATE
Don't forget all the ownership thing. Bwheheheheee.
Re: Grouped action specials in DECORATE
And it never will.Gez wrote:Also, it doesn't include autoarrays, codepointer overloading, multiple inheritance, and multithreading.
- Major Cooke
- Posts: 8215
- 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
Thank god for that, that's one thing I never enjoyed when programming within ZDooM's source code.
- Major Cooke
- Posts: 8215
- 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
Also, fellas, it appears for a single action it doesn't need braces.
So you could do this:
Except I dont know if gotos are allowed like that. Randi, does that seem like something which would work?
Oh man I'm excited to see this put into the main branch.
Code: Select all
// If it's not a '{', then it should be a single action.
// Otherwise, it's a sequence of actions.
if (!sc.Compare("{"))
{
tcall->Code = ParseAction(sc, state, statestring, bag);
return;
}
Code: Select all
POSS G 3
{
if (health > 1)
A_Jump(256,"Alive") //Or perhaps Goto Alive could work?
else
A_Jump(256,"Dead") //Or perhaps Goto Dead could work?
}Oh man I'm excited to see this put into the main branch.
- 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
Since Goto is not a frame action, I don't see a reason for it to work as part of a frame.
