Burgish Posted June 17, 2023 (edited) I've been using DECO for the last year and a half developing my gameplay mod. New weapons, new monsters, new pickups, etc... Basically everything other than the level architecture. DECO has always done what I need it to, even if I get a little stuck sometimes and need a workaround. However, I get the impression that DECO is the easier, less functional, better for beginners of the two options. I feel like at some point, I'll need to 'graduate' from DECO to ZScript, and my mod is far enough along that I'll be spending a lot of effort converting if I make the switch. From people who are familiar with both: what's the real difference between DECORATE and ZScript? What am I missing out on in ZScript? What can I do/what is simpler to do in Z that I can take advantage of? Do I really need to switch, or are big complex DECO projects entirely viable? And, of course, is there some third path that I'm not aware of? Edited June 17, 2023 by Burgish_Nilwert 0 Quote Share this post Link to post
WarvyGarvy Posted June 17, 2023 I feel as tho Xaser says it best in the first reply! I'm no expert in either. 2 Quote Share this post Link to post
baja blast rd. Posted June 17, 2023 You can do everything that is possible in DECORATE with ZScript too -- DECORATE is a subset of the ZScript language. For the simplest "new weapon/monster" projects (involving DECORATE actors or ZScript classes), ZScript and DECORATE are in the same ballpark of difficulty. For a lot of these projects, ZScript is basically DECORATE with semicolons. You'll be handling certain aspects a bit differently, like putting editor numbers in MAPINFO rather than the DECORATE header, but in a way that isn't meaningfully harder. There's also a whole lot of cool stuff you simply can't do in DECORATE that is basically trivial in ZScript. The silly mod I posted here took me 10 minutes (outside of finding /processing a sound) and under 10 lines of code using ZScript. And then to do anything complex, ZScript is easier by a mile. For further reading, this part of Agent_Ash's ZScript tutorial is very pertinent. Spoiler So, why ZScript? Before talking about variables, pointers and classes it’s a good idea to answer this simple question: why use ZScript at all? What if you’ve been doing relatively simple things and DECORATE + occasionally ACS have been working out fine for you? Should you still switch? You see, the question should actually be reversed. ZScript is now the default in GZDoom; DECORATE is deprecated (meaning it’s supported but will never be developed or updated further). So, the question should be: are there any reasons why I would not use ZScript? Let’s take a brief look. Isn't ZScript harder? No. It's important to understand that DECORATE is not a separate coding language; DECORATE is a subset of ZScript. In other words, it's the same thing as ZScript, just significantly cut down in terms of features. ZScript and DECORATE have an identical set of basic features and nearly identical basic syntax. Since ZScript fully includes DECORATE, they both have the same skill floor. ZScript offers more features, but having more options doesn't make it harder to use, it just offers more potential options to achieve your goals. How complex your code will be, depends entirely on you. While you might've seen other people create some really complicated code, there's absolutely no reason for you to immediately start doing that. It's perfectly fine to code basic stuff, the same way you would do it in DECORATE. Moreover, the more complicated is the stuff that you want to create, the easier ZScript becomes to use in comparison to DECORATE. There are plenty of examples where a specific system or a mechanic (for example, a universal bleeding system, like the one I created in 2021) are trivial to implement in ZScript, but if you try to do them in DECORATE, you end up with very complicated, overly long code that is hard to read and debug. (And, obviously, on top of that there's a multitude of things that simply can't be done at all in DECORATE). I’m just used to doing stuff in DECORATE And you don’t have to let that go! Well, there are some DECORATE habits that you’d better eventually say goodbye to, but remember: DECORATE is a part of ZScript, it's not a separate language. There are some very simple syntax differences (such as having to use semicolons at the end of most strings), but otherwise you can write code in ZScript the same way you would do it in DECORATE. In other words, if you can code in DECORATE, you by definition can already code in ZScript. But if I’m going to write the same code I would in DECORATE, what’s the point of switching? When you start using ZScript, eventually there will come a point when you decide to use a more advanced feature or create a custom function (or maybe even somebody will create it for you), or some other ZScript-only method. Or maybe you'll feel like incorporating a new feature in your mod only to be told "It's very easy in ZScript but impossible in DECORATE." And when that moment comes, if you’ve been writing your code in ZScript up until that point, you’ll just be able to plug that new shiny feature right into it. Whereas, if you’ve been using DECORATE, you’ll have to first at least partially translate your code into ZScript, which is easy but also tedious and takes a long time, and definitely not something you’re gonna want to do when the time comes. "However, I get the impression that DECO is the easier, less functional, better for beginners of the two options." People thinking this is common and a pretty huge misconception and seems like a visceral reaction not even to ZScript's programming features, but...semicolons. DECORATE is the similarly difficult, less functional, and worse for beginners of the two options. And for completion: DECORATE is the much harder, way less functional, and worse for experts of the two options. 5 Quote Share this post Link to post
ChaoticReverie Posted June 17, 2023 (edited) Decorate is old and no longer developed. ZScript can be thought of as a continuation of Decorate and at its most basic level is mostly the same. ZScript can be written the same way as Decorate with some minor differences. The main thing that you would want to switch over for is the ability to create new and edit existing functions. This is the main draw of ZScript in my opinion, though it can get orders of magnitude more complex than that. I learned ZScript by converting from Decorate and that's the best way I would suggest starting. You don't have to switch, but be aware that Decorate will be missing out on new features and will be far less flexible than ZScript is. Edited June 17, 2023 by ChaoticReverie 1 Quote Share this post Link to post
Xaser Posted June 17, 2023 3 hours ago, WarvyGarvy said: I feel as tho Xaser says it best in the first reply! I'm no expert in either. Heh, thanks for the quote -- I was on my way here to make basically the same post. :P Anyhow yup, what rd said -- there's nothing DECORATE can do that ZScript can't do better. Also seconding Agent Ash's tutorial as a good place to start for both total newcomers and DECORATE veterans -- it covers both angles. rd already linked it but here it is again for the thread-skimmers: https://github.com/jekyllgrim/ZScript_Basics 4 Quote Share this post Link to post
Burgish Posted June 17, 2023 Thanks everyone. Sounds like converting to ZScript asap is probably the best way for me to move forward, and its a good chance for me to review everything while I'm going to be to touching all the code anyways. This is something I've been putting off for a while, and I'm really glad there's a definitive answer so I don't have any excuse to waffle about it. I'll pass it along wherever I get the chance. 0 Quote Share this post Link to post
Danfun64 Posted June 18, 2023 5 hours ago, Xaser said: Anyhow yup, what rd said -- there's nothing DECORATE can do that ZScript can't do better. ...except online multiplayer, AFAIK. Zandronum's design AFAIK is wholly incompatible with ZScript, and the incomplete client/server branch of GZDoom hasn't seen any (public) updates in three years. TBH, I'm not sure how much ZScript in itself is incompatible with good multiplayer solutions. It might simply be that there hasn't been enough work put into a C/S port that supports it. I'm honestly not sure. ...though if nothing else, I'd love to see Zandronum caught up with GZDoom on non ZScript things. 0 Quote Share this post Link to post
ReaperAA Posted June 19, 2023 On 6/17/2023 at 10:03 PM, baja blast rd. said: When you start using ZScript, eventually there will come a point when you decide to use a more advanced feature or create a custom function (or maybe even somebody will create it for you), or some other ZScript-only method. Or maybe you'll feel like incorporating a new feature in your mod only to be told "It's very easy in ZScript but impossible in DECORATE." And when that moment comes, if you’ve been writing your code in ZScript up until that point, you’ll just be able to plug that new shiny feature right into it. Whereas, if you’ve been using DECORATE, you’ll have to first at least partially translate your code into ZScript, which is easy but also tedious and takes a long time, and definitely not something you’re gonna want to do when the time comes. ^This. This is the biggest mistake I made when making my Hexen Rebalanced mod (and also in case of my WIP Strife Rebalanced mod). Back when I made it, I used Decorate instead of ZScript, because I thought that just making a balance mod should be fine in Decorate and making it in Decorate would also allow my mod to run on Zandronum and thus be usable in MP. But since barely anyone plays Hexen's MP (let alone playing with my mod) and I don't use Zandronum myself, this was a mistake. There are a few things I wanted to add in my mod that I could've done in ZScript, but have no idea how to do in Decorate/ACS. Now I plan on converting my Decorate code to ZScript at one point, but its not gonna be fun. 2 Quote Share this post Link to post
PhoxFyre007 Posted June 19, 2023 It appears that the only reason for learning DECORATE syntax and such nowadays is for DoomTools's DECOhack because it is either utilize state-based modification with WhackEd4, or DECOhack. But seeing as it is GZDOOM-based, swap over to ZScript for its extension of DECORATE features. 0 Quote Share this post Link to post
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.