Describe the Find … Match block

Behaviors gets a paragraph and the node names, Development the check total 1517.
admin committed 2026-09-28 10:40:25 +02:00
1 parent d421afb5fa
commit 564b46663b
2 files changed
+13 -2

No files matched your search

+12 -1
@@ -139,7 +139,7 @@ playing use the same two words.
set to `a` also hears `A`, and a key picked with Shift held is stored lower-case. A key is let go
under the name it went down as, even when Shift changes in between (`1` down, `!` up).
- **Node set** (`src/core/graph/nodes/`, one file per node): events `On start`, `On enable`, `On update`, `On disable`, `On destroy` (see *Lifecycle*), `On key down/up/held`,
`On timer` (fires on the first frame past each due time; `late` says by how much, so `time - late` is exactly a multiple of the interval), `On collision enter/stay/exit` (stay every frame, or with an interval; while playing enter and stay tell normal, impulse and point of the contact), `On click` (the mouse pressed on the owner — anywhere when it has none), `On animation finished`, `On state entered`, `On state exited` (one output per state, see *State machines*), `Start` · flow `Branch`, `Sequence`, `Repeat`, `For each`, `Run behavior`, `End`, and the four that move or follow a state machine, `State branch`, `Set state`, `Set state by name`, `State transition` (see *State machines*) · data `Self`, `Owner`, `Parent`, `Object by name`, `Child by name` (the nearest object of that name below the given one: its children, then their children, and so on; within a level the first in hierarchy order, nothing when none is called so), `Name of`,
`On timer` (fires on the first frame past each due time; `late` says by how much, so `time - late` is exactly a multiple of the interval), `On collision enter/stay/exit` (stay every frame, or with an interval; while playing enter and stay tell normal, impulse and point of the contact), `On click` (the mouse pressed on the owner — anywhere when it has none), `On animation finished`, `On state entered`, `On state exited` (one output per state, see *State machines*), `Start` · flow `Branch`, `Sequence`, `Repeat`, `For each`, `Find` … `Match`, `Run behavior`, `End`, and the four that move or follow a state machine, `State branch`, `Set state`, `Set state by name`, `State transition` (see *State machines*) · data `Self`, `Owner`, `Parent`, `Object by name`, `Child by name` (the nearest object of that name below the given one: its children, then their children, and so on; within a level the first in hierarchy order, nothing when none is called so), `Name of`,
`Is asset` (is this object an instance of asset X — how you tell what you collided with),
`Variables`, `Properties` (every property row of the target's type, the transform rows `scale`, `rotation`, `mirrorX`, `mirrorY` included — how a graph turns a sprite), `Get position` (local and world), `Is enabled`, literals `Number`/`Text`/`Boolean`/`Texture`/`State machine`/`Sound`/`Scene`/`Animation`/`Asset`, `Add/Subtract/Multiply/Divide`,
`Min/Max/Abs/Sqrt/Clamp`, `Lerp` (from a to b as t runs from 0 to 1, t held in 0…1; the setting
@@ -257,6 +257,17 @@ playing use the same two words.
into `Equals "Gold"` into `break` finds the first loot named Gold, like
`list.FirstOrDefault(x => x.Name == "Gold")`. As with `Repeat`, every round reads its data
inputs anew, so a variable the body changes counts for the next round's break.
- **Find … Match** is the same search as a block that reads left to right, without an edge
running back into the loop node. `Find` takes the `list` and hands out `item` and `index`;
whatever is built from them ends in the `match` input of a `Match`, and that is the test. The
first element it is true for continues at `found` of the Match, with that `item` and `index`;
none continues at `not found`, `item` empty and `index` -1. Adding a `Find` brings its `Match`
along beside it. The block is nothing but the wiring: a Match closes the Find its test is built
from, so a copy pasted elsewhere is a block of its own. A soft frame behind the Find, the Match
and the nodes between them shows what belongs to the test (a literal feeding the test from
outside stays outside). While a Find has no Match, or two Matches test it, or one Match is built
from two Finds, both nodes say so and nothing runs past the Find. The test is data only: every
element reads it anew, like the break of `For each`.
- **A behavior as a node** (nesting): a behavior, usually one with a **Start** and an **End**
node, can be run as a step of another behavior's graph. Every input declared on the start node becomes an
input port of the calling node, every output declared on the end node one of its outputs; the
+1 -1
@@ -15,7 +15,7 @@ npm run build # writes dist/ and regenerates index.html
php tools/make-user.php <name> <password> [admin|user] # an account; every tool signs in (see Accounts)
php tests/php/accounts.test.php # the API's account rules, no server needed (CI's gate job)
php tests/php/snapshots.test.php # the snapshot store (#231), the same way
node tools/seed-e2e.mjs && node tools/e2e.mjs # 1514 editor checks, screenshots in /tmp/gm-e2e-*.png
node tools/seed-e2e.mjs && node tools/e2e.mjs # 1517 editor checks, screenshots in /tmp/gm-e2e-*.png
GM_STEPS=20 node tools/e2e.mjs # or 1-12, or 6,20 — a subset while working on one step
./e2e.sh start [GM_STEPS] # the same run detached, see below
./e2e.sh status # live progress, or the last run's result