Private behavior variables: hidden from placed objects and Properties nodes #257

Closed
opened 2026-09-28 12:33:07 +02:00 by meleki · 1 comment
Owner

A behavior variable is visible everywhere outside its own graph today: in the inspector and Variables tab of every placed object (with an override each), and in the + Property menu of a Properties node of type Behavior. Counters, timers and scratch values clutter all of those.

What to build

  • A switch Private per variable on the behavior asset, next to Keep. Off by default, so existing projects stay as they are.
  • Placed object: a private variable is not shown in the inspector nor in the object's Variables tab, not even its live value during a run. To see it, look into the graph.
  • Overrides: switching a variable to private drops every override of it on placed objects, in one undo step. A running game does not write a private value back into the scene either.
  • Properties (Behavior): a private variable is not offered in the + Property menu. A port that names it by hand still works, at edit time and in the run.
  • Inside the behavior nothing changes: Variables node, Keep, default on the asset, one value per instance.

Decided

  1. Overrides are dropped when switching to private.
  2. No live values in the object's inspector; look into the graph.
  3. Name "Private", default off.
A behavior variable is visible everywhere outside its own graph today: in the inspector and Variables tab of every placed object (with an override each), and in the `+ Property` menu of a `Properties` node of type Behavior. Counters, timers and scratch values clutter all of those. ## What to build - A switch **Private** per variable on the behavior asset, next to Keep. Off by default, so existing projects stay as they are. - **Placed object:** a private variable is not shown in the inspector nor in the object's Variables tab, not even its live value during a run. To see it, look into the graph. - **Overrides:** switching a variable to private drops every override of it on placed objects, in one undo step. A running game does not write a private value back into the scene either. - **`Properties` (Behavior):** a private variable is not offered in the `+ Property` menu. A port that names it by hand still works, at edit time and in the run. - Inside the behavior nothing changes: `Variables` node, Keep, default on the asset, one value per instance. ## Decided 1. Overrides are dropped when switching to private. 2. No live values in the object's inspector; look into the graph. 3. Name "Private", default off.
Author
Owner

Done in e8b3ac0 (plus cf6565d: new variables start with Keep off).

  • Lock switch per behavior variable, next to Keep. Off by default, existing projects are unchanged.
  • A placed object shows no private variable, also not while the game runs.
  • Switching to private drops its overrides on all placed objects (one undo step).
  • A running game neither writes a private value back nor loses it on a project change.
  • + Property does not offer private variables. A port that names one by hand still works without a warning.
  • The default value of a private variable is read-only in the asset inspector.
  • Keep is now a pin icon, so the list header has room for both switches.

Not done: the animation track picker still offers private variables.

Tests: ./check.sh 2711 tests, CHECK EXIT 0. e2e 1,19,20,21,56: 119 checks passed. New e2e module 56 (7 checks), unit file tests/core/private-variables.test.ts (5 tests). Counter-checks fail as expected.

Wiki: Behaviors, Development (1ebead5).

Done in e8b3ac0 (plus cf6565d: new variables start with Keep off). - Lock switch per behavior variable, next to Keep. Off by default, existing projects are unchanged. - A placed object shows no private variable, also not while the game runs. - Switching to private drops its overrides on all placed objects (one undo step). - A running game neither writes a private value back nor loses it on a project change. - `+ Property` does not offer private variables. A port that names one by hand still works without a warning. - The default value of a private variable is read-only in the asset inspector. - Keep is now a pin icon, so the list header has room for both switches. Not done: the animation track picker still offers private variables. Tests: `./check.sh` 2711 tests, CHECK EXIT 0. e2e 1,19,20,21,56: 119 checks passed. New e2e module 56 (7 checks), unit file `tests/core/private-variables.test.ts` (5 tests). Counter-checks fail as expected. Wiki: Behaviors, Development (1ebead5).
admin added this to the Development project 2026-09-28 21:22:16 +02:00
admin moved this to Done in Development on 2026-09-28 21:22:27 +02:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: meleki/feuerwerk#257