Originally Posted by mander
Originally Posted by Kolopaper

Ok i found out how to add a quest, i had to take a look from another post!


Could you explain what you did or point me to the post where you figured it out? It will be useful for me and future people who come across this post looking for the answer.


I will get back at you some hours later, as i am currently buzy and need to leave. So if you see this, prior to my edit, check back again sometime.

Ok how to actually add a quest! You will need a file from the Main. The file is named "quest_prototypes.lsx" which can be found here "\Mods\Main\Story\Journal" (if you already know about this file you can skip the next part)


Copy that file, to the location of your mod here, "\Mods\YourModName\Story\Journal"

I use notepad++ for easy editing. On that file you can delete everything, since all quests of the main game are there, so you can have an empty page for your mod. Here are the lines that you need to add for a quest.
-----

<?xml version="1.0" encoding="UTF-8" ?>
<save>
<region id="Quests">
<node id="root">
<children>

<node id ="Quest">
<attribute id="QuestID" value="ClearDivinity" type="22"/>
<attribute id="MainQuest" value="1" type="19"/>
<attribute id="QuestTitle" value="ClearDivinity_Title" type="22"/>
<children>
<node id ="QuestState">
<attribute id="Status" value="Update1" type="22"/>
<attribute id="Description" value="ClearDivinity1" type="22"/>
<attribute id="Rewards" value="" type="22"/>
<attribute id="Marker" value="" type="22"/>
<attribute id="Achievement" value="quest1" type="22"/>
<attribute id="Act" value="" type="4"/>
<attribute id="Gain" value="" type="4"/>
<attribute id="ReputationGain" value="" type="4"/>
</node>
</children>

</node>



</children>
</node>

</region>

</save>

-------------

Now as you see, Save,Region(quests), Node(root) and Children that are open at the start, they close at the end. These are essential for all quests, just add them and don't edit them at all. Among these lines is every quest.

Which means, the Bold part, is the part where you have to copy paste for every quest you need to create. There are a few things you need to take notice of here

Node id = "Quest" opens your quest.
Quest Id, value = "cleardivinity", is my name for my quest.(ID) Which will be used in the editor, to make the quest available.

Quest Title - ClearDivinity_Title, is where the title in the journal goes, you will see how below.

Now you notice the Node Id="QuestState", this shows where your quest is. It has a value of "Update1".

The Description, has a value of "ClearDivinity1", which shows what the journal says. Again you will see how, below.

All these values i mentioned are your primary conserns and you can name them with anything that helps you.

------------
Now for the actual Scripting within the editor

This particular quest, actually is available when i talk to someone, and it asks me to take care of a few undead. So, assuming, you know how to make a dialoge work, this is how i made it:

When i talk to a specific person named Erza, i set a global flag with this command.

ACTION SetFlag("cleardivinity",1)

Now on the story editor i have this:

IF
GlobalEventSet("cleardivinity")

THEN
QuestAdd("ClearDivinity");
QuestUpdate("ClearDivinity","Update1");
PartyAddGold(500);
PartyAddExperience(500);

Which basically says, when my flag "ClearDivinity" becomes True(1), then i add the Quest with value "ClearDivinity", and it immediatly updates the quest to "Update1". If you see the values i have set above, you will understand. Also as you can see, i have added some gold and XP for my party when i get that quest. Just for fun ^^

----------
Now the last thing you need to do, is to make the journal show you the exact descriptions that you want.

Open up the TranslatedStringKey.

There you type, on the Key section, the values of:

1) ClearDivinity_Title
2) ClearDivinity1

Then, on the box right of each, write the description.

So for 1), i have typed Clear Divinity, so the quest title on the Journal is "Clear Divinity"

And for 2, i have typed the description of the quest, which tells me to clear a few undead.


I have stopped the quest there for now. But if for example, after you kill some undead, you want the quest to continue, and the journal to keep writing stuff, you need to copy paste this part, as "Update2", right below the "Update1" node, so it looks like this


<node id ="QuestState">
<attribute id="Status" value="Update1" type="22"/>
<attribute id="Description" value="ClearDivinity1" type="22"/>
<attribute id="Rewards" value="" type="22"/>
<attribute id="Marker" value="" type="22"/>
<attribute id="Achievement" value="quest1" type="22"/>
<attribute id="Act" value="" type="4"/>
<attribute id="Gain" value="" type="4"/>
<attribute id="ReputationGain" value="" type="4"/>
</node>


<node id ="QuestState">
<attribute id="Status" value="Update2" type="22"/>
<attribute id="Description" value="ClearDivinity2" type="22"/>
<attribute id="Rewards" value="" type="22"/>
<attribute id="Marker" value="" type="22"/>
<attribute id="Achievement" value="quest1" type="22"/>
<attribute id="Act" value="" type="4"/>
<attribute id="Gain" value="" type="4"/>
<attribute id="ReputationGain" value="" type="4"/>
</node>


and so on... be very carefull when opening things like <node>, children etc etc, make one small mistake and the quest will not work, i spent 2 hours fixing those small mistakes at first ^^

After you put your Update2, you need within the Editor a way to update the quest to "Update2".

So when you kill the undead, and talk back to the same person for example, in the editor it must have something like

IF
blah blah blah
THEN
QuestUpdate("cleardivinity","Update2");

Lastly, you need to add more on the TranslatedStringKey, as done for Update1, you need to add the description using the "Cleardivinity2" value.

Last command you want to use, in order to close that quest once and for all, is the QuestClose command. Which can be done in the Story editor, or even in the ACTION section of a dialog.

And remember, anything that goes in " " , can have any name.

I hope it's understandable! Once you manage to create one quest, it gets easier

Last edited by Kolopaper; 08/09/14 03:09 PM.