I
IKilledKEnny
Guest
The Quest Tutorial
I always liked quests and I have made lots of these, so I thought why not make a tutorial? Anyway I’m a little stuck in my game (only temporary…. I hope ) Anyway to keep things moving let’s go on!!
Q&A
Q: What’s a quest?
A: Quest can mean servable things in World Editor, in this tutorial quest will be referred as a mission given to the players to complete for a certain reward.
Q: Why would I want to read this?
A: Well if you are interested in creating a new quest, wondering how to do it, or just need something to read, than this is the tutorial for you!!
Q: Ok, let’s say I want to read, what should I know?
A: Basic Triggering, WC III and such, this tutorial isn’t made for ‘masters’ but to basically everyone.
Q: Huh, ok, do you want me to do anything after I read the tutorial?
A: If you have anything to comment please post it here, but please keep whatever you want to say in pleasant way. Hope you enjoy the tutorial, or at least learn something from it!
Q: Anything else I should know before going on?
A: Yes English is second language of mine, I do use "Word" and distinary so should be a readable tutorial.
Preparing the Quest
Ok first we want to decide what kind of quest we want. Let’s choose an optional quest, which means you can do the quest, but it’s not your main goal. Usually we would also suggest a reward so players would want to complete this quest so let’s say the reward is 500 gold. Now we need to decide few things as what will be object of the quest, and how would players get it. Let’s say once a player’s unit enters region the player would get the quest, and quest’s object is to kill 25 rabbits. Now lastly we want to add a little theme to the mission so we would create a short movie.
Now let’s create a special effect over our quest giver’s head so players would know he can give them quests.
Code:
Quest 1 0 SE
Events
Time - Elapsed game time is 0.00 seconds
Conditions
Actions
Special Effect - Create a special effect attached to the overhead of <<Unit>> using Abilities\Spells\Other\TalkToMe\TalkToMe.mdl
The Quest Itself
Variables needed:
3 Boleans (QuestBoleen) (QuestCompleteBoleen) (QuestRepeatBoleen) All with array = number of players
Integer (QusetInteger) With array = number of players.
Code:
Quest 1 1 Get
Events
Unit - A unit enters <<Region>> <gen>
Conditions
QuestBoleen[(Player number of (Owner of (Entering unit)))] Equal to False
QuestCompleteBoleen[(Player number of (Owner of (Entering unit)))] Equal to False
QuestRepeatBoleen[(Player number of (Owner of (Entering unit)))] Equal to False
Actions
Special Effect - Destroy (Last created special effect)
Cinematic - Turn cinematic mode On for (Player group((Owner of (Entering unit))))
Cinematic - Turn on letterbox mode (hide interface) for (Player group((Owner of (Entering unit)))): fade out over 2.00 seconds
Cinematic - Disable user control for (Player group((Owner of (Entering unit))))
Cinematic - Clear the screen of text messages for (Player group((Owner of (Entering unit))))
Cinematic - Turn subtitle display override On
Cinematic - Send transmission to (Player group((Owner of (Entering unit)))) from <<Unit> <gen> named <<Name>>: Play <<Sound>> and display <<Text>>. Modify duration: Add 15.00 seconds and Wait
Cinematic - Turn subtitle display override Off
Cinematic - Clear the screen of text messages for (Player group((Owner of (Entering unit))))
Cinematic - Enable user control for (Player group((Owner of (Entering unit))))
Cinematic - Turn off letterbox mode (show interface) for (Player group((Owner of (Entering unit)))): fade in over 2.00 seconds
Cinematic - Turn cinematic mode Off for (Player group((Owner of (Entering unit))))
Set QuestBoleen[(Player number of (Owner of (Entering unit)))] = True
Set QuestRepeatBoleen[(Player number of (Owner of (Entering unit)))] = True
Quest - Create a Optional quest titled <<Title>> with the description <<Description>>, using icon path <<Icon>>
Ok you should understand what I did here, I’ll just put here in a more organized way:
When a unit enters region than we check if all boleans equal to false. QuestBoleen is the bolean that will represent the quest flow, thus if the players is trying to complete the quest. QuestCompleteBoleen is to check if we finished the quest already, we didn’t so it needs to be false. QusetRepeatBoleen checks that we didn’t do the quest already.
If all those boleans are equal to false than we destroy the special effect we created on the unit, play a cinematic movie to the player that owns the entering unit and set QuestBoleen to true (we are trying now to complete the quest) and QuestRepeatBoleen to true (we Triggered the quest already!!)
Lastly we create a quest in the quest frame for player to check.
Code:
Quest 1 2 Flow
Events
Unit - A unit Dies
Conditions
(Unit-type of (Dying unit)) Equal to Rabbit
QuestBoleen[(Player number of (Owner of (Killing unit)))] Equal to True
Actions
Set QuestInteger[(Player number of (Owner of (Killing unit)))] = (QuestInteger[(Player number of (Owner of (Killing unit)))] + 1)
Game - Display to (Player group((Owner of (Killing unit)))) the text: ((You killed + (String(QuestInteger[(Player number of (Owner of (Killing unit)))]))) + Out of 25 rabbits)
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
QuestInteger[(Player number of (Owner of (Killing unit)))] Equal to 25
Then - Actions
Set QuestBoleen[(Player number of (Owner of (Killing unit)))] = False
Set QuestCompleteBoleen[(Player number of (Owner of (Picked unit)))] = True
Special Effect - Create a special effect attached to the overhead of <<Unit>> using Abilities\Spells\Other\TalkToMe\TalkToMe.mdl
Quest - Mark (Last created quest) as Completed
Else - Actions
Do nothing
Ok what we did he is this; whenever a rabbit dies and the players that owns the killing unit already met the quest giver guy than add +1 to the QuestInteger and than tell the player how many rabbits he killed. Now if QuestInteger is equal to 25 (the number of rabbits we need to kill) than we set QuestCompleteBoleen to true, mark the quest as completed and set QuestBoleen to false (we stopped attempting to finish the quest).
Complete the Quest
Code:
Quest 1 3 Complete
Events
Unit - A unit enters <<Region>> <gen>
Conditions
QuestBoleen[(Player number of (Owner of (Entering unit)))] Equal to False
QuestCompleteBoleen[(Player number of (Owner of (Entering unit)))] Equal to True
Actions
Special Effect - Destroy (Last created special effect)
Cinematic - Turn cinematic mode On for (Player group((Owner of (Entering unit))))
Cinematic - Turn on letterbox mode (hide interface) for (Player group((Owner of (Entering unit)))): fade out over 2.00 seconds
Cinematic - Disable user control for (Player group((Owner of (Entering unit))))
Cinematic - Clear the screen of text messages for (Player group((Owner of (Entering unit))))
Cinematic - Turn subtitle display override On
Cinematic - Send transmission to (Player group((Owner of (Entering unit)))) from <<Unit>> <gen> named <<Name>>: Play <<Sound>> and display <<Text>>. Modify duration: Add 15.00 seconds and Wait
Cinematic - Turn subtitle display override Off
Cinematic - Clear the screen of text messages for (Player group((Owner of (Entering unit))))
Cinematic - Enable user control for (Player group((Owner of (Entering unit))))
Cinematic - Turn off letterbox mode (show interface) for (Player group((Owner of (Entering unit)))): fade in over 2.00 seconds
Cinematic - Turn cinematic mode Off for (Player group((Owner of (Entering unit))))
Set QuestCompleteBoleen[(Player number of (Owner of (Entering unit)))] = False
Player - Add 500 to (Owner of (Entering unit)) Current gold
Quest - Destroy (Last created quest)
Ok, this is the last Trigger, in this one we give the final cinema, add the player 500 gold and remove the quest from quest panel. The most important thing that we changed is the fact that we changed to condition QuestCompleteBoleen = False to QuestCompleteBoleen = True
Last Words
You can do so many things with quests, I just showed I very basic example on how to make one quest in a clean way, nothing special, if you are interested in making quests (for RPG for example, or for any other game) you should follow generally after this system. Boleans are good! While they might be a little confusing they let you control the quest very cleanly with no leaks nor bugs.
I suggest making your custom quests more interesting, again this quest is very simple and pretty boring. You can create a quest where you have to guard an No Player Character (NPC) from enemy’s attacks, find a magical book and discover if it’s fake or the real one, and if it is to bring it to the wizards in the high tower and stuff like that, use you imagination!!
Here is a quick guide on how to create a good quest:
A. Pick a general theme and goal to the quest.
B. Make it a little more colorful using chat massages cinematic movies, special effects and many more things I didn’t add to the tutorial in order to keep it simple.
C. Makes the quest challenging by adding obstacles and enemies that would do whatever they can to stop you from finishing the quest.
D. Decide how would players get and complete the quest and add it to the Triggers.
I hope you liked my short tutorial (second of mine), I would love to hear feedback, questions, comments and what not?
(P.S. For D&D players; Just a little tip you can think about WC III quests just like a D&D quest, what would you like to see in D&D quest? How would you like it to look like and such, and than just program it to your pleasure!!)