I had this quest where I wanted to add the initial quest upon updating it. The update could happen under many circumstances and I didn't want to do QuestAdd() every single instance I'm updating it. This also goes in hand with letting the character forge his own path and discover quests in a less linear fashion. I wanted to share my story script solution.


There's a bunch of comments to explain how to use it.
If you don't know how the journal system works, check out the tutorial on the divinity wiki.
*EDIT EDIT*
Removed wrong edit
Code
//To use the automatic add/update of the journal, simply define the two databases with the definitions (See below for example)
//Throw an event (For now only from dialogues, I will add item used,kills,triggers etc... later) and define that event in the databases 
//DB_JournalAdd(EventFlag,QuestID,0)
//DB_JournalUpdate(EventFlag,QuestID,UpdateID,0)
//Make sure you add the nodes in the quest_prototypes.lsx with the proper QuestID and UpdateID.
//Make sure you add the proper content from the Keys in the translated strings.
//
//                   Flag used from events                    QUESTID               ALWAYS put this to 0       
//DB_JournalAdd("Aeril_MM_KnowAboutMagicalModification","Aeril_MagicalModification",0);
//                                                                            UPDATEID
//DB_JournalUpdate("Aeril_MM_NegativeWheatFarmer","Aeril_MagicalModification","Update1",0);
//

//BEGIN General journal add/update logic

IF
	DialogCharacterEventSet(_Flag,_Character,_DialogInstance)
THEN
	ProcCheckFlagJournalAddUpdate(_Flag);

IF
	GlobalEventSet(_Flag)
THEN
	ProcCheckFlagJournalAddUpdate(_Flag);
	

PROC
	ProcCheckFlagJournalAddUpdate((STRING)_Flag)
THEN
	ProcCheckFlagJournalAdd(_Flag);
	ProcCheckFlagJournalUpdate(_Flag);

PROC
	ProcCheckFlagJournalAdd((STRING)_Flag)
AND
	DB_JournalAdd(_Flag,_QuestID,_Added)
AND
	_Added == 0
THEN
	ProcJournalAdd(_Flag,_QuestID,_Added);

PROC
	ProcCheckFlagJournalUpdate((STRING)_Flag)
AND
	DB_JournalUpdate(_Flag,_QuestID,_UpdateID,_Updated)
AND
	DB_JournalAdd(_AFlag,_QuestID,_Added)
AND
	_Added == 0
THEN
	ProcJournalAdd(_AFlag,_QuestID,_Added);

PROC
	ProcCheckFlagJournalUpdate((STRING)_Flag)
AND
	DB_JournalUpdate(_Flag,_QuestID,_UpdateID,_Updated)
AND
	_Updated == 0
THEN
	ProcJournalUpdate(_Flag,_QuestID,_UpdateID,_Updated);

PROC
	ProcJournalAdd((STRING)_Flag,(STRING)_QuestID,(INTEGER)_Added)
THEN
	QuestAdd(_QuestID);
	NOT DB_JournalAdd(_Flag,_QuestID,_Added);
	DB_JournalAdd(_Flag,_QuestID,1);

PROC
	ProcJournalUpdate((STRING)_Flag,(STRING)_QuestID,(STRING)_UpdateID,(INTEGER)_Updated)
THEN
	QuestUpdate(_QuestID,_UpdateID);
	NOT DB_JournalUpdate(_Flag,_QuestID,_UpdateID,_Updated);
	DB_JournalUpdate(_Flag,_QuestID,_UpdateID,1);

//END General journal add/update logic





Hope this can help a few!

Last edited by TheMasterRat; 28/01/15 05:05 PM.