Spawn takes its asset on a port; node "Child by name" #237

Closed
opened 2026-09-26 17:20:44 +02:00 by meleki · 1 comment
Owner

Asked in chat (2026-09-26, project cbbf160bb7e8).

1. An asset as a value

Spawn picks its asset in a setting, so nothing can feed it: no variable, no list, no edge. The kind asset existed only for settings.

  • asset becomes a full kind like Animation or Sound: variable, list item ({"$asset": id}), declared port, and an Asset literal node. Declared by a user it offers every placeable asset.
  • Spawn and Is asset get an asset input with the picker inline. The key stays asset, so a pick saved before reads as the inline value and old projects keep spawning.

2. Node "Child by name"

Like Object by name, but only below a given object: its children, their children and so on. The nearest level wins (a child before a grandchild), within a level the first in hierarchy order. null when nothing is called so, or no object is given.

Asked in chat (2026-09-26, project `cbbf160bb7e8`). ## 1. An asset as a value `Spawn` picks its asset in a setting, so nothing can feed it: no variable, no list, no edge. The kind `asset` existed only for settings. - `asset` becomes a full kind like Animation or Sound: variable, list item (`{"$asset": id}`), declared port, and an **Asset** literal node. Declared by a user it offers every placeable asset. - `Spawn` and `Is asset` get an `asset` input with the picker inline. The key stays `asset`, so a pick saved before reads as the inline value and old projects keep spawning. ## 2. Node "Child by name" Like `Object by name`, but only below a given object: its children, their children and so on. The nearest level wins (a child before a grandchild), within a level the first in hierarchy order. `null` when nothing is called so, or no object is given.
Author
Owner

Done in 923baf2 (wiki 699b72d).

Asset as a kind

  • "Asset" is now a value kind like Animation or Sound: a port type, a variable kind, a list item, and a new literal node Asset.
  • Spawn has an input asset. Unconnected you pick the asset on the node, connected it comes over the edge.
  • Is asset got the same input.
  • Old projects load unchanged: the input uses the key of the old setting, so a stored asset now shows as the input value.

Child by name

  • Inputs object and name, output child.
  • Searches every level below the object, breadth first: a child wins over a grandchild of the same name, and inside one level the hierarchy order decides. No match or no object gives (null).

Tests

  • ./check.sh: 168 files, 2453 tests, CHECK EXIT 0
  • 9 unit tests in tests/core/asset-kind.test.ts plus catalog cases for Spawn, Is asset, Child by name and the literal.
  • e2e 6z-ii (2 checks): node rows and a real drag of the literal onto asset. e2e 3 and 9 (Spawn with the old stored format) green in the same run.
  • 3 counter-probes (depth-first search, Spawn reading only the old setting, runtime ignoring the parent) each fail their test.

Follow-up in 98211a8: a variable of kind Object can now hold the spawned instance across behavior runs.

Done in `923baf2` (wiki `699b72d`). **Asset as a kind** - "Asset" is now a value kind like Animation or Sound: a port type, a variable kind, a list item, and a new literal node **Asset**. - **Spawn** has an input `asset`. Unconnected you pick the asset on the node, connected it comes over the edge. - **Is asset** got the same input. - Old projects load unchanged: the input uses the key of the old setting, so a stored asset now shows as the input value. **Child by name** - Inputs `object` and `name`, output `child`. - Searches every level below the object, breadth first: a child wins over a grandchild of the same name, and inside one level the hierarchy order decides. No match or no object gives `(null)`. **Tests** - `./check.sh`: 168 files, 2453 tests, CHECK EXIT 0 - 9 unit tests in `tests/core/asset-kind.test.ts` plus catalog cases for Spawn, Is asset, Child by name and the literal. - e2e 6z-ii (2 checks): node rows and a real drag of the literal onto `asset`. e2e 3 and 9 (Spawn with the old stored format) green in the same run. - 3 counter-probes (depth-first search, Spawn reading only the old setting, runtime ignoring the parent) each fail their test. Follow-up in `98211a8`: a variable of kind Object can now hold the spawned instance across behavior runs.
admin added this to the Development project 2026-09-27 11:28:31 +02:00
admin moved this to Done in Development on 2026-09-27 11:29:08 +02:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: meleki/feuerwerk#237