CAOS

From Wikipedia, the free encyclopedia

For the cAos Linux operative system see cAos Linux.

CAOS is the scripting language used by the Creatures series of games. It is also used by the Sea-Monkeys computer game, which was developed using a modified Creatures engine. It is an abbreviation of "Creatures Agent/Object Scripting", but is almost always used in shortened form.

All autonomous agents (objects in Creatures; known as Creatures Objects, or COBs, in Creatures 1 and 2) in the Creatures games are scripted using CAOS. Many CAOS guides can be found on the internet, at various forums and websites.

Contents

[edit] Learning CAOS

Learning CAOS is particularly easy if the user is experienced with computer programming, but it is still relatively accessible for others. Each Creatures game has a slightly different implementation of CAOS, Creatures 1 and 2 differing a lot more than the more modern variants, and tutorials and support are available from online fansites, as well as from the official development support site.

In either Docking Station or Creatures 3, a list of all CAOS commands can be extracted from the game by typing one of the following commands into the CAOS command prompt (ctrl-shift-C in-game):

file oope 1 "caos categorical.html" 0 dbg: html 1 file oclo

for a categorical listing, or

file oope 1 "caos alphabetical.html" 0 dbg: html 0 file oclo

for an alphabetical listing.

The files are created in the 'Journal' game folder, in HTML format. Some Windows game versions have this folder located at C:\Program Files\[Creatures game]\Journal\.

[edit] CAOS basics

CAOS commands and functions are represented by four-letter tokens or multiples of, such as 'INST', 'TARG' or 'NEW: SIMP'. Scripting is done by stringing these tokens together with strings, numbers and labels. Commands do not return a value, and can only be the first token in a statement. Functions, on the other hand, do return a value, and thus can only be used as parameters.

An example CAOS statement might be:

SETV GAME "number_of_ducks" 5

When executed, the first function to be called would be 'GAME', with the string parameter "number_of_ducks". Then, the command 'SETV' would be called, with the first parameter being the return value of the earlier 'GAME' call, and the second parameter being the numeric value 5.

The functions themselves are from Creatures 3 era CAOS, and set a global game variable called "number_of_ducks" to have the numeric value 5. You could set other variables to 5 by substituting either the string passed to GAME (to set another global game variable) or by substituting the GAME function call for another one entirely.

You can see from this that CAOS statements are often difficult to understand, as the parameters of different functions are not clearly separated from each other, forcing you to check the documentation. The fact that CAOS has separate concepts of commands and functions also serves to complicate matters; you'll often encounter commands and functions which, while named identically, perform different actions and take different numbers of parameters.

[edit] .cos

.cos is the file format used for CAOS source files; it is plain text content.

In Creatures Village, Creatures 3 and Docking Station, there is a 'Bootstrap' folder in which .cos files can be placed directly. Scripts in the 'Bootstrap' are automatically run each time a new world is created or when the world switcher is opened, depending on where they were placed.

[edit] CAOS tools

An official Windows CAOS tool (for Creatures 3) made by the developers is available for download. It can be used to edit .cos files (including syntax highlighting) and to inject these files and raw CAOS directly into the game, as well as browse agent scripts which are already present in the current game world.

Some fans have made their own programs as front-end applications to make using CAOS simpler; the most common example of this is BoBCoB, made for the Creatures 1 and 2 games.

These tools also allow the user to create COB ('Creature OBject') files, in Creatures 1 and 2, and "agent" files in the other games, both of which provide a way of packaging the source of an agent along with the data files it needed, to allow easy use by other users of the games.

[edit] External links