How to Create a Quest Action
Quest actions are where the magic happens. You will use actions to put into motion everything a quest can do. This can range from simply talking to an NPC all the way to Getting an Item and Exp reward. All actions are triggered by the action tag followed by the actual action call. The most frequently used actions in a quest are "AddNpcText" and "AddNpcInput". You will use these to create your quest dialogs. In some quest states you will find that you may talk to more than 1 NPC character at a time. This is where your skills as a writer will come in handy!
To create your first dialog, use the "action" tag, followed by "AddNpcText(npc quest id, "message");
It is very important to pay attention to the punctuation here. If you leave out a " or the ; at the end things could go terribly wrong. Your dialog may not even be displayed. Here is how an added dialog would look:
State Begin
{
desc "Talk to Jessica"
action AddNpcText(13, "Hello, as you can see I live peacefully with the blobsies in the wonderful sky, then one day the wolfman and the foxes got into a fight and all the foxes moved to here");
}
State TalkToWolfLeader
{
desc "Talk to the Wolf Leader"
action AddNpcText(13, "Go talk to the wolfman first im sure he's willing to compromise so we can all live in peace again.");
action AddNpcText( 14, "Hello there, i see Jessica sent you, what do you want?");
}
As you can see, the TalkToWolfLeader state actually has Jessica's second dialog, as well as the first dialog from the Wolfman. Once the quest state has moved to the TalkToWolfLeader state, Jessica will always instruct players to talk to the Wolf Leader.
Now for adding some interaction via the dialog window. AddNpcInput works just like AddNpcText except it needs a link value to direct what happens when a link is clicked. The action call works like this: AddNpcInput(NPC Quest ID, Input ID, "message");
The Input ID is up to you, but you should keep it ordered beginning with 1. (0 is not used as a link as the quest engine reserves 0 for cancel). Lets add some input links:
State Begin
{
desc "Talk to Jessica"
action AddNpcText(13, "Hello, as you can see I live peacefully with the blobsies in the wonderful sky, then one day the wolfman and the foxes got into a fight and all the foxes moved to here");
}
State TalkToWolfLeader
{
desc "Talk to the Wolf Leader"
action AddNpcText(13, "Go talk to the wolfman first im sure he's willing to compromise so we can all live in peace again.");
action AddNpcText( 14, "Hello there, i see Jessica sent you, what do you want?");
action AddNpcInput( 14, 1, "I come in peace");
action AddNpcInput( 14, 2, "Nothing, bye");
}
There are many more actions that can be added into a quest state similar to these. I will cover those later in this guide.
Making Quest Goals
Every quest state must have a method of being satisfied so that it can move on to the next state. The tag used to define these goals is called "rule". A rule has a basic structure: rule tag, rule type, and goto state. The most basic rule is TalkedToNpc(Npc Quest ID). Lets add this to our begin state:
State Begin
{
desc "Talk to Jessica"
action AddNpcText(13, "Hello, as you can see I live peacefully with the blobsies in the wonderful sky, then one day the wolfman and the foxes got into a fight and all the foxes moved to here");
rule TalkedToNpc(13) goto TalkToWolfLeader
}
State TalkToWolfLeader
{
desc "Talk to the Wolf Leader"
action AddNpcText(13, "Go talk to the wolfman first im sure he's willing to compromise so we can all live in peace again.");
action AddNpcText( 14, "Hello there, i see Jessica sent you, what do you want?");
action AddNpcInput( 14, 1, "I come in peace");
action AddNpcInput( 14, 2, "Nothing, bye");
}
As you can see, all that is required to move from the "Begin" state to the "TalkToWolfLeader" state is that a player must have simply opened the dialog window with Jessica.
Rules can also be used to determine what the Input Link will do next. The rule "InputNpc(Input ID)" will help us handle links. Now lets add a rule for clicking a link and a new state to go to:
State Begin
{
desc "Talk to Jessica"
action AddNpcText(13, "Hello, as you can see I live peacefully with the blobsies in the wonderful sky, then one day the wolfman and the foxes got into a fight and all the foxes moved to here");
rule TalkedToNpc(13) goto TalkToWolfLeader
}
State TalkToWolfLeader
{
desc "Talk to the Wolf Leader"
action AddNpcText(13, "Go talk to the wolfman first im sure he's willing to compromise so we can all live in peace again.");
action AddNpcText( 14, "Hello there, i see Jessica sent you, what do you want?");
action AddNpcInput( 14, 1, "I come in peace");
action AddNpcInput( 14, 2, "Nothing, bye");
rule InputNpc(1) goto GetBirdFeathers
}
State GetBirdFeathers
{
desc "Find 10 bird feathers"
action AddNpcText( 14, "We are currently at war with the birdmans on the other mountain. I am currently too busy to talk about peace with the foxes.");
action AddNpcText( 14, "You know i hate those annoying birdmans, if you help us fight the birdmans and bring me 10 bird feathers I will think about your offer." );
}
State GiveFeathers
{
desc "Give 10 bird feathers"
action AddNpcText(14, "Hi again, i can see you have been fighting with the birdmans, your help is greatly appreciated!");
action AddNpcText(14, "Will you give me those bird feathers?");
action AddNpcInput(14, 2, "Ok, here you are");
action AddNpcInput(14, 1, "No, these are mine");
rule InputNpc(2) goto TalkToJessica
}
Some Quests will have requirements such as gathering items in this one. Two rules are used here. GotItems is used to check your items for your Quest progress, and LostItems checks your items to see if you lost any of your required items before moving on to a new state. GotItems should be used to forward to the next state, while LostItems will be used to backtrack to the old state should you lose any items along the way. Both contain two values (Item ID, Amount). This is how they should look when added:
State Begin
{
desc "Talk to Jessica"
action AddNpcText(13, "Hello, as you can see I live peacefully with the blobsies in the wonderful sky, then one day the wolfman and the foxes got into a fight and all the foxes moved to here");
rule TalkedToNpc(13) goto TalkToWolfLeader
}
State TalkToWolfLeader
{
desc "Talk to the Wolf Leader"
action AddNpcText(13, "Go talk to the wolfman first im sure he's willing to compromise so we can all live in peace again.");
action AddNpcText( 14, "Hello there, i see Jessica sent you, what do you want?");
action AddNpcInput( 14, 1, "I come in peace");
action AddNpcInput( 14, 2, "Nothing, bye");
rule InputNpc(1) goto GetBirdFeathers
}
State GetBirdFeathers
{
desc "Find 10 bird feathers"
action AddNpcText( 14, "We are currently at war with the birdmans on the other mountain. I am currently too busy to talk about peace with the foxes.");
action AddNpcText( 14, "You know i hate those annoying birdmans, if you help us fight the birdmans and bring me 10 bird feathers I will think about your offer." );
rule GotItems(299,10) goto GiveFeathers
}
State GiveFeathers
{
desc "Give 10 bird feathers"
action AddNpcText(14, "Hi again, i can see you have been fighting with the birdmans, your help is greatly appreciated!");
action AddNpcText(14, "Will you give me those bird feathers?");
action AddNpcInput(14, 2, "Ok, here you are");
action AddNpcInput(14, 1, "No, these are mine");
rule InputNpc(2) goto TalkToJessica
rule LostItems(299,10) goto GetBirdFeathers
}
Apollo's Step by Step Quest for Beginners
Ok, now with a little bit of understanding of the EO+ layout I will make a quest from scratch. I will use 2 Npc's for this as well: Wise Man and Pig Farmer. Next, I will make a flow chart for this quest.
Talk to Wiseman
Kill 5 rats
Return to Wiseman
Step on a tile
Return to Wiseman
Collect 5 Penguin Meat
Return to Wiseman
Talk to Pig Farmer
Return to Wiseman
Kill another player in pk
Return to Wiseman/Open Class Menu
Change Class
Wow, that's a lot to do. Shouldn't take very long to make though. First, I will add the header and make an empty state for each:
Main
{
questname "Wiseman Quest"
version 1
}
State Begin
{
}
State KillRats
{
}
State Wiseman1
{
}
State TileStep
{
}
State Wiseman2
{
}
State GetPenguinMeat
{
}
State Wiseman3
{
}
State TalkToPigFarmer
{
}
State Wiseman4
{
}
State KillPlayer
{
}
State ClassMenu
{
}
State Priest
{
}
State Magician
{
}
State Rogue
{
}
State Archer
{
}
State Warrior
{
}
Next, I will add description tags where needed:
Main
{
questname "Wiseman Quest"
version 1
}
State Begin
{
}
State KillRats
{
desc "Kill 5 Rats"
}
State Wiseman1
{
desc "Talk to Wiseman"
}
State TileStep
{
desc "Check the Boat Door"
}
State Wiseman2
{
desc "Talk to Wiseman"
}
State GetPenguinMeat
{
desc "Find 5 Penguin Meat"
}
State Wiseman3
{
desc "Talk to Wiseman"
}
State TalkToPigFarmer
{
desc "Talk to Pig Farmer"
}
State Wiseman4
{
desc "Talk to Wiseman"
}
State KillPlayer
{
desc "Kill 1 Player in PK"
}
State ClassMenu
{
desc "Talk to Wiseman"
}
State Priest
{
}
State Magician
{
}
State Rogue
{
}
State Archer
{
}
State Warrior
{
}
That was easy, now for some dialog:
Main
{
questname "Wiseman Quest"
version 1
}
State Begin
{
action AddNpcText(4, "Hellow there, I am tired of changing classes for just anyone");
}
State KillRats
{
desc "Kill 5 Rats"
action AddNpcText(4, "Prove you aren't lazy, Kill 5 Rats.");
}
State Wiseman1
{
desc "Talk to Wiseman"
action AddNpcText(4, "Ok, but I have a request of you");
}
State TileStep
{
desc "Check the Boat Door"
action AddNpcText(4, "Check that boat that sails to Newb Land to ensure the door to the captain's chamber is locked");
}
State Wiseman2
{
desc "Talk to Wiseman"
action AddNpcText(4, "Good, now I am hungry. Go fetch about 5 Penguin meat for my dinner");
}
State GetPenguinMeat
{
desc "Find 5 Penguin Meat"
}
State Wiseman3
{
desc "Talk to Wiseman"
action AddNpcText(4, "Did you get 5 penguin meat?");
}
State TalkToPigFarmer
{
desc "Talk to Pig Farmer"
action AddNpcText(4, "Invite the Pig Farmer to Town Square to share this meal with me");
action AddNpcText(24, "Wiseman, eh? Tell that old fart I am fat enough. I will pass");
}
State Wiseman4
{
desc "Talk to Wiseman"
action AddNpcText(4, "He refused? How rude! Go take out my anger on another player");
}
State KillPlayer
{
desc "Kill 1 Player in PK"
}
State ClassMenu
{
desc "Talk to Wiseman"
action AddNpcText(4, "You look like you could use a class change. What class would you like?");
}
State Priest
{
}
State Magician
{
}
State Rogue
{
}
State Archer
{
}
State Warrior
{
}
Looking good, now for some rules:
Main
{
questname "Wiseman Quest"
version 1
}
State Begin
{
action AddNpcText(4, "Hellow there, I am tired of changing classes for just anyone");
rule TalkedToNpc(4) goto KillRats
}
State KillRats
{
desc "Kill 5 Rats"
action AddNpcText(4, "Prove you aren't lazy, Kill 5 Rats.");
rule KilledNpcs(2, 5) goto Wiseman1
}
State Wiseman1
{
desc "Talk to Wiseman"
action AddNpcText(4, "Ok, but I have a request of you");
rule TalkedToNpc(4) goto TileStep
}
State TileStep
{
desc "Check the Boat Door"
action AddNpcText(4, "Check that boat that sails to Newb Land to ensure the door to the captain's chamber is locked");
rule EnterCoord(1,6,21) goto Wiseman2
}
State Wiseman2
{
desc "Talk to Wiseman"
action AddNpcText(4, "Good, now I am hungry. Go fetch about 5 Penguin meat for my dinner");
rule TalkedToNpc(4) goto GetPenguinMeat
}
State GetPenguinMeat
{
desc "Find 5 Penguin Meat"
rule GotItems(259,5) goto Wiseman 3
}
State Wiseman3
{
desc "Talk to Wiseman"
action AddNpcText(4, "Did you get 5 penquin meat?");
rule LostItems(259,5) goto Wiseman2
rule TalkedToNpc(4) goto TalkToPigFarmer
}
State TalkToPigFarmer
{
desc "Talk to Pig Farmer"
action AddNpcText(4, "Invite the Pig Farmer to Town Square to share this meal with me");
action AddNpcText(24, "Wiseman, eh? Tell that old fart I am fat enough. I will pass");
rule TalkedToNpc(24) goto Wiseman4
}
State Wiseman4
{
desc "Talk to Wiseman"
action AddNpcText(4, "He refused? How rude! Go take out my anger on another player");
rule TalkedToNpc(4) goto KillPlayer
}
State KillPlayer
{
desc "Kill 1 Player in PK"
rule KilledPlayers(1) goto ClassMenu
}
State ClassMenu
{
desc "Talk to Wiseman"
action AddNpcText(4, "You look like you could use a class change. What class would you like?");
action AddNpcInput(2, "Priest");
action AddNpcInput(3, "Magician");
action AddNpcInput(4, "Rogue");
action AddNpcInput(5, "Archer");
action AddNpcInput(6, "Warrior");
rule InputNpc(2) goto Priest
rule InputNpc(3) goto Magician
rule InputNpc(4) goto Rogue
rule InputNpc(5) goto Archer
rule InputNpc(6) goto Warrior
}
State Priest
{
}
State Magician
{
}
State Rogue
{
}
State Archer
{
}
State Warrior
{
}
And now to add classes and loop back to the wiseman class menu ftw!
Main
{
questname "Wiseman Quest"
version 1
}
State Begin
{
action AddNpcText(4, "Hellow there, I am tired of changing classes for just anyone");
rule TalkedToNpc(4) goto KillRats
}
State KillRats
{
desc "Kill 5 Rats"
action AddNpcText(4, "Prove you aren't lazy, Kill 5 Rats.");
rule KilledNpcs(2, 5) goto Wiseman1
}
State Wiseman1
{
desc "Talk to Wiseman"
action AddNpcText(4, "Ok, but I have a request of you");
rule TalkedToNpc(4) goto TileStep
}
State TileStep
{
desc "Check the Boat Door"
action AddNpcText(4, "Check that boat that sails to Newb Land to ensure the door to the captain's chamber is locked");
rule EnterCoord(1,6,21) goto Wiseman2
}
State Wiseman2
{
desc "Talk to Wiseman"
action ShowHint("Door is locked! Check back with Wiseman");
action AddNpcText(4, "Good, now I am hungry. Go fetch about 5 Penguin meat for my dinner");
rule TalkedToNpc(4) goto GetPenguinMeat
}
State GetPenguinMeat
{
desc "Find 5 Penguin Meat"
rule GotItems(259,5) goto Wiseman 3
}
State Wiseman3
{
desc "Talk to Wiseman"
action AddNpcText(4, "Did you get 5 penquin meat?");
rule LostItems(259,5) goto Wiseman2
rule TalkedToNpc(4) goto TalkToPigFarmer
}
State TalkToPigFarmer
{
desc "Talk to Pig Farmer"
action AddNpcText(4, "Invite the Pig Farmer to Town Square to share this meal with me");
action AddNpcText(24, "Wiseman, eh? Tell that old fart I am fat enough. I will pass");
rule TalkedToNpc(24) goto Wiseman4
}
State Wiseman4
{
desc "Talk to Wiseman"
action AddNpcText(4, "He refused? How rude! Go take out my anger on another player");
rule TalkedToNpc(4) goto KillPlayer
}
State KillPlayer
{
desc "Kill 1 Player in PK"
rule KilledPlayers(1) goto ClassMenu
}
State ClassMenu
{
desc "Talk to Wiseman"
action AddNpcText(4, "You look like you could use a class change. What class would you like?");
action AddNpcInput(4, 2, "Priest");
action AddNpcInput(4, 3, "Magician");
action AddNpcInput(4, 4, "Rogue");
action AddNpcInput(4, 5, "Archer");
action AddNpcInput(4, 6, "Warrior");
rule InputNpc(2) goto Priest
rule InputNpc(3) goto Magician
rule InputNpc(4) goto Rogue
rule InputNpc(5) goto Archer
rule InputNpc(6) goto Warrior
}
State Priest
{
action SetClass(2);
action SetState("ClassMenu");
}
State Magician
{
action SetClass(3);
action SetState("ClassMenu");
}
State Rogue
{
action SetClass(4);
action SetState("ClassMenu");
}
State Archer
{
action SetClass(5);
action SetState("ClassMenu");
}
State Warrior
{
action SetClass(6);
action SetState("ClassMenu");
}
And that is basically a step by step for how to make quests. Please refer to the EO+ Syntax Dictionary for a complete list of actions and rules that can be used in the EO+ Quest System.