Larian Banner
Previous Thread
Next Thread
Print Thread
Joined: Aug 2014
K
apprentice
OP Offline
apprentice
K
Joined: Aug 2014
1) PROC, what does it do, and how do i used it? If you could give me a simple example, it would be great.

2) I need to add painting textures(i think)to my mod, i cannot paint the area as i want. And i cannot seem to find "sea" anywhere. So i can fill a lake for example.

3) Also, i found out that i need to extract the "Alignments" file to my mod, so that all characters can act accordinly in each others presence. This is done though.

So, my question is, is there any list that displays all the files(important or not) i need to extract?? Like the "alignments" file?

4) How do i add quests to the journal? I can create dialogs, and given some conditions, i can give rewards to the players, but that is not enough ^^ I tried to use the QuestAdd() command, but i couldnt figure it out!

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

Last edited by Kolopaper; 02/09/14 05:35 PM.
Joined: Jul 2014
R
addict
Offline
addict
R
Joined: Jul 2014
I can only help with some of these questions.

1) PROCs are basically like user defined functions. Parameters can be passed to them and they can be called upon by any other part of the Story (ie within the same or other scripts included in the mod). They can even be used recursively by calling themselves if a condition is met.

Code
PROC
ProcGivePartyExperience((INTEGER)_exp, (INTEGER)_counter)
AND
IntegerSubtract(_counter, 1, _nextCounter)
AND
_nextCounter > 0
THEN
PartyAddExperience(_exp);
ProcGivePartyExperience(_exp, _nextCounter);

IF
CharacterUnlockedTalent(_, "LoneWolf")
THEN
ProcGivePartyExperience(500, 10);



4) I'm not completely sure about adding quests to journals, but most likely you will need an entry in the Localization (TranslatedStringKeys) file that has the description of each entry for the quest. I think (if I'm remembering correctly) that story scripts use something like QuestAddEntry("questName", "questDescriptionKey"), where "questName" is a unique name for the quest and questDescriptionKey is a Key within the Localization file that points to what the actual text to display in-game is.

Joined: Aug 2014
K
apprentice
OP Offline
apprentice
K
Joined: Aug 2014
So proc is a function, something i pretty much hated always! I guess i can never be rid of them.

As far as 4) is conserned, i will have to look more into it, with the info you gave me. You have been helpfull, thank you.

Joined: Jul 2014
journeyman
Offline
journeyman
Joined: Jul 2014
Quote
2) I need to add painting textures(i think)to my mod, i cannot paint the area as i want. And i cannot seem to find "sea" anywhere. So i can fill a lake for example.


for adding terrain I'll redirect you to my tut:
http://www.larian.com/forums/ubbthreads.php?ubb=showflat&Number=548306#Post548306

Joined: Jun 2013
old hand
Offline
old hand
Joined: Jun 2013
Originally Posted by Kolopaper


2) I need to add painting textures(i think)to my mod, i cannot paint the area as i want. And i cannot seem to find "sea" anywhere. So i can fill a lake for example.



Look in root templates instead of the resource manager. There you can find rivers and seas that move.

Joined: Sep 2014
M
apprentice
Offline
apprentice
M
Joined: Sep 2014
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.

Joined: Aug 2014
K
apprentice
OP Offline
apprentice
K
Joined: Aug 2014
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.
Joined: Sep 2014
M
apprentice
Offline
apprentice
M
Joined: Sep 2014
Thanks! This was very useful. I put a link to it on the wiki at
http://www.divinityengine.net/index.php?title=List_of_tutorials

Joined: Sep 2014
S
stranger
Offline
stranger
S
Joined: Sep 2014
After some trial/error and math I think I've worked out how the XP rewards work:

Act & Gain must both be specified to reward XP.
Act is the quest level (i.e. expected character level), between 1 - 19
Gain is how hard/involved the quest is, between 1 - 10

The XP rewarded is a % of the amount of XP to progress from the expected level (as set in Act) to the next level. Gain of 1 = 1.5% of needed XP, gain of 10 (the highest possible) is 15%.

So, act 1, gain 1 = 30 XP (1.5% of the 2000XP needed for level 2). Act 1, gain 10 = 300 XP (15% of 2000). Act 2, gain 1 = 90 XP (1.5% of the 6000XP needed to get from 1 to 2), etc.

Weird feature: if you use gain 11 you get MILLIONS of negative XP, but if you go to gain 12-20 it gives negative XP roughly corresponding to 1-10. The main campaign never does this, so it may just be an unintended side-effect of their calculation algorithm.

BTW - each time I changed quest_prototypes.lsx I had to completely reload my module for it to read it, reloading level or building story had no effect. Does anyone know if there's a way to get the editor to re-read the lsx/lsb files?

Last edited by svansted; 15/09/14 08:29 AM.
Joined: Aug 2014
K
apprentice
OP Offline
apprentice
K
Joined: Aug 2014
Good to know how Act and Gain work, nice work! Unfortunatelly, i do not know the answer to your question. I reload the mod too if i need something to work. That applies for txt files as well.


Link Copied to Clipboard
Powered by UBB.threads™ PHP Forum Software 7.7.5