Skip to content
EvilEngine.Api.Npcs

INpcs interface

public interface INpcs

Where a Plugin gives NPC classes, through its context’s Npcs. A spawnable record names a class and a body; with the class registered, its body spawns with what the NpcClass says, and with none it stands as its body does.

context.Npcs.Register(ContentId.Parse("gmod:npc_zombie"), new NpcClass(50));
Assembly
EvilEngine.Api
Commit
4ff877b1

Members

Register method

void Register(ContentId @class, NpcClass npc)

Registers a class while the Plugin loads, the later Plugin’s winning, and the earlier’s coming back when it unloads. Registering after loading throws, and so do health, most health or a model’s health below 0 and a null ModelHealth. The class keeps its health by model as it was registered, so changing the dictionary afterwards changes nothing.