All pastes #507839 Raw Edit

Someone

public text v1 · immutable
·published 2007-05-24 19:29 UTC
rendered paste body
Getting To Know BZW code.

BZW is the name (and extension) given to the raw format of a BZFlag world or 'map'. If you want to get into map making, it is advisable that you are familiar with the way it works.

What you will need:
	A plain text editing program, such as Notepad on windows, and TextEdit on MacOSX.
	A basic knowledge of coordinates in three dimensions.

Don't be daunted by the word 'code', BZW actually has a very simple structure. This is what BZW code looks like:

	world
	  name Simple World
	  size 100.0
	end

	## Comment

	box
	  position -20 -20 0
	  size 10 20 10
	end

	pyramid
	  position 20 20 0
	  size 10 10 20
	end



Let's break this down. As you can probably tell, the world is broken down into blocks, or objects. The first word tells BZFS what the object is. The lines beneath that define the properties of object, for example 'position' tells BZFS where that object is in the world. Any line that is prefixed by a hash (#) will be ignored by BZFS - this is called a comment, and you can use these to write notes to yourself, or to remind you what does what. Every object ends with the word 'end'. This may seem obvious, but it is still important - this tells BZFS when to stop looking for object parameters.

The world object heads most maps. Personally, I normally put it in even if it's values are defaults. It's basic parameters are:

	world
	  name Example	# A name for your map
	  size 600	# The length, in world units of one half of a side of the map. The default is 400.
	end


The basic values for most primitives (a posh word for boxes, pyramids, cones etc) are 'position' and 'size'. The position is coordinates in three axes - x, y, and z in that order. X = left/right; Y = forward/back; Z = up/down. You should remember that the coordinates correspond to the center bottom of the object.

The size parameter works using a similar system - the size, in x length, y length and z length. You should note that the size in the BZW file is half of the length of the full side - it is measured from the central axes of the shape.