A COS file intended to become a COB can have up to 3 distinct parts within it; the Installation Script, the Events Scripts and the Remove Scripts.
With this in mind, the structure of a COS file can be shown as below:
COS FILE – this will make a ball
*** You can use asterisks for marking a line as a comment
*** and it will be ignored by the COB Compiler
******** Here’s the Installation part – use the token ‘iscr’ to mark this part of the
********the COS file as being for installation.
***Place all the commands to create the object(s) here, one command per line.
***You can use spacing and tabs to make the code more readable For example,
new: simp bal2 8 0 500 0
setv cls2 2 13 4
setv attr 199
bhvr 1 11
setv size 110
setv accg 5
setv rest 20
setv aero 5
mvto 5300 400
setv grav 1
********Here’s some Event Scripts – the compiler will know that the Installation part has finished by the use of ‘endm’ at the end of the ‘iscr’ section, or by the use of the ‘scrp’ command.
scrp 2 13 4 6
setv actv 0
doif wall eq 3
doif velx lt 0
doif velx gt 0
doif wall eq 0
doif wall eq 1
doif grav eq 0
stim shou 40 8 0 0 36 50 45 50 42 50 0 0
scrp 2 13 4 1
stim writ from 20 9 20 0 42 10 36 50 45 100 44 50
setv var0 posl
setv var1 posr
addv var0 var1
divv var0 2
setv var1 posl
doif var1 lt var0
rndv var2 15 25
rndv var2 -25 -15
setv velx var2
setv vely -40
setv actv 0
********Here’s the removal part – these commands will remove the physical presence of the object ********from Albia, but also remove the scripts it injected. Use the token ‘rscr’ to mark this section as ********containing the removal scripts
enum 2 13 4
scrx 2 13 4 6
scrx 2 13 4 1
And thats it!
The full range of CAOS commands are detailed in a different document, the purpose of this is to show that a COS file is a simple data structure and can be created with a text editor.
So how can I turn a COS file into a COB I can distribute?
By creating a COS file in the format detailed above you are essentially creating the bare bones of a COB. All that is then needed is to pass it through a COB Compiler and add the extra files needed for the object to work (images and sounds).
Some points to bear in mind when creating a COS with the intention of making a COB:
A note on classifiers:
The species aspect of the classifier has a range from 1 to 65,535 but not all of these are available for use. The table below shows the allocation of classifiers: