Grouped action specials in DECORATE

Moderator: GZDoom Developers

User avatar
Graf Zahl
Lead GZDoom+Raze Developer
Lead GZDoom+Raze Developer
Posts: 49223
Joined: Sat Jul 19, 2003 10:19 am
Location: Germany

Re: Grouped action specials in DECORATE

Post by Graf Zahl »

Vaecrius wrote:
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?

Syntax rejected. Since this will have to be a stand-in for a scripted function each line must end with a semicolon. And the goto is a complete no-go. The scripting language won't allow a goto, it also won't allow A_Jump constructs, but real script syntax instead. In this area the main objective will be: no stopgap measures. Period.
BTW, if Randi continues his work on the scripting branch and manages to merge it this might not be so far away - but don't expect anything unless the scripting framework is in.
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 »

Graf Zahl wrote:no stopgap measures. Period.
So, it's like custominventory, minus any jumping/stopping/actor defining of said custom inventory item? If so, that'd be sweet!
Graf Zahl wrote:BTW, if Randi continues his work on the scripting branch and manages to merge it this might not be so far away - but don't expect anything unless the scripting framework is in.
This rekindled my hope. :D
Gez
 
 
Posts: 17938
Joined: Fri Jul 06, 2007 3:22 pm

Re: Grouped action specials in DECORATE

Post by Gez »

Vaecrius wrote: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?")
You need to learn about that thing called "search and replace".

I disagree that it looks neater ("what's this TNT1 A doing in this shotgun guy?") and I know that it can trigger flickering bugs when you're making an actor switch between visible and invisible constantly.
Enjay wrote: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.
Here's a novel idea: stop using TNT1 A 0, start using "####" "#".
Last edited by Gez on Fri Jan 02, 2015 3:52 pm, edited 1 time in total.
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 »

Gez wrote:Here's a novel idea: stop using TNT1 A 0, start using "####" "#".
Given that it means "keep previous", what would it do if that was used at the start of a spawn sequence?

It does tend to be (for me) that the frames in question are at the start of sequences, including spawn. So, keeping the previous isn't always suitable.
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 »

Crash 'n burn!*

(I've never tried it. I would assume actually it would say the first frame needs to be defined and prevent startup.)
Gez
 
 
Posts: 17938
Joined: Fri Jul 06, 2007 3:22 pm

Re: Grouped action specials in DECORATE

Post by Gez »

Enjay wrote:
Gez wrote:Here's a novel idea: stop using TNT1 A 0, start using "####" "#".
Given that it means "keep previous", what would it do if that was used at the start of a spawn sequence?
I know you're using the old DeepSea editor, but more modern editors have a handy feature where they parse DECORATE code to add actors automatically with the right icons and all.

This is what happens in these editors:
Spoiler:
Nice, isn't it? Beautiful, convenient, and elegant. Now, this is what happens when the Spawn state is TNT1 A.
Spoiler:
Excuse me while I'm going to puke.
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 »

What editor are you using, Gez? Or I should say, looks like SLADE but is that in the map editor?
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 »

DeePsea can parse DECORATE... but it doesn't do it particularly well for newer DECORATE stuff. :?

To be fair, most of my stuff does use the "correct" sprite. It's only when I want to give a whole bunch of actors the same sequence that I end up using TNT1 and, even then, I sometimes go back and edit the actors at a later date. Basically, my default is to use the sprite that immediately follows the 0 length state and I have no idea why so many people default to using TNT1 for a 0 duration state.

And, in answer to my own question "what happens if you use "####" "#" at the start of an actor"...
Spoiler:
Gez
 
 
Posts: 17938
Joined: Fri Jul 06, 2007 3:22 pm

Re: Grouped action specials in DECORATE

Post by Gez »

Major Cooke wrote:What editor are you using, Gez? Or I should say, looks like SLADE but is that in the map editor?
Spoiler:
User avatar
Ed the Bat
Posts: 3060
Joined: Thu May 03, 2012 1:18 pm
Graphics Processor: nVidia with Vulkan support
Location: Maryland, US
Contact:

Re: Grouped action specials in DECORATE

Post by Ed the Bat »

Gez wrote:Why do people always use TNT1 for zero length states?
It's precedented, for one thing.
Gez wrote:I know that it can trigger flickering bugs when you're making an actor switch between visible and invisible constantly.
I have never seen or heard of such a thing. Do you have any examples?
User avatar
randi
Site Admin
Posts: 7749
Joined: Wed Jul 09, 2003 10:30 pm
Contact:

Re: Grouped action specials in DECORATE

Post by randi »

This is dead simple to add with the scripting branch and is, in fact, already planned. As it happens, every line with an action actually gets turned into an anonymous function in the scripting branch. Calling more than one function per frame is just a matter of putting more than one function call inside the generated function.
Gez
 
 
Posts: 17938
Joined: Fri Jul 06, 2007 3:22 pm

Re: Grouped action specials in DECORATE

Post by Gez »

Ed the Bat wrote:
Gez wrote:Why do people always use TNT1 for zero length states?
It's precedented, for one thing.
It's a custom inventory's Pickup state, so something that would never be shown anyway. The Spawn state is normal and visible.
Ed the Bat wrote:
Gez wrote:I know that it can trigger flickering bugs when you're making an actor switch between visible and invisible constantly.
I have never seen or heard of such a thing. Do you have any examples?
download that: http://www.file-upload.net/download-995 ... l.wad.html
idkfa/give all
try the weapons
now do sv_fastweapons 1
try the weapons again
User avatar
edward850
Posts: 5886
Joined: Tue Jul 19, 2005 9:06 pm
Location: New Zealand
Contact:

Re: Grouped action specials in DECORATE

Post by edward850 »

I would like to point out that sv_fastweapons isn't intended to be sane.
Granted, the blank frames could be avoided as you say, but it's still not really the best example. Call me when sv_fastweapons creates a sane result. :P
User avatar
Ed the Bat
Posts: 3060
Joined: Thu May 03, 2012 1:18 pm
Graphics Processor: nVidia with Vulkan support
Location: Maryland, US
Contact:

Re: Grouped action specials in DECORATE

Post by Ed the Bat »

I believe sv_fastweapons is known to be buggy anyway (edit: edward beat me to the punch :)). Setting it to 1 makes all states 1 tic in duration, meaning it can potentially be slower than it should be, if it has a lot of 0-tic frames in it. So there should be no surprise things will look weird. And going by what you said, these frames are, also, never intended to be seen. The fact that a wonky console cheat can make it happen is really out of my hands. By this logic, using noclip to walk outside of a map and see HOMs should be considered a problem too.
Gez
 
 
Posts: 17938
Joined: Fri Jul 06, 2007 3:22 pm

Re: Grouped action specials in DECORATE

Post by Gez »

edward850 wrote:Call me when sv_fastweapons creates a sane result. :P
Ring! I've edited the DECORATE definitions of these weapons to use real sprites instead of TNT1 A, and now the result is sane.
Ed the Bat wrote:The fact that a wonky console cheat can make it happen is really out of my hands. By this logic, using noclip to walk outside of a map and see HOMs should be considered a problem too.
If HOMs never happened when noclipping unless a bad and pointless mapping practice was being used, it would be comparable.
Post Reply

Return to “Closed Feature Suggestions [GZDoom]”