The Action Editor: Making Quests - voxraygames/worldbuilding GitHub Wiki

Table of Contents

Introduction

The Voxile Editor comes with a robust scripting system called the Action Editor, which can be used for:

  • Assigning Dialogue to an NPC
  • Creating quest requirements
  • Changing the Time of Day
  • Moving NPCs around the world
  • Tracking gameplay events

… and much more!

In this tutorial, let's look at how we can create an interactable NPC with a handful of basic quests.


Basics

1. Adding an NPC

First, let's navigate to LOAD | ENTITIES and select npcs/multi_npc:head.

image

2. Tag the NPC

With the properties tool selected on your hotbar (the blue cog), click on your new NPC. This is a complex looking menu, but don't worry, we only need the Host ID box near the bottom. Type a sensible name for your NPC here; I've called mine npc_sam.

image

3. Create a new action template

In the ACTIONS tab, select Add Template | Empty to create a new action template for our NPC.

In Host ID, type (or copy) the tag of your NPC (so I will type npc_sam). In Name, type the player-facing name of your NPC (this will show whenever the player interacts with your NPC).

image

Additionally, Welcome Text is the line of dialogue your NPC opens with when they first meet the player. Welcome Back should contain generic dialogue executed when the player speaks to the NPC in the middle of performing a quest objective (something along the lines of "Hurry up and finish my quest!"). Don't worry about these two just yet.

4. Add dialogue

For a player to be able to talk to your NPC, they must have something to say! Click Add Action at the bottom of the Actions tab and click the new action that appears in the list above it. It should read <ExampleDescription>. Now some terms:

  • Action ID is the unique ID which allows you to reference this dialogue in scripting. You may change it to something more recognisable, but I tend to leave it as it is.
  • Prompt is what your player "says" to initiate this dialogue. It can be as pleasant or as mean as you like.
  • Response is what the NPC says back to the player.
  • Summary is what displays as the quest objective (note that this only displays if the attached action activates a quest).
  • Welcome Back will override the generic Welcome Back text designated in the action template. This is a good place to put hints or additional quest information.

In Prompt, write a simple greeting the player can give the NPC. In Response, write a greeting back.

image

5. Test your NPC

Press F10 to hop in editor and see if it all works. You should be able to interact with and greet your new NPC!

image

Back to top


Quests

Here is a selection of simple quest types you can create in Voxile. See The Action Editor: Advanced Applications for more sophisticated scripting patterns and techniques.

Setters and checkers

Please note that all quests will require the creation of two actions. A 'setter', which will set the conditions of the quest, and a 'checker', which will check if the quest objective has been fulfilled. This is not official engine terminology, but will help me to explain how to make quests in the action editor.

Back to top


Build

Any old bozo can make a quest about killing something or blowing something up, let's make something a little more subtle. This quest can be used to get the player to place/build an object in the game world.

1. Create the 'setter'

Add a new action, which will be our 'setter'. You may notice in the Effects box of our first action that Activate Next has appeared. This is automatic and means that the 'effect' of completing the first action is to activate the subsequent action in the list. Right now, this is what we want.

image

In Prompt have your player ask for a quest. In Response say that your NPC wants an item to be build in the world. I have opted for a chair. Write a name for your quest in the Summary box, which will display in the player's quest log.

image

2. Create the 'checker'

Add your second action, which will be our 'checker'. In Prompt, announce that the player has built/placed the item. In Response, have the NPC remark on this. If it doesn't matter where in the world the object is placed, select the condition RequireItem in Conditions. Click Replace Item and use the search feature to select your quest object (make sure it can actually be placed in the world). Make sure that the Where option is set to World. You may disregard step 3.

image

If you would like to designate a specific location for your object, use the condition CountItemInRegion in Conditions. Use the Replace Item button to find your quest item and type a sensible name for your region in the RegionTag box. I have called mine 'reg_chair'.

image

3. Make the region

Build an area for your object to go. Next, using the GroupSelect tool on your hotbar (the colored cubes in the box), make a selection including all the space inside your quest area. I find the best way to do this is to hold shift and click on opposing corners. This draws a selection cube covering the entire area.

image

Navigate to the FIND | REGIONS tab and click New Trigger Region.

image

This will take you to the PROPERTIES tab of our new region. Type the region tag designated in the quest action in step 2 into the Tag box.

image

4. Test your quest

Press F10 to play your level, talk to your NPC and see if you can live out the fantasy of building furniture for someone (note you may need to reset the NPC quest state in the PROPERTIES tab of your NPC).

Back to top


Destroy

Sometimes you've just gotta make your brutal mark on the world. Let's destroy something!

1. Create the 'setter'

Add a new action, which will be our 'setter'. You may notice in the Effects box of our first action that Activate Next has appeared. This is automatic and means that the 'effect' of completing the first action is to activate the subsequent action in the list. Right now, this is what we want.

image

In Prompt have your player ask for a quest. In Response say that your NPC wants something destroyed. I've used a wooden crate for this - because what's a video game without wooden crates?

image

2. Create the 'checker'

Add your second action, which will be our 'checker'. In Prompt, have the player say that the object has been destroyed. In Response, have the NPC confirm this fact. Add a condition by clicking the small + icon in the Conditions box and select RequireItem. Use the Replace Item button to search for your quest object and select it. Change the Where setting to Destroyed.

image

3. Place your quest object.

Using the LOAD or INVENTORY tab, find your quest object and place it in the world.

image

5. Test your quest

Press F10 and test your new quest. (note you may need to reset the NPC quest state in the PROPERTIES tab of your NPC).

Back to top


Dialogue

Words. Sometimes they good, sometimes they not good - but they always important. Let's make a quest where the player has to speak to another NPC.

1. Create the 'setter'

Add a new action to the template and, in Prompt, have the player ask for a quest. In Response, have your NPC tell the player to talk to someone else. Write the quest objective in Summary.

image

You may notice in the Effects box of our first action that Activate Next has appeared. This is automatic and means that the 'effect' of completing the first action is to activate the subsequent action in the list. Right now, this is what we want.

2. Create the 'checker'

Add a second action and in Prompt have the player tell the NPC that the other character has been spoken to. Write your NPC's reply in Response. Click the + icon in the Effects box and select Give XP. It's usually a good idea to make sure that the player receives some XP for finishing a quest.

image

Make sure that the preceding action does not automatically generate the effect ActivateNext. We want to activate this action when the player has spoken to the quest NPC. If it has, click the Op button and then the - button at the top of the list to delete the effect.

image

3. Create the quest NPC and dialogue

Make another NPC and attach an action template to them. If you have forgotten how, check the basics section at the top of this page.

  1. Create a new action and in Prompt write your player's quest dialogue.
  2. In Response, write your NPC's reply.
  3. In Summary update the quest log to show the updated objective.
  4. Click on the + icon in Effects and add an Activate effect. Paste the Action ID of your first NPC's 'checker'. This will activate it and allow the quest to be completable.
  5. Lastly, under Activation, make sure that Activated at NPC spawn is unchecked. This will ensure that this dialogue will only be available after the player initiates the quest.

image

4. Activate the quest dialogue

Back in our first NPC's action template, add Activate to the Effects box in our 'setter'. Paste the Action ID of our second NPC's dialogue into the box. This means that the effect of completing this dialogue, is that the dialogue in our other character is activated.

image

5. Test your quest

Press F10 to hop into the world and see if you can talk to both NPCs. Make sure you can't break the order of the dialogue! (note you may need to reset the NPCs quest state in the PROPERTIES tab of your NPCs).

Back to top


Elimination

Let's get our hands dirty! This type of quest will require the player to eliminate a certain number of enemies. As before, we will need to make two actions; a 'setter' (to set the quest parameters) and a 'checker' (to check their completion).

1. Create the 'setter'

Add a new action to the template and, in Prompt, have the player ask for a quest. In Response, have your NPC tell the player to kill some enemies. Write the quest objective in Summary.

image

You may notice in the Effects box of our first action that Activate Next has appeared. This is automatic and means that the 'effect' of completing the first action is to activate the subsequent action in the list. Right now, this is what we want.

image

2. Create the 'checker'

Add a second action and write what your player will say when the quest is completed in Prompt. Write your NPC's reply in Response.
Add a condition by clicking the small + icon in the Conditions box and select RequireWorldChange. Then set the Change to Kill all monsters. This will now allow us to check whether certain enemies are still alive.

image

3. Add the monsters to your level

We can't kill monsters if we don't have any monsters to begin with. Navigate to the Load | Entities tab and select your monsters of choice. I have chosen slimes because they are fun to squish.

I have also placed them in a small room so they cannot see me when I am speaking to Sam.
N.B. If you wish to have the enemies only spawn in after the quest is initiated, please consult the relevant chapter in The Action Editor: Advanced Applications.

image

4. Tag the enemies

In order to make these enemies quest relevant, we need to tag them with the Action ID of the 'setter'. This will ensure that the quest (and quest log) will track them appropriately. Paste this into the Action ID box of each relevant enemy.

imageimage

5. Test your quest

Press F10 to hop into the world and see if you really can slaughter those enemies for XP (note you may need to reset the NPC quest state in the PROPERTIES tab of your NPC).

Back to top


Exploration

It's a big world out there. Well, medium-sized - but still packed with secrets to uncover! Let's send the player to visit a location.

1. Create the 'setter'

Add a new action to the template and, in Prompt, have the player ask for a quest. In Response, have your NPC tell the player to visit a location. Write the quest objective in Summary.

image

You may notice in the Effects box of our first action that Activate Next has appeared. This is automatic and means that the 'effect' of completing the first action is to activate the subsequent action in the list. Right now, this is what we want.

image

2. Create the 'checker'

Add a second action and write what your player will say when the quest is completed in Prompt. Write your NPC's reply in Response. Click the + icon in the Effects box and select Give XP. It's usually a good idea to make sure that the player receives some XP for finishing a quest.

image

3. Set the trigger action

This quest will require the use of the Trigger Host in the Action Hosts list. Select it in the ACTIONS tab and add a new action by clicking the Add Action button in the bottom left. Give it a name relative to the quest, I have opted for Complete Explore Quest.
Next in the Effects tab, click on the + button and add the action Activate. In ID, paste the ID of the 'checker' from earlier. Make sure to uncheck Activated at Level Start.
The reason we do this is so the quest cannot be completed out of order, and the location will 'wait' to be activated by the quest.

image

Back in the 'checker' we made earlier, add a condition by clicking on the + button in the Conditions box and select RequireTrigger. in Tag, paste the tag of the Trigger Host action, and set the count to 1. This action now requires the location to be visited exactly once before this dialogue becomes available.

image

4. Build the location

Build the location you will send the player to. Next, using the GroupSelect tool on your hotbar (the colored cubes in the box), make a selection including all the space inside your quest area. I find the best way to do this is to hold shift and click on opposing corners. This draws a selection cube covering the entire area.

image

Navigate to the FIND | REGIONS tab and click New Trigger Region.

image

This will take you to the PROPERTIES tab of our new region. Type a sensible name in Tag (to keep things tidy), and paste the Action ID of the Trigger Host into Enter Action ID. This means that when the player 'enters' the region, the trigger will activate and allow the quest to be completed.

image

5. Test your quest

Press F10 to hop in game and see if you are able to be sent on a pointless wander. (note you may need to reset the NPC quest state in the PROPERTIES tab of your NPC).

Back to top


Fetch

A staple of video-games since the 1990s, the humble fetch quest is the backbone of many a great story. Let's make one.

1. Create the 'setter'

Add a new action, which will be our 'setter'. You may notice in the Effects box of our first action that Activate Next has appeared. This is automatic and means that the 'effect' of completing the first action is to activate the subsequent action in the list. Right now, this is what we want.

image

In Prompt have your player ask for a quest. In Response say that your NPC needs an in-game item of your own choosing. I have chosen Sausage Pizza because I am hungry as I write this tutorial. Write a name for your quest in the Summary box, which will display in the player's quest log.

image

2. Create the 'checker'

Add your second action, which will be our 'checker'. In Prompt, announce that the player has found the item. In Response, have the NPC remark on this.

Now in the box labelled Conditions, click the small + icon and find RequireItem from the dropdown list. This will bring up the scripting to allow you to require a specific item to continue. Click Replace Item and either select your item from the list, or search for it by clicking Search….

image

3. Add the quest item

For this quest to be completable, we need an instance of the quest item for the player to find in the world. Let's do this simply by placing a chest next to the NPC containing the item.

Select the LOAD tab and type 'chest' into the search box. Select wood_4_chest_small_basic and place it in the world. Then, using the Properties tool, select the chest, click Add Item…, and add your quest item to the chest.

image

4. Test your quest

Now press F10, and play your thrilling new fetch quest! (note you may need to reset the NPC quest state in the PROPERTIES tab of your NPC).

Back to top


Follow

The follow quest gets a bad rap, but when used sparingly - they can really adhere a player to a character or a place. Forget the haters, let's make a follow quest.

1. Create the 'setter'

Add a new action, which will be our 'setter'. You may notice in the Effects box of our first action that Activate Next has appeared. This is automatic and means that the 'effect' of completing the first action is to activate the subsequent action in the list. Right now, this is what we want.

image

In Prompt have your player ask for a quest. In Response say that your NPC wants to take you somewhere. Type your quest objective into Summary. In Effects, add the effect NPCAnim and select the anim Lead Player to Marker.

image

2. Create the 'checker'

Add a second action and have the player remark on their new location. Click the + icon in the Effects box and select Give XP. It's usually a good idea to make sure that the player receives some XP for finishing a quest.

image

3. Build the quest location

Now we need somewhere to go! I've built a small house to show the player.

image

Now, head to the LOAD | ENTITIES tab and add a quest marker to your inventory.

image

Place the quest marker on the location you want the NPC to move to. Using the Properties tool, select your quest marker and set the Action ID to be the same as your 'setter' from before.

image

4. Test your quest

Press F10 to jump into testing mode and see if your NPC will lead the player to the quest location. (note you may need to reset the NPC quest state in the PROPERTIES tab of your NPC).

Back to top