[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.

[Tutorial] Ascending to ZScript

Postby Marinelol » Thu Jul 20, 2017 8:29 am

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
Marinelol
ONLY PEGG
 
Joined: 06 Feb 2011

Re: [Tutorial] Ascending to ZScript

Postby phantombeta » Thu Jul 20, 2017 9:15 am

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
phantombeta
In the meadow of sinful thoughts, every flower's a perfect one
 
Joined: 02 May 2013
Location: Brazil, South America, Earth, Orion-Cygnus Arm, Milky Way
Discord: phantombeta#2461
Twitch ID: phantombeta_
Github ID: Doom2fan
Operating System: Windows 10/8.1/8/201x 64-bit
OS Test Version: No (Using Stable Public Version)
Graphics Processor: nVidia with Vulkan support

Re: [Tutorial] Ascending to ZScript

Postby Marinelol » Thu Jul 20, 2017 9:18 am

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
Marinelol
ONLY PEGG
 
Joined: 06 Feb 2011

Re: [Tutorial] Ascending to ZScript

Postby Major Cooke » Sun Jul 23, 2017 7:09 am

I take it this and this was too confusing?
User avatar
Major Cooke
QZDoom Maintenance Team
 
Joined: 28 Jan 2007

Re: [Tutorial] Ascending to ZScript

Postby Marinelol » Sun Jul 23, 2017 7:34 am

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!
User avatar
Marinelol
ONLY PEGG
 
Joined: 06 Feb 2011


Return to Tutorials

Who is online

Users browsing this forum: No registered users and 1 guest