HOW-TO: Create a new NPC
Or to be more precise in speak in Editor terms: find out how to create a new “NPC entity template”.
In this tutorial you will learn how to create a new NPC’s with different sets of appearances and how to use the Entity Editor. We will take advantage of already available Entity Templates to build the foundations of our new creation.
Create a new folder and entity template
Creating entity templates like many other assets is done via the Asset Browser’s context menu.
It is recommended to place the new file somewhere in your world folder’s assets e.g.:
- mydepot/levels/myWorld/characters/Your New NPC.
Open the Asset Browser CTRL+A or View tab).
In the main depot folder find the levels folder. It is recommended to place the new file somewhere in your world folder’s assets for example: depot/levels/my_new_world/characters/your_new_NPC.
To create a folder, right click on some free space, choose Create Directory Here and enter a name (no spaces or capital letters allowed).
Now enter the characters folder you created a moment ago and in the context menu choose > Create > Entity template.
Enter a name for the file and confirm with OK.
Your new file should appear in the folder and is now ready to start editing.
The Entity Editor
Open the newly created Entity Template file by double clicking it. This will open the Entity Editor.
Yes, there’s not a lot to see right now. Just two empty screens.
Viewport - on the left where we can see a preview of how our entity will look like in your world.
Graph Editor - showing us all the components that builds up our entity.
And below, different configuration tabs below where we can apply settings like the appearance sets, animation, effects applied on the entity (sparkling, shining, magic etc.), voicetags if there are any, gameplay etc.
There are different approaches you can choose at this point. One would be creating different nodes in the Graph Editor, but this is somewhat difficult as you need to create the structure one-by-one.
This is where loading up existing files via the configuration tabs come in handy!
Use existing templates
Applying different settings will generate content into the graph making the creation of the overall structure faster. So in this tutorial we will choose existing classes and character entity template.
Go to the Template properties tab.
In the Entity Class you can set a class by choosing from the list of already defined, commonly used classes. To do that, click on the left arrow (⇐) button.
In the pop-up dialog, search for CNewNPC and double-click that item in the Class Selector.
3. After this step…. not much has changed. The Included templates area is still empty. This is where you can add functionalities which are already defined.
We need to go back to the Asset Browser to find and select a base entity template. Use the folder path below.
Let’s choose this file: characters\base_entities\woman_base\npc_base_w\npc_base_w.w2ent.
Once it’s selected, press the button in the Included Templates configuration tab.
6. After adding the template, the graph editor has been filled with various components. However, there is still nothing in the Viewport. You cannot see your future NPC. Let’s change that!
Right click on the graph’s background, then Select Component and choose CAppearanceComponent.
As soon as we added at least one appearance component in the graph editor, an Appearances tab will become available for you.
Editing appearance
The Apperances tab is where you can change everything about the NPCs appearance. While you continue creating something new, you might want to also open a more complex, ready entity file (e.g. bob_nilfgaard_soldier) to see how it is structured. Just double click on it in the Asset Browser to open another Entity Editor window - it won’t affect the work you’ve been already doing.
It should help you understand that you can add a whole list of different appearance sets: multiple combinations of head + legs + torso appearances are possible for each entity template, while the reference to it will stay the same.
But back to our entity template creation!
First, we need to add an appearance set in the Appearances tab and name it.
2. Select the created appearance set and start adding elements in the Body tab - in the same way as with the template files. First locating them in the Asset Browser, then selecting them and pressing the button back in the Entity Editor.
Here’s an example from the game: an elf woman from Novigrad.
And one more custom set which might inspire you:
As you can see, the files are usually stored in the depot folders named like body parts: (body, heads, torso, legs) or items (shoes, dress, caps, items). You can also use the Asset Browser’s search.
The number of possibilities in editing or combining the appearance of NPCs is limited perhaps only by your imagination.
Editing animation, voicetags and more
In different tabs you can add voicetags and animations etc. to the templates in a very similar way to adding appearances.
______________________________________
The Witcher 3: Wild Hunt Complete Edition © 2024 CD PROJEKT S.A. Published by CD PROJEKT S.A. Developed by CD PROJEKT RED. CD PROJEKT®, The Witcher®, REDengine® are registered trademarks of CD PROJEKT Capital Group. All rights reserved. The Witcher game is set in the universe created by Andrzej Sapkowski in his series of books. All rights reserved.