ConstTrue when REDnode's world support runs: Codeware is installed and a game is loaded.
The files an entity uses: its template and every resource its components name, as path hashes. Needs Codeware.
Loads an EDGEbuilder scene into the running game: its meshes, entities and NPCs (lights
are not spawned yet). Pass the scene, or a .scene.json file's path (absolute, or in
your package's folder). People stand where placed and stay friendly to V. Loading a
scene of the same name again replaces it.
Places an entity. Cheap enough for once a frame, while the player drags it. For this package's own spawns it also keeps the new place, so a respawn after an archive swap puts the entity where it was moved to.
Optionalorientation: WorldRotationOptionalyaw: numberThe entities near V, nearest first, read in the game in one call. With files, each
one's files; with uses, only the ones that use one of the given files.
Calls the handler for an entity event of REDnode's entities and watched ones.
The event has entityId and entityType. Returns a function that stops it.
Calls the handler when REDnode spawned one of this package's entities again, with its
old and new id. It does so after an archive swap that changed a file the entity uses,
so the entity shows the new version (see archives.reload). Returns a function that stops it.
Removes an entity spawned with world.spawn.
Spawns an entity and resolves once it is in the world (Codeware's
Entity/AfterAttach). Components are attached while it assembles, before the
game gathers its components, the moment Codeware documents for it.
This package's spawns that are still listed: what each was spawned with, and its scene.
Removes what world.load spawned for that scene. Resolves with how many were removed.
import { api, world } from "rednode";
const mesh = await api.$new("entMeshComponent", {
name: "crate",
mesh: "base\\environment\\props\\crate_a.mesh",
meshAppearance: "default",
});
const { id } = await world.spawn({
template: "base\\spawner\\empty_entity.ent",
position: { x: -1234, y: 987, z: 12 },
components: [mesh as GameRef],
});
await world.move(id, { x: -1234, y: 988, z: 12 }, undefined, 90);
await world.remove(id);
Entities in the world, for builders and anything that places things.