Get started - gamehunt/CustomNPCs GitHub Wiki
Before we start, let's define some constants:
Root directory is where npcs configs are located: {EXILED CONFIG DIRECTORY}/npcs
Nodes directory is where nodes are stored: Root_directory/nodes
Root directory stores NPC's templates, Nodes directory stores talk nodes
All files are in .yml format
First of all, we need to create NPC's template file
There is default_npc.yml
in root directory. This file describes default npc, that got summoned when npc_create
command is used without arguments
Here it's contents:
---
name: DEFAULT
role: Scientist
health: -1
scale: [1, 1, 1]
inventory: [GunLogicer, KeycardO5]
item_held: GunLogicer
root_node: default_node.yml
god_mode: true
is_exclusive: false
affect_summary: false
process_scp_logic: false
events: []
ai_enabled: false
ai: []
name
is NPC's nick
role
is NPC's role
health
is NPC's health (-1 for default)
scale
is x, y and z scale of NPC
inventory
is a npc inventory
item_held
is an item that npc holds
root_node
is file of the root node. Path is relative to node's directory
god_mode
- if true, NPC is immortal
is_exclusive
- if true, only one player can talk with NPC at a time
affect_summaries
- if true, NPC will affect round summaries (For example, round won't end if SCP NPC alive with Class D player)
process_scp_logic
- if true, NPC will emulate SCP logic (Reviving as SCP-049, Enraging as SCP-096, Clipping through doors as SCP-106 e.t.c)
events
- events, that attached to NPC
ai_enabled
- if true
NPC will use AI system
ai
- AI queue of NPC
You can duplicate this file and edit these parameters as you need
Nodes are essentials of NPC's dialogue system
Let's see what is default_node.yml. It's located inside the nodes directory
---
description: NOPE
reply: HELLO THERE
conditions: []
actions: []
next_nodes: []
decription
is short description of player's anwer. That's what player talks to NPC. This is useless for root node.
reply
is NPC's reply
conditions
is condition's array of this node. We will talk about this later. Currently I'll only say that if at least one condition if false this node will be skipped
action
is actions's array of this node. There are many actions, each has it's own arguments,so they are described in separate section
next_nodes
is player's replies array. If it's empty NPC will end talk. Each element of this array is node's path, relative to the node's directory. For example if we have next_nodes: [somenode.yml, somenode1.yml]
in default_node
, player will have something like that in his console:
[NpcName] HELLO THERE
Answers:
[0] SomeNodeDescription
[1] SomeNode1Description
So, it's all. You can also duplicate this file and edit it if you want.
To summon your NPC you can write npc load <your file>
in the Remote Admin and got your NPC in game!
To talk with NPC type .talk
in your console when NPC is near
To answer you'll need to type .answ <answer number>
Also u can get answer list from NPC with .lansw
or .lsa
You can read more about in-game usage here