CobConverter v0.2
=================
A program for converting Creatures 1 COB files (*.cob)
into the Creatures 2 cob file format.

Usage
=====
CobConverter <c1cob.cob> <c2cob.cob> <imagefile.s16> [remover.rcb]

eg:

CobConverter cheese.cob c2cheese.cob cmac.s16

Creates a C2 cob file called c2cheese.cob which is in the
correct format for injection using the Creatures 2 Object
Injector.

If the cob file you are converting has spaces in the name,
you must surround the filename with quotes. eg:

CobConverter "Bed Time Bear.cob" "c2\Bed Time Bear.cob" pets.s16

The <imagefile.s16> must be in creatures 2 format. You can
convert Creatures 1 sprite files into the creatures 2 image
format using spr2s16 available at my web site. If there is no
image file for this cob you still must put in an existing image
name. I used cmac.s16 for testing.

The [remover.rcb] is an optional argument. If it exists it should
be the filename of the Creatures 1 remover cob for the cob you are
converter. In the Bed Time Bear example it would be:

CobConverter "Bed Time Bear.cob" "c2\Bed Time Bear.cob" pets.s16 "Bed Time Bear.rcb"

The removal script from the .rcb file will be added to the C2 cob.

Notes
=====
This is another one of those horrible command line utilities.
I will try and do a graphical user interface for it soon but
I wanted to get something 'out there' quickly.

It will not convert some cobs. Those C1 cobs that have multiple
injection scripts will not convert over as I do not know the
C2 format to do this. CobConverter will warn you if you try to
convert one of these cobs. I've only come across one so far and
that is the XmasHolly.cob that comes with the life kit.

Just because you can convert a C1 cob does not mean that it will
work correctly. Most of the chemicals and classifications have
changed in C2 and these will need to be changed in the cobs. This
tool is mainly for Cobblers to enable them to create C2 cobs using
any of the third party cob editors out there (BobCob and COE both
work). Create the cob as normal using the Cob Editor and when complete
convert it using this utility. Don't forget to convert the image file
if it has one. 

When converting the image contained within the .cob file I convert
it to 5-6-5 format (see the documentation for spr2s16 if you don't
understand this). This may not work on all video cards. If the image
that appears in the object injector looks strange, let me know. I
will eventually do a 5-5-5 version.

It is a test version as I've had to make some assumptions about
the file formats - please let me know if you have any problems.

If no bugs are found and things seem to work OK I'll release the
source code. If you want a copy of the source code as is, let me
know.

Caveat
======
This is a test program. It writes a file that is as compatible with the
C2 file format as I understand it. It may crash your machine or do other
horrible things if things go wrong. Please make sure you back up your
world.sfc file before using cobs created with this program. I will not be
held responsible for any damage or loss of norns that may arise from this
program.

If you run the Object Injector from C2 and it crashes or gives an error
messsage, delete any cobs in the 'Objects' subdirectory that were created
with this program. Add them one by one, running the Injector in between.
Whichever one it crashes on could you please email it to me and I'll try
and work out the problem. 

I have tested it on all the cobs that I have and none crash Creatures 2
when starting the object injector. I created a small test cob from scratch
and created scripts using COE based upon Sandra Linkletters Cream Cheese.cob.
This injected fine and worked as food for my norns.

Example
=======
I used the "bed time bear.cob" to test. It uses pets.spr for the images. I
ram spr2s16 on this image:

spr2s16 c1\images\pets.spr c2\images\pets.s16

I modified the cob scripts using BobCob to be C2 compatible. I then ran:

cobconverter "c1\bed time bear.cob" "c2\objects\bed time bear.cob" pets.s16 "c1\bed time bear.rcb"

Running C2 and the object injector enabled me to select the new cob, inject it, and remove it.

Conversions...
==============
C2 has some new features in the cob file that I don't convert over yet. 
I also don't convert everything over from the existing C1 cob. The following 
should be noted:

a) If the C1 cob has an expiry date, this is ignored.
b) Any usage counter in the C1 cob is ignored and set to 0 in the C2 cob.
c) C2 cobs have a description field. I set this to the same as the C1 cob name.
d) C2 cobs have a minimum time allowed between injections. I set this to zero.

Acknowledgements
================
Many thanks to Sandra Linkletter for identifying and posting the format
of C2 cobs on alt.games.creatures.

History
=======
V0.1 - Initial Release.
V0.2 - Added removal script capability. Fixed bug in 'time between injections'.

In Closing...
=============
Remember, converting and using existing COBS will probably not work unless they
have been modified to use c2 chemicals and classifications...

Chris Double.
chris@cnd.co.nz
http://www.cnd.co.nz/creatures

