Writing the .CS File

Shapes consisting of multiple files must be merged together in the engine using a .CS script file.

To create a .CS file:

1. Open a new document using a text editor (Notepad or Wordpad will work fine).

2. Enter the following lines:

datablock TSShapeConstructor(mySimpleBoxDTS)
{
    baseShape = "./mySimpleBox.dts";
    sequence0 = "./mySimpleBox_bendFrontBack.dsq bendFrontBack";
    sequence1 = "./mySimpleBox_bendSide.dsq bendSide";
    sequence2 = "./mySimpleBox_look.dsq look";
    sequence3 = "./mySimpleBox_jumpForward.dsq jumpForward";
    sequence4 = "./mySimpleBox_jumpUp.dsq jumpUp";
    sequence5 = "./mySimpleBox_fallBack.dsq fallBack";
};

3. Save the file as mySimpleBox.cs in the same location as the shapes DTS and DSQ files.

The first line of the .CS files constructs the shape in the engine. Then the base shape (the DTS file) is added. Then all of sequences are added. Each sequence has an index number and a name associated with it. Animations are called by index number in the engine. The sequence names are visible in the Thread Control section of the ShowTool.

<< Previous | Next >>