Glass types¶
The breakable-glass types: CfgSetGlassProperties(type, windowLink, alarm, sprite, brokenSprite)
configures each in config_preload2.lua, and a level script places panes with
SpawnBreakableGlass(type, corner, cornerU, cornerV, uv0, uv1, 0, triangle1, triangle2)
(World objects: glass).
What is complete
All 19 types are listed with every argument. Any hit breaks a pane (no hitpoints); what breaking
does is on World objects: a pane's life. The sprite words' low halves
are rectangles of part_page1, the sheet of sprite batch 0 that every pane but type 14 draws from; their
high halves are ignored (World objects: drawing a pane).
19 entries. Data: research/references/glass-types.yaml.
Entries¶
| Type | Window link | Alarm | Sprite | Broken sprite | Behaviour | Panes | Scripts |
|---|---|---|---|---|---|---|---|
| 0 | no | no | 0x00010014 |
0x00010015 |
97 | level9, level86, level92, level95, level112 |
|
| 1 | no | no | 0x00010014 |
0x00010015 |
Breaking it calls an empty hook with its two triangles (0x003a4ad8). |
422 | d26c7832, level2, level9, level11, level14, level20 |
| 2 | no | no | 0x00010014 |
0x00010015 |
50 | level3 |
|
| 3 | no | no | 0x00010014 |
0x00010015 |
14 | level55, level87 |
|
| 4 | no | yes | 0x00010014 |
0x00010015 |
|||
| 5 | no | yes | 0x00010014 |
0x00010015 |
|||
| 6 | no | yes | 0x00010014 |
0x00010015 |
|||
| 7 | no | yes | 0x00010014 |
0x00010015 |
|||
| 8 | yes | no | 0x00010014 |
0x00010015 |
157 | d26c7832, level5, level11, level20, level34, level52 |
|
| 9 | yes | no | 0x00010014 |
0x00010015 |
2 | level2 |
|
| 10 | yes | no | 0x00010016 |
0x00010017 |
|||
| 11 | yes | no | 0x00010016 |
0x00010017 |
25 | level51, level82, level87, level93, level99, level128 |
|
| 12 | no | no | 0x00010014 |
0x00010015 |
A car window: breaking it frees every dyn_carstereo within 2 m (0x00396090). |
1 | level9 |
| 13 | yes | yes | 0x00010014 |
0x00010015 |
142 | d26c7832, level2, level11, level14, level20, level31 |
|
| 14 | yes | no | 0x00020000 |
0x00010015 |
Stained glass: draws with a one-sprite batch of its own over sheet-table record 2, rectangle 0, instead of the type's sprite words, and shatters as sub_stained_glass. |
||
| 15 | no | no | 0x00010014 |
0x00010015 |
Invisible: colour 0, so drawn fully transparent; still blocks until broken. | ||
| 16 | no | no | 0x00010016 |
0x00010017 |
19 | level3, level60, level61, level64 |
|
| 17 | no | no | 0x00010015 |
0x00010015 |
Placed already broken: its triangles are off, but it draws its sprite (the broken rectangle) and has a body within 50 m like a whole pane. | ||
| 18 | yes | no | 0x00010015 |
0x00010015 |
Placed already broken: its triangles are off and its path polygon's flag 0x08 is set, but it draws its sprite (the broken rectangle) and has a body within 50 m like a whole pane. |
Sources and evidence¶
Evidence levels used: confirmed-code.
- config_preload2.lua, CfgSetGlassProperties; SpawnBreakableGlass in the scripts
Fields¶
| Field | Type | Hand-written | Meaning |
|---|---|---|---|
id |
int | Glass type: SpawnBreakableGlass's first argument and CfgSetGlassProperties'. |
|
window_link |
bool | Second argument (+0x14): the pane sits on a navigation jump link, closed while it is whole and opened when it breaks (inferred). |
|
alarm |
bool | Third argument (+0x18): breaking the pane reports a break-in. |
|
sprite |
hex | Fourth argument (+0x1c): the whole pane's sprite word; its low 16 bits are the rectangle drawn. |
|
broken_sprite |
hex | Fifth argument (+0x20): the sprite word left after the pane breaks (0 draws nothing). |
|
behaviour |
str | yes | What the code does differently for this type. |
panes |
int | SpawnBreakableGlass calls that pass the type. |
|
scripts |
list | The scripts that place panes of it (at most six). | |
source |
str | yes | Where the entry comes from: a script and binding, an address, a chunk. |
evidence |
str | yes | How we know: confirmed-code, confirmed-runtime, inferred or speculative (evidence levels). |
notes |
str | yes | Our own short notes. |