From DoomRL Wiki

Jump to: navigation, search

Welcome to the DoomRL modules tutorial. The objective of this guide is to explain how to develop your own modules for DoomRL as easily and as accurately as possible: therefore, its scope is fairly limited and will only cover basic techniques in customizing objects, maps, and game events. However, it is written at the level of one who has little to no background knowledge of programming languages, and so is ideal for a player who doesn't understand the fundamentals of scripting. Anyone who has the ambition to create a unique and enjoyable game out of the DoomRL engine should use this as a tool to get started.

Modifying DoomRL content is done through lua, a scripting language designed to communicate with a variety of other computer languages. (You can find out more about lua by following this link.) As such, a great deal of what can be done for the purpose of DoomRL modding is handled by the API, or application programming interface, which allows a modder to issue commands that are sent to the DoomRL engine (written in Pascal). The formatting and syntax is relatively simple and flexible, so there are a number of ways to write code in lua that will produce the same outcome. We will use a particular format, although alternatives will be explained as they come up.

Writing lua code yourself is done in a text editor. What text editor you use depends on your operating system: for Windows, it is Notepad. It is suggested that you use a more advanced text editor that handles formatting more effectively. One such text editor (that is free) is NotePad++, which includes a number of options for easy-to-read and easy-to-write code. Creating a lua file in this manner is as simple as renaming the file with a .lua extension (rather than .txt, for example): NotePad++ itself can save its text files as lua scripts.

Whenever example code is used in this tutorial, it will be displayed using a special formatting, as shown below:

This is an example sentence.
All spaces/symbols are shown completely          like so.
In addition, html formatting <b>cannot</b> work here.
However, certain words (for in or and, etc) as well as formats are colored;
--comments in the language are given using two dashes;
'and strings are expressed' between "single or double quotes".

Much of the tutorial is written in this format, as it is far easier to diplay lua without the default formatting of Wikimedia getting in the way.

Current tutorials: (these have yet to be updated for v0.9.9.5)

Personal tools