5: Going back to the NPC

INTRODUCTION:

Typical RPGs Quests ask not only to complete it, but also to go back to the NPC who asked you this service. Let's do it!

Note: this step is optional, you're not forced to do it.

A) ISSUE IDENTIFICATION

The issue we have now is that our NPC can only ask one Question. What we need to do here is:

  • to create an invisible NPC Asker (called NPC B for the rest)

  • to end this Quest there

  • and to start another Quest then

  • that switches on the invisible NPC Asker Behaviour

B) CREATE INVISIBLE NPC B

The idea here is to have a second OBJECT that will do the Quest interaction as if it was our first NPC. Player's won't notice anything as it is not visible.

  1. Take back your NPC, and duplicate it. Place it in front (not exactly at the same position so it stays easy to pick both ones)

  2. Disable its Visibility

  3. Put it as "No Collisions"

  4. Put on it a Toggle Behaviour component

  5. We'll set each parameter later!

C) EDIT THE FIRST QUEST

Go back in the Rules Window, and set the Action after completion to Send Message.

D) EDIT THE NPC B

Now, select back NPC B, and we have to set the Asker Behaviour to make it thanking Players for the Quest Completion.

  1. Write its Question as it was thanking you for your service.

  2. Write the related Answer (A1)

  3. Put a specific Message sent for this Answer (A1), we'll use it later.

In the Toggle Behaviour Component, we'll set it up so its Behaviour becomes active only once the First Quest has been completed.

  1. Set Turn ON Message to the Message you've set up in C) EDIT THE FIRST QUEST.

  2. Set Turn OFF Message and Toggle Message on none.

  3. Set Initial Behavior State on False.

E) CREATE A SECOND QUEST

Then, go back in the Rules Window, collapse the first Quest, and click on "ADD QUEST" to create a new Quest. We want it to be triggered once the First Quest has been completed. This Second Quest asks Players to talk back to the NPC.

  • Put the Name and Description you want (we recommend using something that still drives Players to their mission, even if it's only about talking to someone).

  • Set Launch quest to Requires Message, and put in it the C) EDIT THE FIRST QUEST Message.

  • Set Quest type to Wait For Message, and put in it a new Message (we recommend putting Q1 to keep it simple).

  • Set Quest completion to Wait for Message, and put in it the D) EDIT THE NPC B Answer 1 (A1) Message Sent value.

F) MESSAGE BROADCASTER

Why putting a Wait for Message with a new Message as the Quest type? It is because we need it for the Signs display later. But before talking about Signs, we must create a Message Broadcaster to do so:

Add whatever ASSET in the Scene:

  1. Set its Physics as "No Collision"

  2. Put a Message Broadcaster Behaviour on it, and:

    1. set Visible as False

    2. set Message to Send as the E) CREATE A SECOND QUEST new Message in the Quest Type.

    3. set Broadcast only Once as False

    4. set the Delay between Broadcast to 1

  3. Put a Toggle Behaviour Component on it, and:

    1. set as Turn ON Message the C) EDIT THE FIRST QUEST message

This way, the Message Broadcaster won't stop sending its Message once the first Quest will be completed. Thanks to this, we'll be able to directly finish the Second Quest objective and wait for a validation, allowing us then to display a specific Sign for it.

G) TRY IT!

Press Play, and try it! Now you have a complete RPG Quest! It is only missing Signs and Rewards to be a simple yet complete RPG experience!

👏 Well done! You've finished the 5th step of ◑ Your first RPG Experience Tutorial ! You can go now to the 6th step of the Tutorial: 6: Putting Quest Signs !

Last updated