The Black & White Challenge Language allows you to write scripts which control various aspects of the game world. This document describes how to do just that. The basic idea is that challenges are written in a pseudo-language which actually works! The challenge DLL is able to either parse text files, load compiled challenges, save challenges out as byte-code, start scripts, stop tasks and so on.
All valid Challenge Language files consist of four major sections, which must occur in the order specified in this section.
Statements appear in the body section of scripts. There are many statements available for you to use. Each of them results in something happening somewhere! Statements do not return a result.
Exceptions let you break out of a code block as soon as something happens, rather than checking something only at the beginning or end of a code block. Most often used with loops.
Variables are where you store values or game objects. Assignments are followed by expressions.
A condition is something that is either true or false. It is used primarily for if blocks, while loops and wait until.
These can be used as either expressions or as statements
8 Objects
These functions always return an object in the game. They mostly deal with either creating an object or finding an object in the world.
These can be used as either statements or as objects.
10 Constants
When you're doing things like playing animations, setting or getting the states of objects and things like that, you'll need to know the names of the constants which the game uses to refer to things. There are absolutely hundreds of these, so we shan't enumerate them here. See a programmer if you want to know the constants which are available to you. As we have previously seen, you can define your own constants, both locally and globally, to abbreviate these unwieldy names, making your scripts more readable.
11 Position
A reference to a coordinate in game.
12 Expressions
Expressions have a numerical value. They may be just a number, a value gotten from an object or the result of a complicated arithmetic equation. In this section we introduce all the different forms of expression available in the challenge language.
13 Spirit Type
Differentiates between the evil spirit and the good spirit.
references an existing variable, or uses a reference to get to a variable.
references an existing variable from an array.
MyArray[3]
references an existing variable from an array.
MyArray[MyVariable]