The process of designing and publishing quests requires the use of Microsoft Visual Studio along with completing the prerequisite process for downloading and unpacking SWLOR from the GitHub page. More info on this process can be found here.
When creating a quest, quest definitions should be placed under Feature/QuestDefinition in Visual Studio.
Quests are organized by planet, both for world quests and by craft for guild quest. The example depicted below is for CZ-220, but the process is the same no matter the planet:
```csharp
private static void SuppliesSmithery(QuestBuilder builder)
{
// Create a new quest entry. Set the unique ID to cz220_smithery. Set the name of the quest (viewable by the player) to CZ-220 Supplies - Smithery
builder.Create("cz220_smithery", "CZ-220 Supplies - Smithery")
// Adds a new state. Think of this like a "stage" of the quest.
.AddState()
// Sets the journal text for this state of the quest
.SetStateJournalText("The Crafting Terminal Droid operator has requested you create a single Basic Knife. You will need to purchase the \"One-Handed Blueprints\" perk in order to create this item. Once you have the perk you can use any smithery terminal to make the item. You will find the necessary resources down on the maintenance level of CZ-220.")
// Identifies that the objective of this state is to collect an item with the resref "b_knife" and only one is required.
.AddCollectItemObjective("b_knife", 1)
// Adds a second state to the quest.
.AddState()
// Updates the journal text for the new objective. Because there are only two states in this quest, it is considered complete once this state has been finished.
.SetStateJournalText("Speak to the Crafting Terminal Droid operator for your reward.")
// Identifies the XP and Gold rewards for the quest. The player will get 200 XP and 50 Gold (aka Credits) for completion
.AddXPReward(200)
.AddGoldReward(50)
// Identifies the key item reward for the quest. The player will receive a key item for the completion of this quest.
// Note: Key items are basically "flags" on a player. These items only appear in the Key Items menu
.AddKeyItemReward(KeyItemType.CraftingTerminalDroidOperatorsWorkReceipt)
// The following is custom logic run when the player accepts the quest. This is optional but can be helpful for giving temporary key items, sending a message, or whatever.
// In this case, we're giving a temporary key item to the player.
.OnAcceptAction((player, sourceObject) =>
{
KeyItem.GiveKeyItem(player, KeyItemType.CraftingTerminalDroidOperatorsWorkOrder);
})
// The following is custom logic run when the player abandons the quest. This is optional but can be helpful for removing temporary key items, sending a message, or whatever.
// In this case, we're removing a temporary key item from the player.
.OnAbandonAction(player =>
{
KeyItem.RemoveKeyItem(player, KeyItemType.CraftingTerminalDroidOperatorsWorkOrder);
})
// The following is custom logic run when the player completes the quest. This is optional but can be helpful for removing temporary key items, sending a message, or whatever.
// In this case, we're removing a temporary key item from the player.
.OnCompleteAction((player, sourceObject) =>
{
KeyItem.RemoveKeyItem(player, KeyItemType.CraftingTerminalDroidOperatorsWorkOrder);
});
}```
The above example is the aforementioned quest definition which contains comments for each line explaining the code.
Quest states are generally progressed using a combination of snippets and local variables snip it information can be found here.
Quest dialogue is created using the Aurora tool set. The example below illustrates this:
The text notes are in order from latest quest state to earliest quest date in this particular instance. The topmost dialogue is what is shown to the player after they have completed the quest. The bottom most dialogue node is shown if none of the higher conditions are met; in essence, the player is not eligible for this quest. In this example, cr_t_d_operator is the name of this conversation and it should be used as a reference in most cases. Since this particular quest is a fetch quest, the NPC quest-giver is looking for a specific item. The item the NPC is looking for will be based on the resref of the item.
Another type of quest example is a common “kill x enemies” quest as shown below:
private static void MynockMayhem(QuestBuilder builder)
{
builder.Create("mynock_mayhem", "Mynock Mayhem")
.AddState()
.SetStateJournalText("Halron Linth wants you to head down to the maintenance level and kill some unwanted Mynocks. Cull back their numbers, obtain their teeth and return to him for your receipt. He has requested five of them.")
.AddKillObjective(NPCGroupType.CZ220_Mynocks, 5)
.AddState()
.SetStateJournalText("You've killed five Mynocks and obtained their teeth. Return to Halron Linth to collect your work receipt.")
.AddXPReward(200)
.AddGoldReward(100)
.AddKeyItemReward(KeyItemType.HalronLinthsWorkReceipt);
}
This example is very similar to the last quest but instead of a “Collect Item” objective, this example uses a “Kill Objective” instead. In the above example, we're looking for an NPC Group Type of “CZ220_Mynocks”. If you go to the definition for this, it'll show the following:
All of the existing NPCs should be present here already, but if you're adding a new one, you'll need to give it a unique ID at the end.
In Aurora the following example depicts assigned variables which shows NPC groups:
This window can be accessed by right clicking the NPC, selecting properties, then selecting variables. In this example, there are four variables assigned: the first three are for loot tables, while the last one is to identify the group the NPC is associated with. For quest generation, the loot table variables will generally be ignored. The last one, QUEST_NPC_GROUP_ID
is the one we care about and needs to be set/added. The type should be int
and the value should be the number assigned in NPCGroupType.cs. In the example above, Mynocks are assigned to ID 1.
As a result, anytime this creature dies, the quest system will automatically check to see if the player is on any quests which require them to kill said creature. As soon as the required amount hit zero, the player is progressed to the next stage of the quest. All other processes for quest creation is the same as a fetch item quest. The quest can immediately be finished from that point, or the player can be made to go talk to the NPC quest giver.
The final type of quest involves exploration. This can involve traveling to an area or clicking an object, so it will either be a trigger or a placeable you're interacting with.
There are currently two prefabs which are already made. These can be placed in the module and the instance can be edited:
On both of these, you'll see three variables:
QUEST_MESSAGE |
This is the message displayed when the object is clicked and the quest advances. Leave it blank and only the quest & journal update will show. |
QUEST_ID |
This is the Id assigned earlier in the quest definition. |
QUEST_STATE |
This is the state the player must be on for this object to be active. |
In summary,