[Tutorial] Ascending to ZScript

Handy guides on how to do things, written by users for users.

Moderators: GZDoom Developers, Raze Developers

Forum rules
Please don't start threads here asking for help. This forum is not for requesting guides, only for posting them. If you need help, the Editing forum is for you.
Post Reply
User avatar
Marinelol
Posts: 68
Joined: Sun Feb 06, 2011 7:37 am

[Tutorial] Ascending to ZScript

Post by Marinelol »

In this tutorial we will take the Revenant's Decorate implementation and update him to ZScript , And while at it we will make him deadlier to showcase some of ZScripts features. Pardon me butchering some of the terms, This tutorial is aimed at letting people do things in ZScript based purely off their ACS\Decorate knowledge. This tutorial is for people who know Decorate\ACS but find it confusing to start coding in ZScript

This tutorial assumes you have knowledge about the following:
  1. Slade3.
  2. Decorate and ACS.
  3. How to use the wiki.
  4. How to get and use the newest GZDoom versions.
We are going to use the revenant and his projectile on the wiki as the base:
1) Visit the revenant page.
2) Visit the projectile page.

Without further delay let's begin:
1) Create your wad\pk3. Please note that while this tutorial won't use directories, you are hugely encouraged to use them in a real mod.
2) Add a new entry and call it ZScript. View as text and make sure the text language is set to Zdoom ZScript. Save if you want to.
Spoiler: 3)Converting the revenant to ZScript
Spoiler: 4)Update the states
Spoiler: 5) Smart Chase
I forgot to provide updated versions of the file for the following steps, I am sorry! But you'll have to compare with the complete finished file if something doesn't work.
Spoiler: 6) Dangerous Melee
Spoiler: 7) Projectile Check
Spoiler: Let's try variables, Virtual Functions and some more conditions
Now that it is done our ZScript file should look like this :
Click Here!
If you need my wad here it is.
Spoiler: Extra Suggestions
All Feed back welcome, Especially if a certain step is completely ambiguous or a better way to format the tutorial.

Edit : Wrong forum I think, Sorry!
User avatar
phantombeta
Posts: 2088
Joined: Thu May 02, 2013 1:27 am
Operating System Version (Optional): Windows 10
Graphics Processor: nVidia with Vulkan support
Location: Brazil

Re: [Tutorial] Ascending to ZScript

Post by phantombeta »

This seems pretty useful for someone who wants to learn ZScript.

Flags don't need a ';', by the way. They work fine without it. (This only applies to flags. Properties and variables still need it.)
IIRC the only reason you can even do that is because Graf added code to let you do that for consistency. (Since everything else ends with ';'.)
User avatar
Marinelol
Posts: 68
Joined: Sun Feb 06, 2011 7:37 am

Re: [Tutorial] Ascending to ZScript

Post by Marinelol »

Good to know, I got to the habit of spamming semicolons just in case tbh :P. Can't believe I forgot to add a section to mention flags can be modified by typing bflagname as well. Will try to update the guide with it later.
User avatar
Major Cooke
Posts: 8175
Joined: Sun Jan 28, 2007 3:55 pm
Preferred Pronouns: He/Him
Location: QZDoom Maintenance Team

Re: [Tutorial] Ascending to ZScript

Post by Major Cooke »

I take it this and this was too confusing?
User avatar
Marinelol
Posts: 68
Joined: Sun Feb 06, 2011 7:37 am

Re: [Tutorial] Ascending to ZScript

Post by Marinelol »

They don't really serve the exact same purpose, This one doesn't go into much details before getting started ; very low level tutorial. The first link is definitely a must read after this tutorial though!
Post Reply

Return to “Tutorials”