adding_a_new_npc_in_game

Adding a new NPC in game

The objective of this guide is to add a new NPC to the game that we can interact with. For this guide's sake we will not create the quest line to assign him, since it will be done in the next guide.
The Npc adding procedure is fairly easy, since we will only have to add a single json file to our new mod.

All of the mod's npcs have to be located in the QuestGiversNpc folder:

C:\Users\{YOUR USERNAME}\AppData\LocalLow\RadicalFiction\HARDTIMES\Mods\MyMod_MODPKG\QuestGiversNpc

After creating the folder we will create a brand new file:

C:\Users\{YOUR USERNAME}\AppData\LocalLow\RadicalFiction\HARDTIMES\Mods\MyMod_MODPKG\QuestGiversNpc\modder_npc.json

So that it will look just like this:

{
  "questGiverNpcId": "modder_npc",
  "scene": "zero",
  "posX": 0,
  "posY": -8,
  "questList": [
   
  ],
  "bodyIndex": 2,
  "hairIndex": 0,
  "beardIndex": -1,
  "dressId": "polo",
  "dressType": "ClothingItem",
  "hasBreast": false,
  "hatId": "",
  "hatType": "",
  "proxyId": "",
  "proxyType": "",
  "wanderRange": 2
}

We can note that in this object we have a full description of the Npc we want to add to the scene. The various properties are quite straightforward to grasp, but you can refer to the NPC Moddig Guide for a full explaination of all the possible properties and related values.

Everything left to do now is to edit the mod's descriptor file to let it know we have to load also npc data when we load the mod:

C:\Users\{YOUR USERNAME}\AppData\LocalLow\RadicalFiction\HARDTIMES\Mods\MyMod_MODPKG\Descriptor.json

And add the “questGiversNpcsFolder” property to those already present in the file. It will point to the name of the folder we created before. So the descriptor file will look somewhat like this:

{
  "modName": "MyMod_MODPKG",
  "author": "RadicalFiction",
  "gameVersion": "",
  "langFolder": "Lang",
  "itemsFolder": "Items",
  "shopsFolder": "Shops",
  "spawnersFolder": "Spawners",
  "figuresFolder": "Figure",
  "furnituresFolder": "Furnitures",
  "recipesFolder": "Recipes",
  "fishingSpotsFolder": "FishingSpots",
  "questGiversNpcsFolder": "QuestGiversNpc"
}

Assuming you followed all the other guides and already added all the other properties.

If everything went well you should now be able to start again the game with no errors(!). Be sure you have your new mod active and start a new game.
Since we set our Npc to appear in the “zero” scene (which, by chance, is the name of the suburbs scene), we can start a new game and just move a few steps upward to meet our new friend: It's him! the guy with the orange polo!
In the next guide we will create a brand new quest line to assign him, so we will use all of the previously created items and furnitures with it.

If you have problems or find errors in this guide please get in touch at info@tempi-duri.net.

You could leave a comment if you were logged in.
  • adding_a_new_npc_in_game.txt
  • Last modified: 2019/02/12 10:52
  • by thorfinio