Pyramid Object
Work In Progress
We are working on updating and improving this documentation. Some information may be missing or inaccurate.
One of the oldest supported objects, pyramids are used in the vast majority of worlds to create obstacles, shot deflectors, and structures. BZFlag 2.0 added materials, physics drivers, per-face settings, and the ability to control the texture size and texture offset. When any of those new 2.0 attributes are used, the pyramid becomes what is known as a "new" pyramid or a "meshified" pyramid (not to be confused with the meshpyr).
When driving through a pyramid with Oscillation Overthruster or a zoned Phantom Zone flag, the visual effects look different in the old pyramid compared to either the new pyramid or the meshpyr. The old pyramid makes the side of the pyramid transparent, dims the screen a bit, and shows colored triangles inside the pyramid. Both the new pyramid and the meshpyr instead make the walls semi-transparent and show a solid bottom. (TODO: CHECK IF THIS IS RIGHT)
| Type | Inside with OO or Zoned PZ |
|---|---|
| Old pyramid | Old style with triangle particles |
| New pyramid | Transparent sides with solid floor |
| Meshpyr | Transparent sides with solid floor |
Attributes
The pyramid object supports the following attributes:
| Syntax | Description |
|---|---|
| name <name> |
Sets the name of this object. In many cases, this does not have any purpose and may just be useful for documenting what the object is for. In some case, like for teleporters, this can be used to reference the object from other objects. |
| position <x> <y> <z> |
This controls the absolute position of the object, lined up with the bottom center of the object. The center of the world, at ground level, is 0 0 0. |
| size <x> <y> <z> |
This controls the size of the object. It accepts three floating point numbers for the X, Y, and Z size of the object. Z is up. |
|
rot <angle> rotation <angle> |
Objects can be rotated on the Z axis, with the angle being specified in degrees. Extremely old worlds may use radians and will need to be converted, since BZFlag 1.7e0 used radians, and this was changed to use degrees in BZFlag 1.7e4. |
| shift <x> <y> <z> |
This shifts the relative position of an object. |
| scale <x> <y> <z> |
This scales an object up or down in the x, y, and/or z direction, with 1 being 100%. |
| shear <x> <y> <z> | |
| spin <angle> <x> <y> <z> | |
| xform <transform_name> |
The xform attribute applies the transformations of a transform to an object. You provide the name of the transform object. |
| drivethrough |
This allows tanks to drive through the object. |
| shootthrough |
This allows bullets and beam weapons to pass through the object. |
| passable |
This combines the effects of both the drivethrough and shootthrough attributes. |
| ricochet |
On a server with ricochet disabled, this attribute selectively enables ricochet on this object. |
| matref <material_name> |
The matref attribute applies a material to the object. You provide the name of the material object. |
| resetmat | |
| dyncol <dynamic_color_name> | |
|
ambient <red> <green> <blue> [alpha] ambient <color_name> [alpha] |
|
|
diffuse <red> <green> <blue> [alpha] diffuse <color_name> [alpha] color <red> <green> <blue> [alpha] color <color_name> [alpha] |
|
|
specular <red> <green> <blue> [alpha] specular <color_name> [alpha] |
|
|
emission <red> <green> <blue> [alpha] emission <color_name> [alpha] |
|
| shininess <float> | |
| alphathresh <value> | |
| noculling | |
| nosorting | |
| noradar | |
| noshadow | |
| nolighting | |
| occluder | |
| groupalpha | |
| texture <texture_name> | |
| notextures | |
| addtexture <texture_name> | |
| texmat <matrix_name> | |
| notexalpha | |
| notexcolor | |
| spheremap | |
|
x+ <attribute> <value...> x- <attribute> <value...> y+ <attribute> <value...> y- <attribute> <value...> z- <attribute> <value...> bottom <attribute> <value...> edge <attribute> <value...> sides <attribute> <value...> |
These allow for setting some attributes on only certain faces of the pyramid. The "edge" and "sides" are shortcuts that refer to the x+, x-, y+, and y- faces. The supported attributes are shootthrough, ricochet (as of 2.4.32), texsize, texoffset, phydrv, matref, resetmat, dyncol, ambient, diffuse, color, specular, emission, shininess, alphathresh, noculling, nosorting, noradar, noshadow, nolighting, occluder, groupAplha, texture, notextures, addtexture, texmat, notexalpha, notexcolor, spheremap, shader, addshader, and noshaders. The drivethrough and passable attributes, while technically allowed to be set per-face, exhibit unusual behavior and should be only be set on the entire pyramid, not on individual faces. |
| texsize <float> <float> | |
| texoffset <float> <float> | |
| phydrv <driver_name> |
Applies a physics driver named as provided, which alter the physics of a tank when they touch the object. Examples of physics drivers are bounce pads, conveyor belts, and death. You provide the name of the physics driver object. |
Syntax Examples
This creates an old style pyramid with the center of the bottom positioned at x = 10, y = 10, z = 10. Keep in mind that the Z axis is up, so this pyramid will be positioned on the ground. Another important note is that the X and Y sizes are doubled, so this pyramid will be 20 units wide in the X direction, 40 units wide in the Y direction, but only 10 units high.
pyramid
position 10 10 0
size 10 20 10
end
This content is maintained on GitHub. We welcome any feedback and improvements!