Documentation¶
User Guide¶
Installation¶
System Requirements¶
Python is required in the version 3.7. or higher, it can be downloaded at https://www.python.org/downloads/.
During the Windows installation you should make sure that the PATH
/ environment variable is set and pip
is installed.
Under Linux it should be ensured that pip
is installed, if this is not done with the standard installation.
Installation¶
pip install cmt
Using cmt¶
The program is a terminal program, so it runs from the terminal.
Calling with: .. code-block:: none
cmt
- -h, --help¶
show this help message and exit
- -v, --version¶
show program’s version number and exit
- convert file {cmap,ecmap} {0,1} output¶
convert file to type, version and output file
Internals¶
Reference material.
cmt¶
cmt.a_converter¶
cmt.a_map¶
cmt.convert¶
cmt.decode¶
- raises ValueError
something failed
- rtype
cmt.encode¶
cmt.static_data¶
cmt.utils¶
- cmt.utils.debug_print(data, what, value, offset=None)¶
- cmt.utils.to_hex(data)¶
cmt.blender¶
cmt.cmap¶
cmt.cmap.a_cmap¶
cmt.cmap.a_entity¶
cmt.cmap.v0¶
cmt.cmap.v0.cmap¶
- class cmt.cmap.v0.cmap.CMap¶
Bases:
cmt.cmap.a_cmap.ACMap
Celaria .cmap format (version 0)
Datatypes
Abbreviation
Type
Byte size
uByte
unsigned byte
1
uShort
unsigned short
2
uInt
unsigned int
4
sShort
signed short
2
sInt
signed int
4
f32
float
4
f64
double
8
Description format
> <datatype> (<number of datatypes in sequence>) // <description>
or
> [<variable name>] : <datatype> (<number of datatypes in sequence>) // <description>
Format
> uByte (11) // string identifier > uByte (1) // version > nameLen : uByte (1) // number of characters in map name > uByte (nameLen) // map name as String > uByte (1) - boolean, if the timer will be run in singleplayer > uByte (1) // unused byte > times : uByte (1) - number of checkpoint times (including medal time) > uInt (times) // checkpoint times for platin > uInt (times) // checkpoint times for gold > uInt (times) // checkpoint times for silver > uInt (times) // checkpoint times for bronze > f32 (1) // sun rotation on Z axis > f32 (1) // sun height expressed as an angle (between 0 and 90 degrees) > f64 (1) // preview camera position x > f64 (1) // preview camera position y > f64 (1) // preview camera position z > f64 (1) // preview camera look at position x > f64 (1) // preview camera look at position y > f64 (1) // preview camera look at position z > entityNumber : uInt (1) // number of entities on the map for entity in entityNumber { > entityType : uInt (1) // entityType switch(entityType) { case 0: // block > blockType : uByte (1) // blockType/color > uByte (1) // unused byte > sInt (1) // position x > sInt (1) // position y > uInt (1) // position z > uInt (1) // scale x > uInt (1) // scale y > uInt (1) // scale z > f32 (1) // rotation on Z axis if (blockType == 5){ // checkpoint block > uByte (1) // checkpoint Number } case 1: // sphere > sInt (1) // position x > sInt (1) // position y > sInt (1) // position z case 2: // player start > uByte (1) // unused byte > sInt (1) // position x > sInt (1) // position y > sInt (1) // position z > f32 (1) // rotation on Z axis case 128: // dummy id > uByte (1) // ID > sInt (1) // position x > sInt (1) // position y > uInt (1) // position z > uInt (1) // scale x > uInt (1) // scale y > uInt (1) // scale z > f32 (1) // rotation on Z axis }
cmt.cmap.v0.entities¶
- class cmt.cmap.v0.entities.Block¶
Bases:
cmt.cmap.a_entity.AEntity
- classmethod decode(data, offset, debug=False)¶
- class cmt.cmap.v0.entities.BlockType(value)¶
Bases:
enum.Enum
An enumeration.
- CHECKPOINT = 5¶
- FINISH = 1¶
- ICE = 4¶
- JUMP = 2¶
- NOTHING = 0¶
- SPEED = 3¶
- class cmt.cmap.v0.entities.Dummy¶
Bases:
cmt.cmap.a_entity.AEntity
- classmethod decode(data, offset, debug=False)¶
- class cmt.cmap.v0.entities.PlayerStart¶
Bases:
cmt.cmap.a_entity.AEntity
- classmethod decode(data, offset, debug=False)¶
- Parameters
- Return type
cmt.cmap.v0.medal_time¶
cmt.cmap.v1¶
cmt.cmap.v1.cmap¶
- class cmt.cmap.v1.cmap.CMap¶
Bases:
cmt.cmap.a_cmap.ACMap
Celaria .cmap format (version 1)
Datatypes
Abbreviation
Type
Byte size
uByte
unsigned byte
1
uShort
unsigned short
2
uInt
unsigned int
4
sShort
signed short
2
sInt
signed int
4
f32
float
4
f64
double
8
Description format
> <datatype> (<number of datatypes in sequence>) // <description>
or
> [<variable name>] : <datatype> (<number of datatypes in sequence>) // <description>
Format
> uByte (11) // string identifier > uByte (1) // version > nameLen : uByte (1) // number of characters in map name > uByte (nameLen) // map name as String > uByte (1) // unused - gamemode > uByte (1) // number of checkpoint times (including finish line) > times : uByte (1) // number of checkpoint times (including finish line) > uInt (times) // checkpoint times for platin > uInt (times) // checkpoint times for gold > uInt (times) // checkpoint times for silver > uInt (times) // checkpoint times for bronze > f32 (1) // sun rotation on Z axis > f32 (1) // sun angle to xy plane (between 0 and 90 degrees) > f64 (1) // preview camera position x > f64 (1) // preview camera position y > f64 (1) // preview camera position z > f64 (1) // preview camera look at position x > f64 (1) // preview camera look at position y > f64 (1) // preview camera look at position z > entityNumber : uInt (1) // number of entities on the map for entity in entityNumber { > entityType : uInt (1) // entityType switch(entityType) { case 0: // block > blockType : uByte (1) // blockType/color > sInt (1) // position x > sInt (1) // position y > uInt (1) // position z > uInt (1) // scale x > uInt (1) // scale y > uInt (1) // scale z > f32 (1) // rotation on Z axis if (blockType == 5){ // checkpoint block > uByte (1) // checkpoint Number } case 1: // sphere > sInt (1) // position x > sInt (1) // position y > uInt (1) // position z case 2: // player start > uByte (1) // unknown > sInt (1) // position x > sInt (1) // position y > uInt (1) // position z > f32 (1) // rotation on Z axis case 128: // dummy id > uByte (1) // ID > sInt (1) // position x > sInt (1) // position y > uInt (1) // position z > uInt (1) // scale x > uInt (1) // scale y > uInt (1) // scale z > f32 (1) // rotation on Z axis } }
cmt.cmap.v1.entities¶
- class cmt.cmap.v1.entities.Block¶
Bases:
cmt.cmap.a_entity.AEntity
- classmethod decode(data, offset, debug=False)¶
- class cmt.cmap.v1.entities.BlockType(value)¶
Bases:
enum.Enum
An enumeration.
- CHECKPOINT = 5¶
- FINISH = 1¶
- ICE = 4¶
- JUMP = 2¶
- NOTHING = 0¶
- SPEED = 3¶
- class cmt.cmap.v1.entities.Dummy¶
Bases:
cmt.cmap.a_entity.AEntity
- classmethod decode(data, offset, debug=False)¶
- class cmt.cmap.v1.entities.PlayerStart¶
Bases:
cmt.cmap.a_entity.AEntity
- classmethod decode(data, offset, debug=False)¶
- Parameters
- Return type
cmt.cmap.v1.checkpoint_time¶
cmt.converter¶
cmt.converter.v0¶
cmt.converter.v1¶
cmt.cs¶
cmt.cs.main¶
- cmt.cs.main.main(argv=None)¶
Entry point into the program. Gets the arguments from the console and proceed them with
ArgumentParser
. Returns if its success successful 0 else 1.
cmt.ecmap¶
cmt.ecmap.a_ecmap¶
cmt.ecmap.v0¶
cmt.ecmap.v0.ecmap¶
- class cmt.ecmap.v0.ecmap.ECMap¶
Bases:
cmt.ecmap.a_ecmap.AECMap
Celaria .ecmap format (version 0)
Datatypes
Abbreviation
Type
Byte size
uByte
unsigned byte
1
uShort
unsigned short
2
uInt
unsigned int
4
sShort
signed short
2
sInt
signed int
4
f32
float
4
f64
double
8
Description format
> <datatype> (<number of datatypes in sequence>) // <description>
or
> [<variable name>] : <datatype> (<number of datatypes in sequence>) // <description>
Difference regarding to the .cmap begins with a ‘!!’.
Comparing to CMap v0.
Format
> uByte (11) // string identifier > uByte (1) // version > nameLen : uByte (1) // number of characters in map name > uByte (nameLen) // map name as String !! // checkpoint times are missing > f32 (1) // sun rotation on Z axis > f32 (1) // sun angle to xy plane (between 0 and 90 degrees) ... same as cmap v0 ...
- classmethod decode(data, offset, debug=False)¶
- Return type
ECMAP
cmt.ecmap.v1¶
cmt.ecmap.v1.ecmap¶
- class cmt.ecmap.v1.ecmap.ECMap¶
Bases:
cmt.ecmap.a_ecmap.AECMap
Celaria .ecmap format (version 1)
Datatypes
Abbreviation
Type
Byte size
uByte
unsigned byte
1
uShort
unsigned short
2
uInt
unsigned int
4
sShort
signed short
2
sInt
signed int
4
f32
float
4
f64
double
8
Description format
> <datatype> (<number of datatypes in sequence>) // <description>
or
> [<variable name>] : <datatype> (<number of datatypes in sequence>) // <description>
Difference regarding to the .cmap begins with a ‘!!’.
Comparing to CMap v1.
Format
> uByte (11) // string identifier > uByte (1) // version > nameLen : uByte (1) // number of characters in map name > uByte (nameLen) // map name as String > uByte (1) // unused - gamemode !! // checkpoint times are missing > f32 (1) // sun rotation on Z axis > f32 (1) // sun angle to xy plane (between 0 and 90 degrees) ... same as cmap v1 ...
- classmethod decode(data, offset, debug=False)¶
- Return type
ECMAP
cmt.ecmap.v2¶
cmt.ecmap.v2.ecmap¶
- class cmt.ecmap.v2.ecmap.ECMap¶
Bases:
cmt.ecmap.a_ecmap.AECMap
Celaria .ecmap format (version 2)
Datatypes
Abbreviation
Type
Byte size
uByte
unsigned byte
1
uShort
unsigned short
2
uInt
unsigned int
4
sShort
signed short
2
sInt
signed int
4
f32
float
4
f64
double
8
Description format
> <datatype> (<number of datatypes in sequence>) // <description>
or
> [<variable name>] : <datatype> (<number of datatypes in sequence>) // <description>
Difference regarding to the .cmap begins with a ‘!!’.
Comparing to CMap v1.
Format
> uByte (11) // string identifier > uByte (1) // version > nameLen : uByte (1) // number of characters in map name > uByte (nameLen) // map name as String !! > uByte (1) // boolean, previewCam_set > uByte (1) // unused - gamemode !! // checkpoint times are missing > f32 (1) // sun rotation on Z axis > f32 (1) // sun angle to xy plane (between 0 and 90 degrees) ... same as cmap v1 ...
- classmethod decode(data, offset, debug=False)¶
- Return type
ECMAP