For those of you wondering what we do exactly, I'd like to show you some of the actual code that we use.
This is a script that is generated for us using the tools (DBE) the developers made for Content Design. In this case, I'm making a very basic hailing script for the NPC in Vault of Heroes name "Marjok".
Code: Select all
--[[
Script Name : Spawns/VaultofHeroes/Marjok.lua
Script Purpose : Marjok
Script Author : Jakkal
Script Date : 2017/01/12
Script Notes : Auto-Generated Conversation from PacketParser Data
Quests : Treasure? (5167)
--]]
local greeting = nil
-- Local variables go here
local Treasure? = 5167
function spawn(Npc)
ProvidesQuest(Npc, Treasure?)
CompletesQuest(Npc, Treasure?)
end
function hailed(Npc, Player)
FaceTarget(Npc, Player)
--[[
-- Set up Greeting
--]]
-- Set the generic greeting for this character
greeting = "Welcome to New Telon"
-- Adjust the Greeting as needed during quest progress
--[[
-- Create the Conversation
--]]
conversation = CreateConversation(Npc, Player) -- only need 1 conversation per dialog
StartConversation(conversation, greeting)
--[[
-- Add conversation options (dialog)
--]]
--[[
-- Add Quest options
--]]
-- First handle quests originating elsewhere
if QuestCurrent(Player, Treasure?) then
AddQuestOption(conversation, Player, Treasure?, "Treasure?")
end
-- Now offer/update quests originating here
-- Even if a quest does not finish here, it needs to be a quest option that shows the summary
-- So we want to show quests that the character is eligible for, or currently working on
if QuestEligible(Player, Treasure?) or QuestCurrent(Player, Treasure?) then
AddQuestOption(conversation, Player, Treasure?, "Treasure?")
end
-- Additional quests originating/updating here
--[[
-- Add Diplomacy options
--]]
--[[
-- Start the Conversation
--]]
OpenDialog(conversation, Player)
end
--[[
-- Conversation/Dialog Branching
--]]
--[[
-- Quest Branching
--]]
--[[
-- Diplomacy Branching
--]]
function Treasure?(Npc, Player)
FaceTarget(Npc, Player)
DisplayQuest(Player, Treasure?)
end
function Treasure?(Npc, Player)
FaceTarget(Npc, Player)
DisplayQuest(Player, Treasure?)
end
function dlg_3819_0(Npc, Player)
FaceTarget(Npc, Player)
conversation = CreateConversation(Npc, Player)
StartConversation(conversation, 'Marjok says, "Cleansing the Vault of Heroes of it\'s desecrators is our goal, but for now, we gather our strength and harry at them as we can."')
--AddConversationOption(conversation, 'insert text', "some_function")
--AddQuestOption(conversation, Player, Quest, "some_function")
OpenDialog(conversation, Player)
end
function dlg_3819_1(Npc, Player)
FaceTarget(Npc, Player)
conversation = CreateConversation(Npc, Player)
StartConversation(conversation, 'Marjok says, "For Tahean, we fight the filth that infests the Vault of Heroes, and in Tahean\'s name, we shall drive them out."')
--AddConversationOption(conversation, 'insert text', "some_function")
--AddQuestOption(conversation, Player, Quest, "some_function")
OpenDialog(conversation, Player)
end
function dlg_3819_2(Npc, Player)
FaceTarget(Npc, Player)
conversation = CreateConversation(Npc, Player)
StartConversation(conversation, 'Marjok says, "Tahean was one of the final defenders of the Vault of Heroes. We will be his vengeance, and his avengers."')
--AddConversationOption(conversation, 'insert text', "some_function")
--AddQuestOption(conversation, Player, Quest, "some_function")
OpenDialog(conversation, Player)
end
function dlg_3819_3(Npc, Player)
FaceTarget(Npc, Player)
conversation = CreateConversation(Npc, Player)
StartConversation(conversation, 'Marjok says, "The land itself is a weapon that we can use to fight for Tahean. Every advantage must be exploited in order to remove the gnolls from our ancestor\'s burial grounds."')
--AddConversationOption(conversation, 'insert text', "some_function")
--AddQuestOption(conversation, Player, Quest, "some_function")
OpenDialog(conversation, Player)
end
function dlg_3819_4(Npc, Player)
FaceTarget(Npc, Player)
conversation = CreateConversation(Npc, Player)
StartConversation(conversation, 'Marjok says, "The spirit of Tahean fights by our side, and with his strength, the gnolls cannot stand against us."')
--AddConversationOption(conversation, 'insert text', "some_function")
--AddQuestOption(conversation, Player, Quest, "some_function")
OpenDialog(conversation, Player)
end
function dlg_3819_5(Npc, Player)
FaceTarget(Npc, Player)
conversation = CreateConversation(Npc, Player)
StartConversation(conversation, 'Marjok says, "We will drive the filthy gnolls from the Vault of Heroes and take back the legacy of our ancestors. In Tahean\'s name, we will strike them down and make this lake run red with their blood."')
--AddConversationOption(conversation, 'insert text', "some_function")
--AddQuestOption(conversation, Player, Quest, "some_function")
OpenDialog(conversation, Player)
end
function dlg_3819_6(Npc, Player)
FaceTarget(Npc, Player)
conversation = CreateConversation(Npc, Player)
StartConversation(conversation, 'Marjok says, "Where Tahean fought we shall fight, and the gnolls shall wish they had never entered the Vault of Heroes."')
--AddConversationOption(conversation, 'insert text', "some_function")
--AddQuestOption(conversation, Player, Quest, "some_function")
OpenDialog(conversation, Player)
end
--[[ raw_dialog_headers
ID: 3819, Text: Marjok says, "Cleansing the Vault of Heroes of it's desecrators is our goal, but for now, we gather our strength and harry at them as we can.", Log: 53
ID: 3819, Text: Marjok says, "For Tahean, we fight the filth that infests the Vault of Heroes, and in Tahean's name, we shall drive them out.", Log: 53
ID: 3819, Text: Marjok says, "Tahean was one of the final defenders of the Vault of Heroes. We will be his vengeance, and his avengers.", Log: 53
ID: 3819, Text: Marjok says, "The land itself is a weapon that we can use to fight for Tahean. Every advantage must be exploited in order to remove the gnolls from our ancestor's burial grounds.", Log: 53
ID: 3819, Text: Marjok says, "The spirit of Tahean fights by our side, and with his strength, the gnolls cannot stand against us.", Log: 53
ID: 3819, Text: Marjok says, "We will drive the filthy gnolls from the Vault of Heroes and take back the legacy of our ancestors. In Tahean's name, we will strike them down and make this lake run red with their blood.", Log: 53
ID: 3819, Text: Marjok says, "Where Tahean fought we shall fight, and the gnolls shall wish they had never entered the Vault of Heroes.", Log: 53
--]]
--[[ raw_quest_dialog_text
Quest ID: 5167, State: 1, Name: Treasure?, Log: 53
Text :"I was out for a swim in the lake a few days ago when I caught sight of a chest. I planned on swimming down to it to see what was inside, but a mutated fish swam at me and scared me off!"
"I remember the general location of where I saw the chest. I'll make you a deal: I send you to where the general location of the chest is, and you swim down to it and get its contents. Whatever you find in there, we split between us."
"Do we have a deal?"
Summary :Search around the area marked in your journal for the Lost Chest. Once you find it, loot its contents and return to Marjok in Tahean's Vengeance.
Note :
Goals : Lost Chest Contents (0/1)
Quest ID: 5167, State: 0, Name: Treasure?, Log: 53
Text :"I was out for a swim in the lake a few days ago when I caught sight of a chest. I planned on swimming down to it to see what was inside, but a mutated fish swam at me and scared me off!"
"I remember the general location of where I saw the chest. I'll make you a deal: I send you to where the general location of the chest is, and you swim down to it and get its contents. Whatever you find in there, we split between us."
"Do we have a deal?"
Summary :Search around the area marked in your journal for the Lost Chest. Once you find it, loot its contents and return to Marjok in Tahean's Vengeance.
Note :
Goals : Lost Chest Contents (0/1)
--]]
Now, as a Content Designer, it's our job to set this up for use in the actual game. First things first, Quests cannot have special characters in them, but the DBE generates quest code based on the quest name. So it's our job to find and remove it. It's also not a good idea to have a quest with a single word name, like "Treasure". So any Single-Word-Name quests need to be renamed to have more than one word in it. We typically do a Quest_ format for most quests just so it's easier to understand the code.
Line 15:
Needs to become:
Next, on line 32, it's set up the very basic greeting. If we hailed her like this, she would simply say "Welcome to New Telon." But if you scroll down to the bottom of her script, you see she has actual lines of dialogue.
If she only had one line of dialogue, all we would have to do is change line 32 from:
to
Code: Select all
greeting = 'Marjok says, "Cleansing the Vault of Heroes of it's desecrators is our goal, but for now, we gather our strength and harry at them as we can."'
Unfortunately, she has several lines of dialogue, so we do this:
Code: Select all
choice = math.random(1, 6)
local greeting
if choice == 1 then
greeting = 'Marjok says, "Cleansing the Vault of Heroes of it\'s desecrators is our goal, but for now, we gather our strength and harry at them as we can."'
elseif choice == 2 then
greeting = 'Marjok says, "Tahean was one of the final defenders of the Vault of Heroes. We will be his vengeance, and his avengers."'
elseif choice == 3 then
greeting = 'Marjok says, "The land itself is a weapon that we can use to fight for Tahean. Every advantage must be exploited in order to remove the gnolls from our ancestor\'s burial grounds."'
elseif choice == 4 then
greeting = 'Marjok says, "The spirit of Tahean fights by our side, and with his strength, the gnolls cannot stand against us."'
elseif choice == 5 then
greeting = 'Marjok says, "We will drive the filthy gnolls from the Vault of Heroes and take back the legacy of our ancestors. In Tahean\'s name, we will strike them down and make this lake run red with their blood."'
else
greeting = 'Marjok says, "Where Tahean fought we shall fight, and the gnolls shall wish they had never entered the Vault of Heroes."'
end
So in line 43: StartConversation will call the "greeting" function, and it will then pick one of those lines randomly when hailed.
Now the other things we have to change in this script are almost all the references to "Treasure?" to "Quest_Treasure".
For Example:
Code: Select all
if QuestCurrent(Player, Treasure?) then
AddQuestOption(conversation, Player, Treasure?, "Treasure?")
end
becomes:
Code: Select all
if QuestCurrent(Player, Quest_Treasure) then
AddQuestOption(conversation, Player, Quest_Treasure, "QuestTreasure")
end
Notice the one in Quotes there doesn't have the _. That's a function call and it needs to be different from the Quest name. Which matters down at the bottom where you see:
Code: Select all
function Treasure?(Npc, Player)
FaceTarget(Npc, Player)
DisplayQuest(Player, Treasure?)
end
Which becomes:
Code: Select all
function QuestTreasure(Npc, Player)
FaceTarget(Npc, Player)
DisplayQuest(Player, Quest_Treasure)
end
Also that's listed twice so we can remove the extra one. In the end, the script will look like this:
Code: Select all
--[[
Script Name : Spawns/VaultofHeroes/Marjok.lua
Script Purpose : Marjok
Script Author : Jakkal
Script Date : 2016/08/20
Script Notes : Auto-Generated Conversation from PacketParser Data
Quests : Quest_Treasure (5167)
--]]
local greeting = nil
-- Local variables go here
local Quest_Treasure = 5167
function spawn(Npc)
ProvidesQuest(Npc, Quest_Treasure)
CompletesQuest(Npc, Quest_Treasure)
end
function hailed(Npc, Player)
FaceTarget(Npc, Player)
--[[
-- Set up Greeting
--]]
choice = math.random(1, 6)
local greeting
if choice == 1 then
greeting = 'Marjok says, "Cleansing the Vault of Heroes of it\'s desecrators is our goal, but for now, we gather our strength and harry at them as we can."'
elseif choice == 2 then
greeting = 'Marjok says, "Tahean was one of the final defenders of the Vault of Heroes. We will be his vengeance, and his avengers."'
elseif choice == 3 then
greeting = 'Marjok says, "The land itself is a weapon that we can use to fight for Tahean. Every advantage must be exploited in order to remove the gnolls from our ancestor\'s burial grounds."'
elseif choice == 4 then
greeting = 'Marjok says, "The spirit of Tahean fights by our side, and with his strength, the gnolls cannot stand against us."'
elseif choice == 5 then
greeting = 'Marjok says, "We will drive the filthy gnolls from the Vault of Heroes and take back the legacy of our ancestors. In Tahean\'s name, we will strike them down and make this lake run red with their blood."'
else
greeting = 'Marjok says, "Where Tahean fought we shall fight, and the gnolls shall wish they had never entered the Vault of Heroes."'
end
conversation = CreateConversation(Npc, Player) -- only need 1 conversation per dialog
StartConversation(conversation, greeting)
--[[
-- Add conversation options (dialog)
--]]
--[[
-- Add Quest options
--]]
-- First handle quests originating elsewhere
if QuestCurrent(Player, Quest_Treasure) then
AddQuestOption(conversation, Player, Quest_Treasure, "QuestTreasure")
end
-- Now offer/update quests originating here
-- Even if a quest does not finish here, it needs to be a quest option that shows the summary
-- So we want to show quests that the character is eligible for, or currently working on
if QuestEligible(Player, Quest_Treasure) or QuestCurrent(Player, Quest_Treasure) then
AddQuestOption(conversation, Player, Quest_Treasure, "QuestTreasure")
end
-- Additional quests originating/updating here
--[[
-- Add Diplomacy options
--]]
--[[
-- Start the Conversation
--]]
OpenDialog(conversation, Player)
end
--[[
-- Conversation/Dialog Branching
--]]
--[[
-- Quest Branching
--]]
--[[
-- Diplomacy Branching
--]]
function QuestTreasure(Npc, Player)
FaceTarget(Npc, Player)
DisplayQuest(Player, Quest_Treasure)
end
function dlg_3819_0(Npc, Player)
FaceTarget(Npc, Player)
conversation = CreateConversation(Npc, Player)
StartConversation(conversation, 'Marjok says, "Cleansing the Vault of Heroes of it\'s desecrators is our goal, but for now, we gather our strength and harry at them as we can."')
--AddConversationOption(conversation, 'insert text', "some_function")
--AddQuestOption(conversation, Player, Quest, "some_function")
OpenDialog(conversation, Player)
end
function dlg_3819_1(Npc, Player)
FaceTarget(Npc, Player)
conversation = CreateConversation(Npc, Player)
StartConversation(conversation, 'Marjok says, "For Tahean, we fight the filth that infests the Vault of Heroes, and in Tahean\'s name, we shall drive them out."')
--AddConversationOption(conversation, 'insert text', "some_function")
--AddQuestOption(conversation, Player, Quest, "some_function")
OpenDialog(conversation, Player)
end
function dlg_3819_2(Npc, Player)
FaceTarget(Npc, Player)
conversation = CreateConversation(Npc, Player)
StartConversation(conversation, 'Marjok says, "Tahean was one of the final defenders of the Vault of Heroes. We will be his vengeance, and his avengers."')
--AddConversationOption(conversation, 'insert text', "some_function")
--AddQuestOption(conversation, Player, Quest, "some_function")
OpenDialog(conversation, Player)
end
function dlg_3819_3(Npc, Player)
FaceTarget(Npc, Player)
conversation = CreateConversation(Npc, Player)
StartConversation(conversation, 'Marjok says, "The land itself is a weapon that we can use to fight for Tahean. Every advantage must be exploited in order to remove the gnolls from our ancestor\'s burial grounds."')
--AddConversationOption(conversation, 'insert text', "some_function")
--AddQuestOption(conversation, Player, Quest, "some_function")
OpenDialog(conversation, Player)
end
function dlg_3819_4(Npc, Player)
FaceTarget(Npc, Player)
conversation = CreateConversation(Npc, Player)
StartConversation(conversation, 'Marjok says, "The spirit of Tahean fights by our side, and with his strength, the gnolls cannot stand against us."')
--AddConversationOption(conversation, 'insert text', "some_function")
--AddQuestOption(conversation, Player, Quest, "some_function")
OpenDialog(conversation, Player)
end
function dlg_3819_5(Npc, Player)
FaceTarget(Npc, Player)
conversation = CreateConversation(Npc, Player)
StartConversation(conversation, 'Marjok says, "We will drive the filthy gnolls from the Vault of Heroes and take back the legacy of our ancestors. In Tahean\'s name, we will strike them down and make this lake run red with their blood."')
--AddConversationOption(conversation, 'insert text', "some_function")
--AddQuestOption(conversation, Player, Quest, "some_function")
OpenDialog(conversation, Player)
end
function dlg_3819_6(Npc, Player)
FaceTarget(Npc, Player)
conversation = CreateConversation(Npc, Player)
StartConversation(conversation, 'Marjok says, "Where Tahean fought we shall fight, and the gnolls shall wish they had never entered the Vault of Heroes."')
--AddConversationOption(conversation, 'insert text', "some_function")
--AddQuestOption(conversation, Player, Quest, "some_function")
OpenDialog(conversation, Player)
end
--[[ raw_dialog_headers
ID: 3819, Text: Marjok says, "Cleansing the Vault of Heroes of it's desecrators is our goal, but for now, we gather our strength and harry at them as we can.", Log: 53
ID: 3819, Text: Marjok says, "For Tahean, we fight the filth that infests the Vault of Heroes, and in Tahean's name, we shall drive them out.", Log: 53
ID: 3819, Text: Marjok says, "Tahean was one of the final defenders of the Vault of Heroes. We will be his vengeance, and his avengers.", Log: 53
ID: 3819, Text: Marjok says, "The land itself is a weapon that we can use to fight for Tahean. Every advantage must be exploited in order to remove the gnolls from our ancestor's burial grounds.", Log: 53
ID: 3819, Text: Marjok says, "The spirit of Tahean fights by our side, and with his strength, the gnolls cannot stand against us.", Log: 53
ID: 3819, Text: Marjok says, "We will drive the filthy gnolls from the Vault of Heroes and take back the legacy of our ancestors. In Tahean's name, we will strike them down and make this lake run red with their blood.", Log: 53
ID: 3819, Text: Marjok says, "Where Tahean fought we shall fight, and the gnolls shall wish they had never entered the Vault of Heroes.", Log: 53
--]]
--[[ raw_quest_dialog_text
Quest ID: 5167, State: 1, Name: Quest_Treasure, Log: 53
Text :"I was out for a swim in the lake a few days ago when I caught sight of a chest. I planned on swimming down to it to see what was inside, but a mutated fish swam at me and scared me off!"
"I remember the general location of where I saw the chest. I'll make you a deal: I send you to where the general location of the chest is, and you swim down to it and get its contents. Whatever you find in there, we split between us."
"Do we have a deal?"
Summary :Search around the area marked in your journal for the Lost Chest. Once you find it, loot its contents and return to Marjok in Tahean's Vengeance.
Note :
Goals : Lost Chest Contents (0/1)
Quest ID: 5167, State: 0, Name: Quest_Treasure, Log: 53
Text :"I was out for a swim in the lake a few days ago when I caught sight of a chest. I planned on swimming down to it to see what was inside, but a mutated fish swam at me and scared me off!"
"I remember the general location of where I saw the chest. I'll make you a deal: I send you to where the general location of the chest is, and you swim down to it and get its contents. Whatever you find in there, we split between us."
"Do we have a deal?"
Summary :Search around the area marked in your journal for the Lost Chest. Once you find it, loot its contents and return to Marjok in Tahean's Vengeance.
Note :
Goals : Lost Chest Contents (0/1)
--]]
And if you can follow that, and perform the actions I performed, you can be a Content Designer.