Skip to content

five-on-it / apps/level-editor/src/scripts/blocks/npc

apps/level-editor/src/scripts/blocks/npc ​

Marks a node of the editor scene as an NPC spawner: a person of a role (guard, who watches, chases and shoots; civilian, who watches and calls the guards; driver, at the wheel of a car of its vehicle class, driving its patrol's points over the roads; target, who goes about its rounds and runs to its refuge when threatened; vip, who follows the first player to come up to it) standing on the node's origin, never scaled, turned with yaw only. With a patrol (points x z in the game's frame, the recipes' frame, separated by semicolons) it walks from its spot through them, looping back or back and forth; without one it keeps its post, facing the node's +z and looking turn degrees either way. A schedule changes its rounds by the hour, and sends it home (indoors) and back out. Its weapon by name (none for none) and its pockets (item ids, each with an optional *<count>), which a player searches once it is down. The library's block:npc carries it: place instances of that mesh for npm run level:export to read.

Classes ​