village_trader = Unique ID, used in assets/creatures/characters.json
dont_want_to_buy = list of items IDs, player can't sell to trader
items = list of items IDs, player can buy
village_trader_profile = Profile unique ID, used when NPC spawn
name = Hint name text, that appear when player look at NPC
trader_profile = Unique ID from traders.json
texture = Texture name of NPC model from assets/textures/
idle_animation = Base idle animation that plays after spawning,
weapon = Model name from assets/models/
gasmask = Show/hide gasmask
gasmask_type = Type of gasmask ( or )
weapon_hold = = where weapon model will be attached
dialogues = Array of dialogues, for trader it must contain same structure as above
You can edit existing values and see how it works.
To create new trader, we need to create new character structure and new trader structure. How to spawn NPC, you can learn in this tutorial:
Files & folders needed for adding new trader NPC:
assets/creatures/traders.json
assets/creatures/characters.json
assets/scripts/p_game.gd
Add new trader structure to assets/creatures/traders.json