"Goto" Keyword for DECORATE Multi-Blocks

Moderator: GZDoom Developers

Post Reply
User avatar
Major Cooke
Posts: 8212
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:

"Goto" Keyword for DECORATE Multi-Blocks

Post by Major Cooke »

It'd be nice to have a special goto keyword for DECORATE usage inside multiblocks, along with the Stop command.

Code: Select all

{ Goto("State"); } 
//Translates into:
{ A_Jump(256,"State"); return; }
Because typing that out over and over again is getting old. Fast.
User avatar
Tormentor667
Posts: 13556
Joined: Wed Jul 16, 2003 3:52 am
Preferred Pronouns: He/Him
Operating System Version (Optional): Windows 11
Graphics Processor: nVidia (Modern GZDoom)
Location: Germany
Contact:

Re: "Goto" Keyword for DECORATE Multi-Blocks

Post by Tormentor667 »

Fully agreed
ZzZombo
Posts: 317
Joined: Mon Jul 16, 2012 2:02 am

Re: "Goto" Keyword for DECORATE Multi-Blocks

Post by ZzZombo »

As a keyword, it should not require parentheses around the parameter.
User avatar
Graf Zahl
Lead GZDoom+Raze Developer
Lead GZDoom+Raze Developer
Posts: 49235
Joined: Sat Jul 19, 2003 10:19 am
Location: Germany

Re: "Goto" Keyword for DECORATE Multi-Blocks

Post by Graf Zahl »

I'm not really sold on thls.
Remember: In DECORATE the actual meaning of 'goto' is not the same as 'A_Jump' and having it be an alias here will ultimately only add confusion.
Gez
 
 
Posts: 17946
Joined: Fri Jul 06, 2007 3:22 pm

Re: "Goto" Keyword for DECORATE Multi-Blocks

Post by Gez »

Keyword: Jumpto
User avatar
Xaser
 
 
Posts: 10774
Joined: Sun Jul 20, 2003 12:15 pm
Contact:

Re: "Goto" Keyword for DECORATE Multi-Blocks

Post by Xaser »

I was gonna suggest adding a directive along the lines of "VGoto" (for "Virtual Goto") but "Jumpto" or just "Jump" sounds better. :P

Aside from its obvious use in multi-blocks, it'd be nice to be able to avoid the unintuitive "A_Jump(256, 'State')" for inheritance-friendly ("virtual" in the c++ sense) jumps.
User avatar
Major Cooke
Posts: 8212
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: "Goto" Keyword for DECORATE Multi-Blocks

Post by Major Cooke »

I like Gez's style more.

Or does this all still fall under the same reasoning, graf?
User avatar
Nash
 
 
Posts: 17501
Joined: Mon Oct 27, 2003 12:07 am
Location: Kuala Lumpur, Malaysia
Contact:

Re: "Goto" Keyword for DECORATE Multi-Blocks

Post by Nash »

Why would you want to change the original behavior? Goto VS A_Jump(255) behaves VERY differently especially when inheritance is involved, there were specific situations where I HAD to use A_Jump instead of Goto in the past, and sometimes vice versa; it wouldn't have worked any other way.
User avatar
Major Cooke
Posts: 8212
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: "Goto" Keyword for DECORATE Multi-Blocks

Post by Major Cooke »

That was not my intention at all.
Last edited by Major Cooke on Fri Feb 12, 2016 7:29 am, edited 1 time in total.
User avatar
Graf Zahl
Lead GZDoom+Raze Developer
Lead GZDoom+Raze Developer
Posts: 49235
Joined: Sat Jul 19, 2003 10:19 am
Location: Germany

Re: "Goto" Keyword for DECORATE Multi-Blocks

Post by Graf Zahl »

It's the same word, so that's not a good idea. Currently it's as easy to say as 'A_Jump is different from Goto because...'.
If you introduce 'Goto' here it becomes, 'Goto is different from Goto, because...' and that's hard to communicate.
User avatar
Major Cooke
Posts: 8212
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: "Goto" Keyword for DECORATE Multi-Blocks

Post by Major Cooke »

Well we can still do it Gez's way. I say that's good enough.
User avatar
Graf Zahl
Lead GZDoom+Raze Developer
Lead GZDoom+Raze Developer
Posts: 49235
Joined: Sat Jul 19, 2003 10:19 am
Location: Germany

Re: "Goto" Keyword for DECORATE Multi-Blocks

Post by Graf Zahl »

In other words, an action function that always jumps, right, i.e. A_Jump without the randomness?
User avatar
Major Cooke
Posts: 8212
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: "Goto" Keyword for DECORATE Multi-Blocks

Post by Major Cooke »

That incorporates the return; functionality too, yes. It's quite a bit of a hassle forgetting to include returns and seeing them go complete sideways because of it. Also, because it's annoyingly redundant.

Though now that I think about it, a boolean to allow the rest of the function to process could be useful.

Of course, this doesn't make the return function defunct at all. The return function can still be used in a variety of places and in creative ways still.
User avatar
randi
Site Admin
Posts: 7749
Joined: Wed Jul 09, 2003 10:30 pm
Contact:

Re: "Goto" Keyword for DECORATE Multi-Blocks

Post by randi »

Added, after a fashion. Jumping is now done by returning a state from the action function.
Post Reply

Return to “Closed Feature Suggestions [GZDoom]”