Named scripts

Archive of the old editing forum
Forum rules
Before asking on how to use a ZDoom feature, read the ZDoom wiki first. This forum is archived - please use this set of forums to ask new questions.
User avatar
Nash
 
 
Posts: 17500
Joined: Mon Oct 27, 2003 12:07 am
Location: Kuala Lumpur, Malaysia
Contact:

Re: Named scripts

Post by Nash »

I imagine the GZDoom version will take a while though... there hasn't been any GZDoom updates in a while (no offense to Gez; I'm sure it's not as easy as Ctrl + C and Ctrl + V!)...
User avatar
Xaser
 
 
Posts: 10774
Joined: Sun Jul 20, 2003 12:15 pm
Contact:

Re: Named scripts

Post by Xaser »

I almost posted a thread about this, but never did for some reason I can't fathom.

Either way, Kudos, Randy! One of the coolest and most useful feature additions I've seen in a long while. :D
User avatar
Graf Zahl
Lead GZDoom+Raze Developer
Lead GZDoom+Raze Developer
Posts: 49234
Joined: Sat Jul 19, 2003 10:19 am
Location: Germany

Re: Named scripts

Post by Graf Zahl »

Nash wrote:I'm sure it's not as easy as Ctrl + C and Ctrl + V!)...

Actually, it's a lot easier. SVN's merge feature will do most of the work fully automated.
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: Named scripts

Post by NeuralStunner »

Gez has already said he's waiting on a couple patches before he does the porting.
User avatar
Nash
 
 
Posts: 17500
Joined: Mon Oct 27, 2003 12:07 am
Location: Kuala Lumpur, Malaysia
Contact:

Re: Named scripts

Post by Nash »

How do I use this in UDMF? Doom Builder 2 doesn't let you use strings when you add the named execute specials on the linedef...
Gez
 
 
Posts: 17946
Joined: Fri Jul 06, 2007 3:22 pm

Re: Named scripts

Post by Gez »

The "Named" versions of functions are for ACS and DECORATE only. For UDMF, keep using the old specials. Go to the Custom tab, and add a new "arg0string" property to the linedef. Type the name of the script there. The script number will be ignored.
User avatar
Nash
 
 
Posts: 17500
Joined: Mon Oct 27, 2003 12:07 am
Location: Kuala Lumpur, Malaysia
Contact:

Re: Named scripts

Post by Nash »

Got it, thanks!
User avatar
Ryan Cordell
Posts: 4349
Joined: Sun Feb 06, 2005 6:39 am
Preferred Pronouns: No Preference
Operating System Version (Optional): Windows 10
Graphics Processor: nVidia (Modern GZDoom)
Location: Capital of Explodistan

Re: Named scripts

Post by Ryan Cordell »

ACS_NamedExecuteWithResult is still missing at the moment. Hopefully it'll be in soon enough.
User avatar
Nash
 
 
Posts: 17500
Joined: Mon Oct 27, 2003 12:07 am
Location: Kuala Lumpur, Malaysia
Contact:

Re: Named scripts

Post by Nash »

Yup, it doesn't work as expected (yet):

http://forum.zdoom.org/viewtopic.php?f=2&t=32037
User avatar
randi
Site Admin
Posts: 7749
Joined: Wed Jul 09, 2003 10:30 pm
Contact:

Re: Named scripts

Post by randi »

Gez wrote:add a new "arg0string" property to the linedef
That's "arg0str", actually.
User avatar
MartinHowe
Posts: 2078
Joined: Mon Aug 11, 2003 1:50 pm
Preferred Pronouns: He/Him
Location: East Suffolk (UK)

Re: Named scripts

Post by MartinHowe »

randy wrote:
printz wrote:Oh, scripts are named that way? I thought they're supposed to look like identifiers.
Nope. People already use #define to give scripts symbolic names, so they have to be strings, or all the people who had #defined names for their scripts will have their scripts break if they compile them with the new ACC.
Well that's a real bummer. It's like getting the beautiful woman back to the hotel and finding she's a ladyboy :( :(
So basically, we'll still need #defines anyway: e.g.,

Code: Select all

#define MyScriptName "MyScriptName"
script MyScriptName(...)
Sure it's easy enough, just needs a bit of discipline; but that sort of boilerplate is what computers are supposed to be used for. Pity there can't be a #pragma keyword and an option to automatically do a define like that for each script whose identifier is not a number, for folks who have always used #defines with clean naming anyway. I guess the parser would be a bitch.
User avatar
randi
Site Admin
Posts: 7749
Joined: Wed Jul 09, 2003 10:30 pm
Contact:

Re: Named scripts

Post by randi »

You honestly can't have two quote marks in the script definition? I completely fail to see what the big deal is.

Anyway, your example won't work. By the time the #definition has been made, the string has already been turned into a number. (If it even works; I've not checked.)
Blzut3
 
 
Posts: 3209
Joined: Wed Nov 24, 2004 12:59 pm
Graphics Processor: ATI/AMD with Vulkan/Metal Support
Contact:

Re: Named scripts

Post by Blzut3 »

Wait for ACC++? :P
User avatar
Nash
 
 
Posts: 17500
Joined: Mon Oct 27, 2003 12:07 am
Location: Kuala Lumpur, Malaysia
Contact:

Re: Named scripts

Post by Nash »

What's the big deal? It's just a couple of ""'s. We have all been dealing with quote marks in programming since ever (well, unless you're a weirdo who never ever touches strings).
User avatar
randi
Site Admin
Posts: 7749
Joined: Wed Jul 09, 2003 10:30 pm
Contact:

Re: Named scripts

Post by randi »

Also, it's perfectly reasonable to use spaces inside script names.
Locked

Return to “Editing (Archive)”