Code Monkey home page Code Monkey logo

zscript_basics's Introduction

ZScript Basics: A Guide for Non-Programmers (from a non-programmer)

Contents

  1. Introduction
  2. Why ZScript?
  3. Classes instead of actors
  4. Anonymous functions
  5. Variables and data types
    1. Overview
    2. Turning variables into actor properties
    3. Access modifiers
    4. Data types
  6. Pointers and casting
    1. Basic pointers
    2. Using pointers in ZScript
    3. Casting and custom pointers
    4. Type casting
  7. Custom functions
    1. Non-void functions and return values
  8. Virtual Functions
    1. ZScript Virtual Functions
    2. Common ZScript virtual functions
  9. Event Handlers
  10. Arrays (TBA)
  11. Constants and enums (TBA)
  12. Flow Control
  13. Best Practices and Rules of Thumb

Introduction

Everyone is talking about ZScript. DECORATE is dead, they say. You should be using ZScript, they say. I’m not gonna help you with your awful hacky DECORATE code, they say.

You look around, confused. You’ve been using DECORATE for years now. You check ZDoom Wiki, and it’s still almost all about DECORATE. ZScript is barely documented. They tell you to look into ZScript code in gzdoom.pk3, and when you do, it makes your head spin. DECORATE is plain and simple, and with ZScript you don’t understand what’s going on at all.

Confusion leads to frustration, frustration leads to resentment. All the cool kids are playing with ZScript, and you don’t even know how and where to start. You wonder if your Doom modding career is over.

Sounds familiar?

That’s where lots of DECORATE users (some of them—known and respected modders even) have been finding themselves ever since ZScript became a thing. The reason is simple: ZScript is basically a programming language, and DECORATE has barely anything to do with that concept. As a result, there are plenty of people who’ve been doing just fine with DECORATE, and just a handful of people with previous programming experience who find it much easier to use ZScript. And it’s not surprising, ZScript is easier to use (more on that later) but it’s not easy for a non-programmer to begin.

I decided to write this short entry guide to help alleviate exactly that: it covers some basic programming concepts in simple terms which will help you to get started. Starting, after all, is the hardest part.

Important notes

  1. This guide is aimed at people with prior DECORATE (and possibly ACS) knowledge. It implies that you know what GZDoom is, what actors are, how they're structured, how they interact with each other. All of those aspects are covered by ZDoom Wiki, so I don't feel there's a need to describe them within this guide.

  2. While all code examples in the guide are made to be runnable, it's not recommended to use them as is: many of them are purposefully inefficient, and the guide tends to iterate over them, improving various aspects while explaining new techniques. Examples are meant to be just that: examples—not ready-made solutions.

  3. This document is a guide, not a wiki. As such, it's designed to be read from beginning to end. Chapters are not self-contained and often rely on information explained earlier in the guide, so it's not recommended to skip anything.


🔵 >> Next: Why ZScript?

zscript_basics's People

Contributors

jekyllgrim avatar kizoky avatar

Watchers

James Cloos avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.