MAC's Simple NPC integration

Using Talk to NPC objective

To use Talk to NPC objective first of all you will need to create a special dialogue line for the NPC. To do that go to the Dialogue setup and create a new dialog. Enter the speech you want and create at least one answer with action from supported addons called MQS Continue quest. When the player will choose an answer with this action, the quest will continue and the dialog will be closed.

image-1621772099056.png

MQS Fail quest action will do the same as MQS Continue quest action but fill fail the quest.

To assign this dialog to the objective, remember the dialog ID save the NPC code, and process to the Talk to NPC objective. Select your NPCs and enter the dialogue ID. After saving the quest you will have a valid Talk to NPC objective.

Note. Avoid opening premade dialogue line by just talking to the NPC. It can break other quests if you just talk to the NPC and choose an answer with MQS Continue quest or Fail quest action.

You also can create more complex dialogues from the start dialog line, but at the end, at least one answer must leed to the MQS Continue quest action to avoid player stack on the quest.

Assigning multiple quests to an NPC

If you are creating a new NPC with a purpose to assign quests to him, in the editor choose the [MQS] Use the NPC for the quest system option.

image-1621772872824.png

If you want to add this option to an existing NPC with a small Lua edit, go to the mc_simple_npcs/lua/mcs_npcs folder and edit sh_npcspawn.lua file. Find the NPC table you want to edit and add the questNPC = true, parameter to the main table.

image-1621773232246.png

To make NPC open a list of all quests set the action for the answer you need to MQS Open All quest from supported addons list.

image-1621774715771.png

Or edit Lua and same way change the action to MQS Open All quest

image-1621774858582.png

Assigning quests to a specific answer

If you want to assign playing individual quest to a specific answer you will need to edit Lua the same way you do it for opening a menu. Go to the mc_simple_npcs/lua/mcs_npcs folder and edit sh_npcspawn.lua file. Find the NPC table you want to edit and add the navigate to the answer you need. Instead of "close" parameter change it to {id = "MQS Start quest", data = {quest_id = "id_test"}} where id_test you will need to change to your quest id.

image-1621775351015.png

ezgif-7-7a08345ec36a.gif