ZScript is a [[BSD-3]] licensed [[Domain Specific Programming Language]] for [[GZDoom]] written in [[C++]]. - [Website](https://zdoom.org/wiki/ZScript) - [Source](https://github.com/ZDoom/gzdoom/tree/master/src/common/scripting) - [Documentation](https://github.com/zdoom-docs/stable/blob/master/README.md) > ZScript is a new (circa 2017) scripting language that has sprung from the ceasing of ZDoom and the subsequent reprisal of GZDoom as mainline. It is similar to Java, though it has many deficiencies, oddities and other such issues. Despite this, it is still the most powerful Doom modding tool since straight up source editing \- docs[^1] # Notability # Philosophy ## Origin Originally conceived as DoomScript, inspired by [[UnrealScript]], and was developed without a full public release between [[1999]] and [[2016]] when it was renamed ZScript. In the time between some of the novel features were merged into `DECORATE` or implemented in the entine's extensions to [[Hexen]]'s [[Action Code Script]]. In [[2007]] there was a consideration to instead use [[Lua]] before the community pushed to continue "DoomScript" development. ZScript finally had its official release in [[2017]]. # Platform Support # Features - case insensitive keywords - dynamic arrays - scoped variables - functions/members are `public` by default - no pointer math allowed - uses `let` to inference types of variables - uses `self` to reference the current object - supports multiple value returns with destructuring assignment - supports named arguments after required arguments, cannot be used out of order though - requires `;` semicolons `:(` - supports mixins, virtual functions, abstract classes, inheritance - has several useful types like Vectors, Quaternions, and first-class Colors ## Virtual Machine > ZScript runs in a virtual machine much like ACS, although because it is not compiled to bytecode and uses an object-oriented structure, the virtual machine is far more complex, and also therefore quite a bit slower. ZScript may only be read from source files by the engine, which has several benefits as well as detriments. It is the opinion of the author that this is a bad solution, but the author will refrain from going on a several-paragraph tirade about why bytecode is always better than source, even if it is an optional component. \- docs[^1] # Tips # Resources ## Tutorials - https://forum.zdoom.org/viewtopic.php?t=79101 # References [^1]: https://github.com/zdoom-docs/stable/blob/master/language.md