-------------------------------------------------------------------------------- -------------------------------------------------------------------------------- -- -- TODO -- -- - add OPTIONS object -- -- - remove unnecessary vertices -- -------------------------------------------------------------------------------- -------------------------------------------------------------------------------- -- -- BZWMAGIC.LUA -- -- The bzwmagic.lua script takes a BZFlag .bzw world file as its input, -- and outputs a modified .bzw file. Based on mesh object names, mesh -- object geometry, and material names, it can generated several types -- of native bzflag objects that standard modelling do not support. It -- also supports using materials to assign per-face physics properties -- like drivethrough, shootthrough, and physics drivers. -- -------------------------------------------------------------------------------- -------------------------------------------------------------------------------- -- -- RECOGNIZED GEOMETRY -- -- cuboid: hexagon with 3 sets of parallel faces -- quad_horiz: rectangle with a normal along the Z axis -- quad_vert: rectangle with a normal perpendicular to the Z axis -- line_horiz: 3 collinear points along the Z axis -- line_vert: 3 collinear points perpendicular to the Z axis -- arrow: two triangles with a common edge, -- FIXME -- description -- -------------------------------------------------------------------------------- -------------------------------------------------------------------------------- -- -- Missing map object types: -- -- options (not directly tied to geometry) -- dynamic color (not directly tied to geometry) -- texture matrix (not directly tied to geometry) -- waterLevel (not directly tied to geometry) -- transform (rarely used) -- arc, cone, sphere, tetra, meshbox, meshpyr (not worth the bother) -- -------------------------------------------------------------------------------- -------------------------------------------------------------------------------- MATERIAL FORMAT --------------- '('')'[...] '&' examples: red&DR - matref "red", make drivethrough (REF=red,DR) - equivalent to 'red&DR' newMat(DR,AT.2)_copy2 - the () format allows for trailing text MESH NAME FORMAT ---------------- DR - drivethrough SH - shootthrough PS - passable [name]'('s')'[...] [name]'<'TYPE[':']'>'['('')'][...] * the typeprops can also include phyprops examples: tele1 _copy2 (DR)_copy3 bouncy -------------------------------------------------------------------------------- -------------------------------------------------------------------------------- -- -- Solid objects -- BOX --- [name][(phyprops)][...] GEOMETRY: cuboid, quad_horiz, quad_vert, line_horiz, line_vert, arrow PYR --- [name][(phyprops)][...] GEOMETRY: pyramid, quad_horiz, tri_vert, line_horiz, line_vert, arrow BASE ---- [name][(phyprops)][...] T - team number ONCAP - oncap weapon GEOMETRY: cuboid, quad_horiz, quad_vert, line_horiz, line_vert, arrow WEAPON ------ [name][(phyprops)][...] F - weapon flag type I - initdelay D - delay ET - event team TR - event trigger type GEOMETRY: arrow (NOTE: the arrow base is the weapon's position, not the tip) TELE ---- name[(phyprops)][...] OFF - link faces' offset (along their normals) - the object name is mandatory Materials: * TeleBackMaterial: quad (required, unique) * TeleFrontMaterial: quad (required, unique) GEOMETRY: cuboid, quad_vert MESH CHECK POINTS ----------------- Inside and Outside points can be added to meshes by including faces that use the InsidePointMaterial and OutsidePointMaterial. Materials: * InsidePointMaterial: arrow (optional, multiple) * OutsidePointMaterial: arrow (optional, multiple) GEOMETRY: arrow -------------------------------------------------------------------------------- -------------------------------------------------------------------------------- -- -- Unsolid objects -- ZONE ---- [name] T - team number S - safety for flag F - flag ZF - zoneflag, optionally count GEOMETRY: cuboid, quad_horiz, quad_vert, line_horiz, line_vert, arrow PHYSICS ------- name DEATH - use underscores for spaces, 2 underscore for 1 underscore LINEAR - use underscores for spaces, 2 underscore for 1 underscore SPIN - a numeric value, or '+d' or '-d' (for its triangle's height) Materials: * PhysicsLinear: arrow (optional, unique) * PhysicsSpinCenter: arrow (optional, unique) * PhysicsSpinSpeed: arrow (optional, unique) GEOMETRY: arrow (PhysicsLinear) GEOMETRY: arrow (PhysicsSpinCenter) GEOMETRY: arrow (PhysicsSpinSpeed) LINK ---- name... If the SRC and DST are not specified, a triangle is used to connect the two teleporter faces. The link SRC face must share 2 vertices with the triangle, and the link DST face must share 1 vertex with the triangle. GEOMETRY: triangle (optional, unique) -------------------------------------------------------------------------------- -------------------------------------------------------------------------------- -- -- Grouping -- GROUP DEFINITION ---------------- defname Materials: * GroupX: quad (required, unique) * GroupY: quad (required, unique) * GroupZ: quad (required, unique) GEOMETRY: cuboid * all mesh objects completely contained within the group definition cuboid will become members of the definition (and will not be emitted into the output bzw file) GROUP INSTANCE -------------- name T - team TINT - the tinting color, underscores for spaces Materials: * GroupX: quad (required, unique) * GroupY: quad (required, unique) * GroupZ: quad (required, unique) GEOMETRY: cuboid * the emitted group instance will be shifted, scaled, and rotated to transform the definition's cuboid into the instance's cuboid. -------------------------------------------------------------------------------- -------------------------------------------------------------------------------- -- -- DrawInfo -- DRAWINFO TOP LEVEL ------------------ name Materials: * DrawInfoSphere: arrow (optional, unique) * DrawInfoExtents: cuboid (optional, unique) DRAWINFO LOD ------------ lodname1 Materials: * DrawInfoSphere: arrow (optional, unique) New Material Property: drawpoints drawlines -------------------------------------------------------------------------------- -------------------------------------------------------------------------------- -- -- Materials -- FORMAT ------ red&DR - matref to "red", with drivethrough (REF=red,DR) - matref to "red", with drivethrough newmat(DR)_copy1 - a material with drivethrough ABBREVIATIONS ------------- REF=? - matref (? is a string) DR - drivethrough SH - shootthrough PS - passable SB - smoothbounce PD=? - phydrv (? is a string) NR - noradar NS - noshadow NST - nosorting NC - noculling NCL - noclusters NL - nolighting NT - notextures NTA - notexalpha NTC - notexcolor AG - grouped alpha OC - occluder SM - spheremap AT# - alphathresh (# is a floating point number) TM=? - texmat (? is a string) DC=? - dyncol (? is a string) DL - drawlines DP - drawpoints -------------------------------------------------------------------------------- --------------------------------------------------------------------------------