$$M

From GameStudio Wiki

Jump to: navigation, search

Contents

$$M Fileformat

The $$M fileformat is an intermediate format between WMP and WMB. It is used by WED to communicate with the map compiler. All WED groups are resolved into individual entities.

General format

C++ style comments are supported, i.e. any characters between // and the end of line are ignored. The first token must be a version header after that blocks can appear in arbitrary order.

Header:

version 711

Blocks

A block looks like this:

{
   BLOCKTYPE
   [BLOCKSPECIFIC DATA...]
}
Block types
0 = World geometry
1 = Position
2 = Light
3 = Static entity
4 = Sound
5 = Sun (and general level information)
6 = Path
7 = Dynamic entity

World block

The world block (type 0) specifies the intermediate WAD file ($$W) and the palette file to be used. After that geometry blocks are defined.

{
   0
   FILENAME.$$W
   PALETTE.PCX
   { 
      // first geometry block
   }
   { 
      // second geometry block
   }
   [..more geometry blocks..]
}

Geometry blocks

{
  vertices NUMVERTICES
  faces NUMFACES
  VERTEX0_X VERTEX0_Y VERTEX0_Z    VERTEX1_X VERTEX1_Y VERTEX1_Z 
  [..more vertices..]
  FACE0_VERTEXCOUNT VERTEX0 VERTEX1 [..] : TEXTURENAME TEXVEC0 TEXVEC1 : FLAGS AMBIENT ALBEDO ndef
  [..more faces..]
}

Sample file

// Wed (6.731.01)
version 711
{
	0
	hollow.$$w
	palette.pcx
	{   // 0
		vertices 8
		faces 6
		108 -36 32   108 28 32   76 -4 0
		44 28 32   108 -36 -32   108 28 -32
		44 -36 -32   44 28 -32
		4  1 0 2 3 : #default ( 1 0 0 0 ) ( 0 -1 0 0 ) : 0000 0 50 ndef
		4  0 1 5 4 : #default ( 0 1 0 0 ) ( 0 0 -1 0 ) : 0000 0 50 ndef
		4  2 0 4 6 : #default ( 1 0 0 0 ) ( 0 0 -1 0 ) : 0000 0 50 ndef
		4  3 2 6 7 : #default ( 0 1 0 0 ) ( 0 0 -1 0 ) : 0000 0 50 ndef
		4  1 3 7 5 : #default ( 1 0 0 0 ) ( 0 0 -1 0 ) : 0000 0 50 ndef
		4  4 5 7 6 : #default ( 1 0 0 0 ) ( 0 -1 0 0 ) : 0000 0 50 ndef
		{
			0000
			ndef
			0
		}
	}
	{   // 1
		vertices 8
		faces 6
		-44.000004 108 32   -108 107.999992 32   -76 76 0
		-107.999992 43.999992 32   -44.000004 108.000008 -32   -108.000008 108 -31.999996
		-43.999992 44.000008 -32.000004   -108 43.999996 -32
		4  1 0 2 3 : #default ( 1 0 0 0 ) ( 0 -1 0 0 ) : 0000 0 50 ndef
		4  0 1 5 4 : #default ( 1 0 0 0 ) ( 0 0 -1 0 ) : 0000 0 50 ndef
		4  2 0 4 6 : #default ( 0 1 0 0 ) ( 0 0 -1 0 ) : 0000 0 50 ndef
		4  3 2 6 7 : #default ( 1 0 0 0 ) ( 0 0 -1 0 ) : 0000 0 50 ndef
		4  1 3 7 5 : #default ( 0 1 0 0 ) ( 0 0 -1 0 ) : 0000 0 50 ndef
		4  4 5 7 6 : #default ( 1 0 0 0 ) ( 0 -1 0 0 ) : 0000 0 50 ndef
		{
			0000
			ndef
			1
		}
	}
	{   // 2
		vertices 8
		faces 6
		28 -100 48   28 -36 48   -4 -68 16
		-36 -36 48   28 -100 -16   28 -36 -16
		-36 -100 -16   -36 -36 -16
		4  1 0 2 3 : #default ( 1 0 0 0 ) ( 0 -1 0 0 ) : 0000 0 50 ndef
		4  0 1 5 4 : #default ( 0 1 0 0 ) ( 0 0 -1 0 ) : 0000 0 50 ndef
		4  2 0 4 6 : #default ( 1 0 0 0 ) ( 0 0 -1 0 ) : 0000 0 50 ndef
		4  3 2 6 7 : #default ( 0 1 0 0 ) ( 0 0 -1 0 ) : 0000 0 50 ndef
		4  1 3 7 5 : #default ( 1 0 0 0 ) ( 0 0 -1 0 ) : 0000 0 50 ndef
		4  4 5 7 6 : #default ( 1 0 0 0 ) ( 0 -1 0 0 ) : 0000 0 50 ndef
		{
			0000
			ndef
			2
		}
	}
}
{
	5
	0
	60
}
{
	2
	-64 64 32
	0 0 0
	100.000000 39.215687 39.215687 135
}
{
	2
	64 -48 32
	0 0 0
	-0.000000 100.000000 100.000000 135
}
Personal tools