Introduction to A.P.E.
A.P.E. (Anachronox Programming Environment) is the scripting language layer that controls most of the standard interactivity within the world. If you can click something in the world that triggers a dialog, interface, or event, then chances are APE has played a major part in it. Now before you hop straight into APE, there are a few things you should know about it.
APE was originally written as a simple dialog parser. However as more interactivity was needed it was added to, and slowly it evolved into a relatively powerful scripting language. This evolution is important to understand when looking at the structure of the language. The first major thing you might notice is that there are two types of functions in APE, a window and a switch, and instead of function names there are sequences. These sequences are comprised of a bank and entry number. A typical window header might look like this:
In this case #window is the type, 123 is the bank , and 1024 is the entry . Typically a single bank number is used for an entire map or project. The APE lessons will get into all of this in much greater detail, so don't worry if this doesn't make sense at the moment.
The next major thing you might notice is that most of APE's power is external from APE itself. Since APE was originally only for dialog, additional features have been written into functions called externs. You can simply call these externs from APE to do an unlimited amount of things, from setting the XYZ of an entity, to adding to inventory, to fading out the screen. There are dozens and dozens of APE externs available, and with the DLL structure of Anachronox, it is even possible to add your own.
To access these script entries in the game, one of the following must occur:
Thanks to Richard Tew we now have an APE decompiler. This is a great tool used to study any of the APE code created for Anachronox. Remember that all code contained in compiled .ape files is copyrighted, thus you cannot use any code you may decompile. Use this tool ONLY to better learn how to program in APE.
Usage of this tool requires the installation of the interpreted object-oriented programming language Python.
These documents are primarily unchanged from their original release.