
Most properties and flags can be modified dynamically on already spawned actors-this will be described in the Pointers and casting chapter. For example, if you create a new class based on Zombieman (the Doom enemy), it’ll already have flags such as SOLID, SHOOTABLE, ACTIVATEMCROSS and some others set. You may need to unset flags if your class is based on another actor, rather than the base Actor, which already has some flags set (this is called inheritance, briefly covered further in this chapter). However, note that all flags are false by default. If you want to unset a flag, it has to be preceded with. Note that adding after a flag definition is optiona, in contrast to properties. This will create an actor that has 100 health, is solid (you can’t pass through it by walking), shootable (attacks will damage it and reduce its health it’ll also bleed unless you add the +NOBLOOD flag), and has a 32x56 hitbox in map units. The basic actor definition would look as follows:Ĭlass M圜lassName : Actor To create an actor class (such as a decoration, a monster or a weapon) it is recommended to always have access to the following Wiki pages:įunctions, flags and properties are what makes an actor work. Apart from gzdoom.pk3 you can also look at GZDoom github page to find all ZScript classes used in GZDoom.Some information on the syntax differences in this guide can be found here: Classes instead of actors.Information about DECORATE and ZScript differences on the wiki.Still, ZDoom Wiki remains an invaluable modding resource, it describes multiple functions and features available in GZDoom, and it’s extensively references in this guide.
#Gzdoom wiki code#
As a result, it requires a bit of research and critical thinking to use something from DECORATE in ZScript often it’ll be better to code a solution from scratch rather than try and convert DECORATE to ZScript (although the latter is possible). However, due to having a relatively small number of features, DECORATE code tends to use complicated and often inconvenient workarounds that are unnecessary and not recommended in ZScript. ZScript supports all DECORATE methods and functions, so all the examples you see on the wiki are still valid, provided you write them using ZScript syntax. At the moment it’s still supported by GZDoom (since GZDoom is designed for maximum backwards compatibility, so that all older projects are still playable in it), but there’s no reason to use it for newer projects because ZScript is an extension over DECORATE. Most importantly, a lot of the code examples described on the wiki are written not in ZScript but in DECORATE.ĭECORATE is a coding language that had been used in GZDoom before ZScript support was added. However, the wiki has existed since the dawn of ZDoom and as such describes multiple methods, including the ones that are deprecated or inefficient and no longer recommended for use. ZDoom Wiki and ZScript vs DECORATEĪ good resource that covers most of GZDoom’s functionality, including a lot of ZScript, is the ZDoom Wiki. Note that you never need to (and shouldn’t) copy those classes into your code you can just inherit from them or design your own code similarly. You can also find the definitions for the base classes on GZDoom github. GZDoom’s main file gzdoom.pk3, which can be found in the GZDoom root folder, contains all class definitions for Doom, Heretic, Hexen, Strife and Chex Quest games. One of the easiest methods of designing classes is looking at how it’s done in other mods, or just looking at the existing GZDoom classes.
#Gzdoom wiki mod#
Once you have a mod folder/archive and your base zscript file set up, you can start defining some classes. Almost all objects that can be spawned in the map are based on the Actor class and therefore are referred to as “actors.” Some of the common ZScript base class types are Actor, as well as Inventory and Weapon that are based on Actor. This is different from ACS (another GZDoom coding language used to code map events), which is a list of scripts that define various events that happen in order ACS scripts are not bound to a specific object. ZScript is an object-oriented coding language, which means that all of the code that is executed at runtime (during the game) must be defined within an object (the most common object being a Class).
#Gzdoom wiki how to#
🔵 « Previous: Where to start 🔵 » Next: How to see your classes in the game
