Forge a creature from inside Foundry
CREATURE_FORGE_PLAN Part 5. A third button on the Actors sidebar, beside New agent and New NPC. Pick what it does, how big it is and how bad it is; the card underneath describes what those settings will actually produce, because the argument for a derivation over a form is that it can be interrogated, and choosing between "brute" and "sentinel" from two nouns is not interrogating anything. The card is itself forged rather than written, so it cannot describe a creature the derivation would not make. generateCreature reads the catalogues out of the packs and calls the same forgeCreature the CLI calls. Natural attacks carry their body-plan declarations into flags.ringbrp.plans so the engine can read them. The plan asks that the panel and the CLI cannot diverge, and importing one derivation was most of that guarantee but not all of it: the two feed it from DIFFERENT catalogues — content.mjs on one side, the built compendium on the other. check-forge now builds the engine's view straight out of packs/weapons and requires both to forge the same creature. It found a divergence on its first run, in 40 of 90 pairs. The fallback took the first usable natural attack from the caller's list, and that list arrives in declaration order from content.mjs and in id order from the pack, so a tiny vesh brute was punching for the CLI and constricting at the table. The derivation may not depend on its caller's iteration order; it imposes its own now. Not yet verified in a running Foundry. The pure derivation is covered by 450 guarded combinations and the catalogue seam by the agreement check above, but Actor.create, the pack reads and the dialog itself are the part check-behaviour says outright it cannot reach. They need a world open, and that has not happened yet. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
This commit is contained in:
co-authored by
Claude Opus 5
parent
d7def0b31e
commit
09e33907fa
@@ -179,7 +179,15 @@ export function forgeCreature({
|
||||
// the point the creature is made rather than patched afterwards. The fallback is
|
||||
// drawn from the same declarations, so it cannot reach for something this body
|
||||
// cannot use either.
|
||||
const fallback = (naturalAttacks ?? []).find(w => hasWeapon(w) && canWield(w));
|
||||
/* SORTED, and that is not tidiness. `naturalAttacks` arrives in whatever order the
|
||||
caller's catalogue happens to hold: tools/forge.mjs reads content.mjs and gets
|
||||
declaration order, while generateCreature reads the compendium and gets id order.
|
||||
Taking the first match made the fallback depend on which side was asking, and the
|
||||
two forged different creatures from identical requests — a tiny vesh brute got
|
||||
`punch` from the CLI and `constrict` from the table. The derivation may not depend
|
||||
on its caller's iteration order, so it imposes its own. */
|
||||
const fallback = [...(naturalAttacks ?? [])].sort()
|
||||
.find(w => hasWeapon(w) && canWield(w));
|
||||
if (fallback) weapons.push(fallback);
|
||||
else problems.push(`no natural attack this ${plan} body can make is in the catalogue`);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user