CAOS |
CAOS is the scripting language the Creatures series of games use. 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; termed COBs in C1/C2) in the Creatures games are scripted using CAOS. Many CAOS guides can be found on the internet, at various forums and websites.
=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.
=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.
=.cos=
.cos is the file format used for CAOS source files; it is just plain text content. In Creatures Village, Creatures 3 and Creatures 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. Scripts in the Switcher folder are run whe the game starts, and ones in the World folder are run when a new game is created, also it is possible to cause the script to be run when a world is loaded for the first time after the script is added, to do this you must place the script in a new folder in the bootstrap. This works because each world stores what folders were in the bootstrap folder last time it was opened, and the contents of new folders is run. In Docking Station scripts in the bootstrap can be re-run using the CAOS command line. If a script is not supposed to be run every time a new world is created, an old world is loaded or the game is run, but just when the user wishes, then you must either convert the script into a COB or agent file. Another method of running scripts is injecting them with a specialist tool.
=CAOS tools=
An official Windows [http://www.gamewaredevelopment.co.uk/cdn/cdn_more.phpCDN_article_id=103 CAOS tool] (for C3) 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.
=External links=
|
|