The flag tag describes the behaviour and appearance of a cloth-like material. As a type of widget, flags can be attached to objects like weapons using model markers. They are not limited to weapons and can even be attached to bipeds, however the game only supports rendering 2 flags.
They are essentially a grid of attached point_
Physics
The spaces between flag vertices are called cells and have configurable cell width and cell height. The cells try to maintain their size and are capable of stretching. Like antenna, flags can make use of a variety of point physics features:
- If no gravity is set then the flag will float around rather than hang.
- If collides with structures is set, the points may inconsistently collide with the BSP. Depending on the other settings, the flag may come to a rest on the BSP for a time before hanging through it. Collisions with model_
collision_ geometry seem to require much lower point velocities and are barely noticeable. - Density affects how "floaty" the points are. Low near-zero values will cause the flag to hang in the air, while higher values result in it falling more quickly.
- Air friction is especially important for flags given their interaction with wind and movement when carried.
- Elasticity determines the bounciness of collisions with structures, not how stretchy the flag is.
Simulation culling
Flags are not simulated when off-screen (based on the bounding sphere of their object). When they reappear you may notice a slight jiggle as they reach their rest state again.
Attachment points
Along the attachment edge of the flag you can define a series of 2-4 attachment points at a model marker. The flag's height will span these attachment points and be fixed in place at each of them, with a configurable number of cells between the attachment points. The markers used don't need to be unique; it would be possible for the leading edge to form a loop by reusing a marker for the first and final attachment points. The game requires that the sum of all attachment points' height to next attachment is 1 less than height. The final attachment point should use height 0
.
Shapes
This tag supports various shapes for the attached and trailing edges of the flag. Different trailing edge shape options result in the trailing edge of the flag being visually cut off (though the vertices still exist). The trailing edge shape offset allows you to slide this mask along the width of the flag by a positive or negative number of vertices.
The attached edge shape only supports flat or concave triangular, and occurs between each pair of attachment points.
Limits
The game state has only 2 entries for flags in all versions of H1, so any other flags on the map will not render.
Related HaloScript
Function/global | Type | |
---|---|---|
Renders green or red markers wherever point_ Red markers indicate point_ | Global |
Structure and fields
Field | Type | Comments | ||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
flags | bitfield | |||||||||||||||||||
| ||||||||||||||||||||
trailing edge shape | enum | The shape of the trailing edge. | ||||||||||||||||||
| ||||||||||||||||||||
trailing edge shape offset | int16 | Determines the number of vertices the trailing edge shape is offset. A value | ||||||||||||||||||
attached edge shape | enum | The shape of the attached edge. This will appear between each pair of attachment points. | ||||||||||||||||||
| ||||||||||||||||||||
width | int16 | Flag size from attached to trailing edge. This counts the number of vertices (cells+1), not the number of cells. | ||||||||||||||||||
height | int16 | Flag size along the direction of attachment. This counts the number of vertices (cells+1), not the number of cells. This value should be 1 higher than the sum of all attachment points' height to next attachment or else the flag will not appear. This must also be an odd number or else the flag will not appear or be streteched to the world origin (0, 0, 0). | ||||||||||||||||||
cell width | float | Width of the cell between each pair of vertices. | ||||||||||||||||||
cell height | float | Height of the cell between each pair of vertices. | ||||||||||||||||||
red flag shader | TagDependency : shader | The appearance of the flag when used for red team (netgame flag team index | ||||||||||||||||||
physics | TagDependency : point_physics | The physics to use for each vertex of the flag. | ||||||||||||||||||
wind noise | float | |||||||||||||||||||
blue flag shader | TagDependency : shader | The appearance of the flag when used for blue team (netgame flag team index | ||||||||||||||||||
attachment points | Block | A series of attachment points for the flag's attached edge. There must be at least 2 attachment points or the flag will be ignored. | ||||||||||||||||||
|
Acknowledgements
Thanks to the following individuals for their research or contributions to this topic:
- Conscars (Tag field testing)
- Kavawuvi (Invader tag definitions)
- MosesOfEgypt (Tag structure research)