Rules: Bindings
scripts/gen-rules.mjs builds this page from rules/*.json. Do not edit it by hand; edit the JSON and run npm run gen-rules. The rule bullets on topic pages (- **[ID]**) are filled from the same source.
Explanations and examples are on the topic page Bindings.
| ID | Rule | Level | Evidence environment | Source |
|---|---|---|---|---|
| BND-01 | Use the binding keys in the table above. resolve_ancestor_scope never appears in vanilla, so do not use it (resolve_sibling_scope has 53 uses). The engine reads this key (ancestor scope, BND-25 and BND-36). On Windows 1.26.65.1, resolve_ancestor_scope was accepted without an Unknown property log and read the ancestor, but a plain source_control_name read without any flag also found a sibling, a cousin, an ancestor and a distant control at the top of the window (measurement record). | vanilla, code (binary), measured | Windows 1.26.65.1 | VN, MJ 4.2-1, NB-09 |
| BND-02 | An item that omits binding_type reads a global property (for example { "binding_name": "#title_text" }). | vanilla, code (source), inferred | - | VN server_form.json:138, BC 4.1, BA chapter 2, BW-intro, BW-dyn |
| BND-03 | Counts of binding_type that vanilla uses: collection 787, collection_details 287, global 265, view 240, none 1. Templates often receive this value as a variable ($store_factory_binding_type, etc.). | vanilla | - | VN, value dictionary |
| BND-04 | A bound property belongs to the control that has the binding. If you put a collection binding on a button and use #form_button_text in a label two levels down, it comes out blank. The value is bound directly by the control that draws it, or copied with a view binding (BND-08). | measured | unknown | BC-S7 |
| BND-05 | If a view binding expression has no #property at all, the error Must define a source property name in the binding! occurs, and the whole bindings array of that control is discarded. To use a constant, put in any property like ((#v = #v) * 40). The Cinnabar reconstruction discards only that one binding (conflict C-43). | measured | unknown | BC-S12, conflict C-43 |
| BND-06 | For a value that only needs to be decided once (for example whether a toast icon shows), "binding_condition": "once" reduces cost. It is re-evaluated when a factory recreates the control. | working pack | - | BA chapter 6, AP 4.5 |
| BND-07 | A binding inside a cell created by a factory can run too early and stay empty (it shows only after losing and regaining focus). Give it binding_condition: "always", or read it outside the factory and copy it in with source_control_name. If the visible inside a cell is also always, it applies immediately. A cell can read outside controls but the outside cannot read the cell (BND-19). A title check in a label inside the server form long_form, with both the #title_text binding and the view binding set to once, was right from the first open (measurement record). | measured | Windows 1.26.65.1 | BC-S11, BW-dyn, 2026-11-19 Windows 1.26.65.1 |
| BND-08 | Read another control's property with source_control_name. When reading a sibling, also give resolve_sibling_scope: true. | vanilla, working pack | - | VN 236 and 53 uses, example server_form.json:156, BA chapter 6, BW-intro, BW-form |
| BND-09 | The default of #visible is true. If an expression fails (an unsupported operator, etc.), the property stays at its default, so it becomes "always visible". If a hide condition does not take effect, suspect the expression first. In the Windows 1.26.65.1 code it is not "stays at its default" but "writes the default true": when the expression result is null, the #visible handling reads it as the default true and writes visible as true (the section on global binding names the engine answers). So a control with a static "visible": false becomes visible when a failing expression binding or a binding with no answer is attached. On Windows 1.26.65.1 a label with a static "visible": false was hidden with no binding, and the same label was shown when the nonexistent global binding #re9_nonexistent_binding was bound to #visible. A failing expression was not measured. | measured, code (binary) | Windows 1.26.65.1 | BC-facts, BC 6.2-1, 2026-11-24 decompilation, 2026-11-25 Windows 1.26.65.1 |
| BND-10 | Do heavy calculations such as string parsing once in one place, the parent (or a data source), and have children take only the result with source_control_name. | working pack | - | BA chapter 6 |
| BND-11 | If several places must read the same value, put a size-0 "data source" control at the screen root and have each gate read that value with a view binding. It is also a way to read only the data without putting a native input (a radio, etc.) inside a collection item. | code (source), measured | unknown | BC 4.1-(5), BC-rules |
| BND-12 | In definitions the pack owns directly (definitions of a new namespace, redeclared definitions), a $variable can be used in source_property_name. Example: "source_property_name": "$visible_binding". | working pack, measured | unknown | AP 4.2, BC-facts |
| BND-13 | Inside a subtree inserted into a vanilla tree with modifications, a $variable cannot be used in a binding's source_property_name (all 6 variants gave Must define a source property name). Ordinary property substitution such as $caption in text works in the same place. So for inserted trees, make a separate definition with the binding names hardcoded as literals. | measured | unknown | BC-facts |
| BND-14 | There is a record that passing a value such as a factory row index to a derived definition as a $variable and using it in the base's binding broke the binding and discarded the whole array. Whether vanilla's factory_variables (COL-15 in the collections and factories chapter) solves this problem was not measured. | measured, inferred | unknown | BC-S9, VN |
| BND-15 | propagate_alpha can also be changed with the binding #propagateAlpha. The vanilla HUD root receives the global #hud_propagate_alpha as #propagateAlpha. With parent alpha: 0 + conditional propagation you can make "only a particular message transparent". alpha itself is not propagated to children by default (LAY-33). | vanilla, working pack | - | VN hud_screen.json:3567, AP 4.5, BW-doc |
| BND-16 | binding_name_override moves an engine name into your own property. Examples: #hud_title_text_string to #text, #form_button_contents to #collection_length. | vanilla | - | VN hud_screen.json, server_form.json:138, BW-intro |
| BND-17 | Vanilla builds the binding name itself as a variable expression: "$toggle_state_binding_name": "('#' + $dropdown_name)". It is a way to read various data with one template. | vanilla | - | VN ui_common.json:1126, storage_management.json:1325 |
| BND-18 | Value preservation (latch). Put "#saved": "" in the property_bag of a size-0 panel, and copy the source only at the moment visibility changes with { "binding_name": "#src", "binding_name_override": "#saved", "binding_condition": "visibility_changed" }. If you set the #visible of this panel to "when the new value contains the keyword (EXP-07) and differs from the saved value", it shows for one frame at the moment the condition matches and hides again because the condition turns false right after saving. An outside label reads #saved with source_control_name. property_bag is separate per instance, so several of the same component do not mix. It is used to keep "the last title containing my keyword" in the HUD title channel (HOST-14) even when other titles arrive. In a chest slot it worked in game: with collection_index on the latch panel, #hover_text copied to #saved by a collection binding, and #visible set to "the new value is not empty and differs from the saved value", the latch followed name changes and kept the last name when the slot became empty. It also worked on the HUD title channel: with #hud_title_text_string copied and #visible set to "contains JUC and differs from #saved", the titles JUC one, other, JUC two, plain again in that order gave the saved values JUC one, JUC one, JUC two, JUC two (measurement record). Use this latch also to show data slots of a chest (label text, a live_horse_renderer id and so on). #hover_text is emptied for a moment on every slot press (HOST-50); the latch does not store the empty value, so titles and models stopped flickering (measured 2026-11-28 on Windows 1.26.65). A visibility_changed latch, however, kept the old name when its ancestor page was hidden at the moment the slot name changed, even after the page was shown again. A latch that did not freeze under a hidden ancestor sets #visible to (not ((#hover_text = '') and (#item_id_aux > 0))) and then copies #hover_text to #saved with a collection binding using binding_condition: visible. It hides only while the name is empty and an item is there, and reads again every time it is shown. A latch placed under a control that hides by the name (an icon whose #visible comes from the name) is never shown and never reads the name, so put the latch beside the reading control. resolve_sibling_scope starts searching at the reading control's parent, so copies of one definition under one parent all found the first copy's latch. Passing the latch name in a variable named per definition ($sg_latch_<definition>) made each copy find the latch beside it; a shared variable name let an outer copy's value override the latch names of inner definitions (SG, 2026-12-02 Windows 1.26.65.1). This latch does not remove the brief window disappearance on a drop press (INP-46). | measured | Windows 1.26.65, Windows 1.26.65.1 | BW-title, VN visibility_changed 7 uses, CPR, SG, 2026-11-18 Windows 1.26.65.1, 2026-11-28 Windows 1.26.65, 2026-12-02 Windows 1.26.65.1 |
| BND-19 | A control created by a factory or grid can read properties of an outside control with source_control_name, but outside controls cannot read the properties of created controls. Put values to share in a data source outside the factory (BND-11). | unverified | - | BW-dyn "Useful Information" |
| BND-20 | resolve_sibling_scope: true limits the source_control_name search to the sibling scope, but if the parent and a sibling have the same name, the parent takes priority. Name the control to read so that it does not collide with ancestors. Cause: the sibling search starts breadth-first from the parent itself (BND-25). | code (source) | - | BW-doc Data Binding table, CN |
| BND-21 | Inside a button state control, state variables can decide creation itself: "ignored": "$default_state" on a child that should show only on hover. Vanilla also uses "ignored": "$hover_state" (2), "visible": "$default_state" (3) and "visible": "($hover_state or $pressed_state)" (5). It means the variable expression of INP-09 works for ignored too. | vanilla, unverified | - | BW-btn, VN |
| BND-22 | An unknown binding_type acts as global, and an unknown binding_condition is logged and acts as none. The Cinnabar reconstruction logs an unknown binding_type, but in the Android 1.26.52.3 and Windows 1.26.65.1 decompilation it becomes global without a log, and only a non-string value leaves JSON UI parse failure - expected a string. (code, not measured in game). A typo becomes "silently different behavior", so copy values from the table. | code (source), code (binary) | Android 1.26.52.3, Windows 1.26.65.1 | NB-09 (binding_condition), CN tests B07 and B13 (binding_type), 2026-11-20 decompilation |
| BND-23 | Meaning of binding_condition: none on every data update, once the first time, always every update, always_when_visible and visible only when visible, visibility_changed only when visibility changes. The six values match the engine's name table (BND-35). | code (source), code (binary) | unknown | NB-09 (value list), CN (meaning) |
| BND-24 | A view binding without source_control_name reads its own bag, and a property not there is read from the screen controller (global). A named view does not fall through to global. In game, a label in the server form long_form_scrolling_content that read #form_text through source_control_name from a sibling panel without bindings showed the form body. With a control name that does not exist it was empty, and the same setup in a custom window under main_screen_content was empty (measurement record). | vanilla, code (source), code (binary), measured, conflict | Windows 1.26.65.1 | VN 27 uses, NB-09 (own control), CN tests B26 and B27 (global fallback), CN Zeqa regression, 2026-11-19 Windows 1.26.65.1 |
| BND-25 | source_control_name lookup: by default breadth-first first match from the screen root, resolve_sibling_scope breadth-first from the parent (including the parent itself, the cause of BND-20), and resolve_ancestor_scope the nearest ancestor of the same name. Hidden subtrees are searched too. If names collide, the one closer to the root wins. | code (source), code (binary) | unknown | NB-09 (the three scopes), CN tests B20 and B25 (search order) |
| BND-26 | An expression binding {"binding_name": "(expression)", "binding_name_override": "#t"} gives the controller's original answer to #t in the bag and the expression result to the component. If another view reads #t, it sees the original answer, not the expression result. To share the result, compute it with a view binding and put it in a new property. The Windows 1.26.65.1 code confirms only the first half: in the binding update loop, for a global entry the controller writes the original value to the target name key and the apply function reads that key. Inside this loop there is no call that computes the expression of a global entry (expression evaluation exists only for view entries), and where the expression result is used was not found in the code. | code (source), code (binary) | Windows 1.26.65.1 | CN test B08, 2026-11-24 decompilation |
| BND-27 | Boolean targets (#visible, #enabled, #toggle_state, etc.) accept only JSON booleans. Binding the global string 'false' as is to #visible does not hide it. Going through an expression ((#flag = 'false')) makes it a boolean. The boolean read in the Windows 1.26.65.1 code uses the value only when its type is boolean, and for null, integer, float or string it uses the property's default. It does no truthiness conversion (asBool). So integer 0 and float 0.0 also cannot hide #visible or turn off #enabled. In the Windows 1.26.65.1 HUD, a label with "#z": 0 in property_bag and the view (#z * 1) on #visible was shown, and a label with (#z = 1) was hidden. Float 0.0 and #enabled were not measured. Make an integer value boolean with a comparison such as (#n > 0). | measured, code (source), code (binary) | Windows 1.26.65.1 | CN, 2026-11-24 decompilation, 2026-11-25 Windows 1.26.65.1 |
| BND-28 | Constant expressions in a property_bag literal are computed ("#n": "(1 + 2)" becomes 3). A parent's property_bag_for_children is merged into descendants' bags but does not overwrite values the descendants have. The Windows 1.26.65.1 code is the same: for each member value of property_bag and property_bag_for_children it calls the property value resolver, which computes a constant expression starting with (, looks up and inserts a $name value, and unwraps a __string object such as $container_title into its value string (HOST-19). | code (source), code (binary) | Windows 1.26.65.1 | CN tests B32 and B33, 2026-11-24 decompilation |
| BND-29 | Text that starts with ##, like "text": "##text", is a literal, not a binding. An unbound "text": "#name" is drawn as empty text. | code (source) | - | CN test L08 |
| BND-31 | Keep the #visible of a layout chosen by title at binding_condition: "always". With once, a layout that briefly matched while the form switched to the next form stayed on over the next form. | measured | Windows 1.26.52 | DF |
| BND-32 | If you put binding_condition: "visible" on the length binding (from #form_button_contents to #collection_length) of a factory inside a layout that started with visible: false, a layout hidden because its title did not match did not create button cells (the "creation is not stopped" of COL-10 is about the layout control itself). When used on a layout that is visible from the start, even the hidden layout created cells on the first frame. Using always_when_visible or omitting in the same place left the bindings of cells created on the first frame unupdated, so text and markers were empty. | measured | Windows 1.26.52 | DF |
| BND-33 | A $variable put in as part of a source_property_name expression is substituted. The value goes in as one string and is not parsed again as an expression. Unquoted values (('#' + $v) with "$v": "hover_text", ($skip * #hud_subtitle_text_string) with "$skip": "%.20s") worked on the chest screen and in the HUD (HXC). With quotes inside the value, (#form_button_text - $m) with "$m": "'§0§3§r'" left the marker buttons hidden (DF), most likely because the quotes went in as characters and did not match (inference). So put only unquoted values in variables, and do not write an expression with no # property. For using one expression in every cell, see Binding expression caching. "$bt": "#v" put into an expression as ($bt) was read as the property #v and gave its value, and a variable whose value is an expression ("$us": "('%' + $tid + '%')") gave empty when used in an expression (measurement record). That empty value may be the rule that drops an expression without a # property at load (BND-42); the log of that test was not checked. | measured | Windows 1.26.65.1, Windows 1.26.52, mobile 1.26.63 | HXC, DF, BW-title, 2026-11-19 Windows 1.26.65.1 |
| BND-34 | Comparing a subtraction result directly in the same expression like (not ((A - B) = 'z')) flipped true and false. Putting it first in a #variable with a view binding and comparing with (not (#variable = 'z')) was correct. Split the steps as in EXP-06. | measured | Windows 1.26.52 | DF |
| BND-35 | binding_condition must be a string (otherwise the error - expected a string.), and its values are six: none, once, always, always_when_visible, visible and visibility_changed. If omitted or an unknown value, it acts as none (the same as BND-22 and BND-23). | code (binary) | unknown | NB-09 |
| BND-36 | A view binding reads its own control when source_control_name is empty (BND-24), and otherwise looks up in one of the default, sibling (resolve_sibling_scope) and ancestor (resolve_ancestor_scope) scopes (BND-25). Turning both scopes on leaves an error and acts as the sibling scope. If source_property_name or target_property_name is missing, each gives a Must define a … property name in the binding! error. A collection binding without binding_collection_name gives the error Must define a collection name for the binding!. | code (binary) | unknown | NB-09 |
| BND-37 | In one control's bindings, putting the collection binding first and the view binding that reads its value after it filled the grid cells from the first frame with neither of them on always (100 and 2000 buttons, name and description labels and icon; the cell's collection_details and the grid length binding were always). With the list open it was about 0.07ms per frame lighter than the version with always on both bindings (VSync off, about 284 to about 290 fps), and the difference was the same from 100 up to 20000 buttons. The opening cost was the same for both and grew with the button count (Filling the first frame without always). In the reverse order the view is expected to read the still empty value first, but the reverse order was not measured (inferred, BND-07). A version of the same cell that wrote the expression straight into the collection binding's binding_name with binding_name_override instead of a view froze the client when the list opened; which expression caused it was not isolated. | measured | Windows 1.26.65 | 2026-11-18, Windows 1.26.65 |
| BND-38 | Bindings cut integers to 32 bits. When a binding expression reads an integer, only the low 32 bits remain: -8589934591 in the property_bag was read as 1, and 2147483648 as -2147483648. A view binding that copies a value without any expression ("source_property_name": "#src", or from another control with source_control_name) also delivered a 64-bit integer truncated, so actor_portrait_renderer did not draw that entity, while 90 copied the same way worked. Do not move 64-bit integers such as entity ids through bindings; write them as JSON integers in the property_bag (FILE-47). | measured, code (binary) | Windows 1.26.65.1 | 2026-11-20 Windows 1.26.65.1, 2026-11-20 decompilation |
| BND-39 | A view binding target written without # ("target_property_name": "rotate_y", "scale_x", "translate_x") is written to that key of the control's property_bag, and custom renderers read the value. Writing to "#rotate_y" had no effect on actor_portrait_renderer. Use a renderer key as the target exactly as it is written in the property_bag. | measured | Windows 1.26.65.1 | 2026-11-20 Windows 1.26.65.1 |
| BND-40 | Script API ScreenDisplay.updateSubtitle updates the #hud_subtitle_text_string bindings of the controls made by hud_title_text_factory without the title being sent again. When the subtitle changed to 0, 45 and 90, the rotation, translation and scale bound to it followed. Sending the title again creates the control anew (ANI-12), so send values that change often in the subtitle. | measured | Windows 1.26.65.1 | 2026-11-20 Windows 1.26.65.1 |
| BND-41 | A constant expression in binding_name is computed at parse time. "binding_name": "('#title' + '_text')" with "binding_name_override": "#text" showed the title (it becomes a simple binding of the result #title_text). If the result is not text starting with #, nothing is registered and Must define a binding name! is logged (code). An expression containing # makes one entry for each #name in it, and without an override that #name itself is the target (code). "binding_name": "(not #title_text)" without an override, drawn with "text": "#title_text", still showed the title: the original value is written to #title_text (BND-26). | measured, code (binary) | Windows 1.26.65.1 | 2026-11-20 Windows 1.26.65.1, 2026-11-20 decompilation |
| BND-42 | A view binding expression without a # property is dropped at load even if it contains $ variables. When source_property_name is an expression made only of constants and $ variables, the error JSON UI parse failure: Must define a source property name in the binding! is logged and the binding does not work. (.25), (1 * .5), ('R' + $cut) concatenating "$cut", and the form ((20.0 - 15) / $max) using only "$max": 20.0 all did this, and the target stayed at its default (#alpha opaque, label text empty). Adding one # property made it work: with "#z": "R" in property_bag, (#z + $cut) gave Rabc, and with "#z": 0, (((20.0 - 15) / $max) + #z) on #clip_ratio clipped by 0.25. To compute from variable values only, put "#z": 0 for a numeric expression or "#z": "" for a string expression in property_bag and add + #z. When the expression is passed as a variable value ("$cexpr": "((20.0 - 15) / $max)" received and used in source_property_name), the $max inside that expression was not found, Expected variable not found in ancestor tree: '$max' was logged first, and the binding was dropped with the same error. The "expression without #" of BND-05 includes expressions that contain $ variables. | measured | Windows 1.26.65.1 | 2026-11-24 Windows 1.26.65.1 |
Proposed rules
These proposals are not merged into the adopted rules yet. Check the evidence before using them.
| ID | Rule | Level | Evidence environment | Source |
|---|---|---|---|---|
| BND-30 | There is a generator (AsaJS) that does repeated calculation (counting string length, a Newton square root) by attaching two view bindings to the same target, "initialize" and "itself + increment". The method relies on the premise that a view binding rewrites only when its source changes and the chain loops until it converges (the Cinnabar finding CN-36). The iteration limit and per-frame processing are not checked, so it is not used as a recipe. Self-reference itself worked on Windows 1.26.65.1. On a zero-size HUD panel, a view binding writing ((#st * (1 - (#on + #off))) + #on) back into #st held the state 1, 1, 1, 0, 0, 1, 1 for the titles XON a, other, plain, XOFF b, other2, XON c, other3, with no hang and no log error (record). Not checked: whether the iterative calculation that increments by 1 (string length, square root) reaches the final value, and how many frames it takes. | code (source), measured, unverified | Windows 1.26.65.1 | ASJ, CN, 2026-11-19 Windows 1.26.65.1 |
| id | Source | License | Commit | Accessed |
|---|---|---|---|---|
repo-guide | JSON UI comprehensive guide (this repository) (guide/) | This project's material | 2026-11-13 | |
private-research | Private research (-) | - | 2026-11-13 |