scene_set_creature_logic
Configures a complex creature's behavior in a copied save by assigning its decision graph, skills, cooldowns, and enemy-detection logic so it can wander, work, flee, or fight.
Instructions
Give a complex creature its behaviour, in a copy of a save: the decision graph it runs all the time, the skills it can use and how it notices enemies. This is how a unit is made to do things on this platform (walk to a place, wander, work, flee, fight): an ordinary creature only reacts to enemies the way its asset was built to, a complex creature (an asset of the group "怪物(AI版)") does what its graphs say. prefab is a creature prefab made from a placed complex creature (scene_add_prefab {fromEntity}); every placed copy is changed too; entity names placed creatures instead. decisionGraphId is a graph made with scene_add_graph {kind:"creatureDecision"}: it looks at the situation and switches to one of several status graphs (kind "creatureStatus"), each a short list of tactics and skills with a condition on each: move to a point or to an entity, wander, stand still, pursue, flee, patrol, turn, execute a skill. These graphs read custom variables, so a server graph steers the creature by writing variables on it (where to go, what its job is, whether it is night). skills lists creature skills (scene_add_creature_skill) by name or id; they get the numbers 1, 2, ... in this order, which a status graph passes to f.executeSkill. cooldownSeconds of a skill is the wait after one use before the next, a number or [from, to] for a random wait (the editor's default is [0, 3]); firstCooldownSeconds the wait before its first use in a fight; sharedCooldownSeconds the wait every skill of the creature shares. logic is how the creature comes to fight (自主逻辑参数): noticeRadius, metres around it within which it notices an enemy whichever way it looks (范围感知; off when left out); sightDistance, how far it sees in front of it (视锥距离, 10); leaveCombatDistance, the distance to its target beyond which it gives up (脱战距离; the editor's 5 is less than its sight, so with logic it defaults to the larger of the two distances plus 6); leaveCombatDelaySeconds; territoryRadius, metres around the place it was created that it does not leave (领地, 50); chainRadius, within which its fellows join the fight (连锁入战距离). An enemy it notices becomes its aggro target (TargetEntity.AggroTarget in its graphs; f.queryIfEntityIsOnTheField tells whether there is one). Without logic the creature keeps its templates; one without any gets the template the editor makes. Writes a new .gil in the workspace; the official save is not touched. Without cooldowns and logic, byte for byte the two creatures of the official sample 复杂造物; the cooldown and logic numbers were each changed in the editor and read back on 2026-10-11.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| logic | No | ||
| entity | No | ||
| prefab | No | ||
| skills | No | ||
| mapPath | No | ||
| outputName | No | ||
| decisionGraphId | Yes | ||
| sharedCooldownSeconds | No |