Help with Story Phases, please!

+
NayAva said:
The quest id can not be in the last sentence in this case. The npc speaks it. ^^
You're right - this needs a [continue] line, which can be QIDded. Editing.
 
OK, two weeks later I'm still stuck at the same place.I have a quest;
I have a dialogue.
The quest has a starting condition
Code:
Dialog line chosen "By all the gods girl, what are you doing..."
It has the right tag, and that line occurs in the dialogue. However, the quest also has on the 'On Phase Completed' property of the 'Quest Beginning' phase, a script which does the following:
Code:
void main(){	PrintString( "bvmain quest started");}
That line never gets printed. Furthermore, later in the same dialogue there is a line "I'll take you.". It, too, is a quest line, and the second phase of the quest (that is, the phase immediately after "Quest Beginning") has as its only 'Completing Condition'
Code:
Dialog line chosen "I'll take you."
This line never becomes available in the dialogue: the NPC never says the line that leads to it.So...The quest engine must be running, and must know about the quest, otherwise it couldn't block the "I'll take you" line.In which case, why doesn't it move on to the second phase when the "By all the gods girl, what are you doing..." line is chosen?Trying to debug this I changed the starting condition to start when the hero had 1 gold - which he has - but still the quest doesn't start.One clue is that I get the following in the log, but I don't know what it means:
Code:
bvhela_suicide.dlg: Invalid quest tag specified for reply EMPTY - tag: bv_qi_hela_ghtp
- the node "I'll take you" definitely does have the tag 'bv_qi_hela_ghtp'.In the conversation m1_cn_deirdre01.dlg in Price of Neutrality, every node leading up to a 'starred' Quest node has 'Conv Type' set to 'Quest', but has no 'Quest Id' value. The starred Quest nodes do have values for their 'Quest Id' property - and the dialogue owner node immediately after a starred 'Quest' tag has 'Conv Type' set to 'Dialog'. My conversation has the two starred nodes essentially on the same branch - and I haven't seen a way around that yet. However, for debugging, I experimentally reorganised it so they were on separate branches, with 'Dialog' nodes following them - and now you can't select either of them! You can only select nodes which lead towards a link node - and when you get to the link node, if the link leads to a branch of conversation which leads only to a starred node, the dialogue ceases.In the conversation in Price of Neutrality there are a few 'Accompanying' nodes. I infer from context that these are for when the user decides not to take a quest - but in any case, when I experimentally added one to my conversation it wasn't available either.Again looking back at the Price of Neutrality conversation, its first starred Quest node, "I can look around for some" (the node that kicks of the "hungry as a wolf" quest) has the Quest Id 'm1_q02 QS1 "Hungry as a wolf"'. The name of the quest file is 'm1_q02_food.qst' but the quest doesn't appear to have a tag. So it doesn't appear to be the case that the 'm1_q02' part of the Quest Id is a quest tag (although I could be wrong here). When you play the module, the branch leading to "I can look around for some" is available immediately, and there are no error messages of the form 'Invalid quest tag specified for reply EMPTY '.The Quests chapter doesn't say there's any special or magic formatting to Quest ID values.So I simply don't know what I'm doing wrong here and would hugely appreciate help - because this problem is a total blocker. If we can't clear it, we're stuck.
 
REDFlame will be launching a quest tutorial shortly showing the many different approaches to creating a more complex quest. I will edit this post as soon as it's complete, which should be within a few hours. :)
 
Following PM communication with Vaernus, I'm now making progress.What it boils down to is this: 'Quest' dialogue lines don't work very well - or are very hard to make work. So you have to code around this for yourself.Scripts on the 'Action Script' properties of ordinary 'Dialog' dialogue lines can be used to achieve the same end. You use a script on the 'Action Script' property of a dialogue line to set journal entries using
Code:
AddJournalEntry( "Plot", "plot/ghtp"))
where the first argument is the journal section and the second argument is the journal entry from the journal.2da file. This certainly works when there is a real journal entry in the appropriate journal .dlg file; I haven't verified whether it works when there isn't.Vaernus recommended using the 'Hidden' journal section - I haven't tried this; but I've used a 'Plot' journal section which doesn't seem to show anywhere either, and that is working.You can then use those journal etries to fire quest phases using e.g. 'Hero has journal entry: Plot:plot/ghtp'. You can also use them in conversations by outting a condition script on dialogue lines you want to protect, such as:
Code:
int StartingConditional(){	return HasJournalEntry( "Plot", "plot/ghtp");}
(same argument semantics as before).Obviously this means there are going to be a very large number of little scripts to drive the plot, and unless you are very systematic with names you're going to get into a horrible mess.I am calling my journal setter scripts things like
Code:
bv_j_s_plotghtp
where 'bv_' stands for 'Birth and Virgins' (the title of the module); 'j_' means 'journal', 's_' means 'setter' and 'plotghtp' is a mnemonic for the journal entry tag; and my journal getter scripts things like
Code:
bv_j_g_plotghtp
where the 'g_' stands for 'getter'This isn't wonderful - it would definitely be better if I could make 'Quest' lines work as advertised - but it does work.
 
Well, by using a global variable, you could put everything into one script. I.E:
Code:
void main(){	if(GetLocalInt(GetFirstPC(), "Phase2") == 1)	{		AddJournalEntry("Blah", "The_Blah2");		SetLocalInt(GetFirstPC(), "Phase2", 0);		SetLocalInt(GetFirstPC(), "Phase3", 1);	}	if(GetLocalInt(GetFirstPC(), "Started") == 1)	{		AddJournalEntry("Blah", "The_Blah");		SetLocalInt(GetFirstPC(), "Started", 0);		SetLocalInt(GetFirstPC(), "Phase2", 1);	}}
You would need an init script to set the first Local Int, and would have to order the script so the last Phase is at top, but otherwise, this would save having many scripts and make it easier to debug if the Ints and Entries are self-explanatory.
 
Ok, guys....I mean Simon and Vaernus :)This sounds really nice, and I'm sure you know what you are doing there, but I'm still at the beginning of my scripting experience (experience points maybe 50 at this time ;D)Well, I understand a bit of that, what you are talking about... but not all.Could someone of you two please make a step by step tutorial for me and those who are as bad as me at scripting?I try to say this with the easiest words, I will find for that... you just have to tell me, if I understand it right so far:I have to make an entry in the journal.2da (Plot or Hidden, some quest ID)in the dialog line of a character I put a script in that says: AddJournalEntry("plot", "quest ID"),thats the first point where I stumble a bit, is there no need of a dialog (.dlg) file that is named "hidden" or "plot"? In the m1_modul there were the quests named "hidden", but there was no matching dlg.-file for it.! So it must work without this matching dialog-file. Am I correct at this point?ok, if not I make a matching file for this journal.2da entrys (and here still begins the horrible mess for me).I go on to make the quest : Quest Beginning: "...if hero has journal entry xyz (my quest ID), that's clear...but now I sure would be stuck, because of my little scripting knowledge...
You can then use those journal etries to fire quest phases using e.g. 'Hero has journal entry: Plot:plot/ghtp'. You can also use them in conversations by outting a condition script on dialogue lines you want to protect, such as:Code:int StartingConditional(){ return HasJournalEntry( "Plot", "plot/ghtp");}(same argument semantics as before).
here you can see that a few questionmarks appear over my head, looking like this ???and when I read more of the script that Vaernus added in his post, I'm sure I would stumble through a horrible mess and would never find a way out of this, not in the next four weeks, thats sure and also the questionmarks over my head still won't disappear... ??? ??? Not that I really would know what a global variable is... ??? :whistle:So pleeeeaase, make a step by step tutorial for loosers like me... :wave:
 
HexenmeisterRaven said:
Ok, guys....I mean Simon and Vaernus :)So pleeeeaase, make a step by step tutorial for loosers like me... :wave:
OK, my solution is still HUGELY experimental - I don't know the right way to make things work yet, but I'm working on it.I've decided that the appropriate thing to do is to put all the main plot advnacement ligic into a single include file (currently 'inc_bv_phases) for ease of maintenance, with one procedure for the start and one procedure for the end of each logical game phase, so for example:
Code:
//////////////////////////////////////////////////////////////////////////	inc_bv_phases.nss// 	Include file for things which manipulate story //	phases in Birth and Virgins.////	(c) 2008 The Medusa Collective////////////////////////////////////////////////////////////////////////string helaTag = "npct_bvhela";string szczTag = "npct_bvszczepan";// a wrapper around GetNearestObjectByTag which allows for// the fact that the object we're interested in could be OBJECT_SELF// argument tag: a string, presumed to be the tag of an NPC// returns: that NPC (or null if not found, but we hope that// 		won't happen)object GetNPCByTag( string tag) {	object result;		if ( GetTag( OBJECT_SELF) == tag) {		result = OBJECT_SELF;	} else {		result = GetNearestObjectByTag( tag);	}	return result;}// 'Going Home to Papa' is the end of the beginning. When it's completed// all characters switch to their 'normal' activity cycle.void ghtp_start() {	if ( ! HasJournalEntry( "Plot", "plot/ghtp")){		AddJournalEntry( "Plot", "plot/ghtp");		object oPC = GetFirstPC();		object hela = GetNPCByTag( helaTag);			// debugging...		AssignCommand( hela, ActionSpeakString("Hello, I'm Hela"));			// get Hela to follow Geralt		AssignCommand( hela, ActionForceFollowObject( oPC));	}}
This then gets called by a much simpler script file, for example 'bv_act_ghtp_s' (birth and virgins, action, going home to papa, start), which looks like this:
Code:
//////////////////////////////////////////////////////////////////////////	bv_act_ghtp_s.nss// 	Start action script for going home to papa////	(c) 2008 The Medusa Collective////////////////////////////////////////////////////////////////////////#include "inc_bv_phases"void main(){	ghtp_start();}
This isn't exactly elegant but it is working. Testing for journal entries in quest files does work, so you can move quests on by setting journal entries either user-visible ones (for example in the 'Character' section, or invisible ones (Vaernus recommends 'Hidden', but 'Plot' is also working for me).
 
The full Quest tutorial is up in the Djinni Wikia. Let me make a few adjustments, and then I will link it from main page. Had to make a complete module to demonstrate what was going on, and make it easier to see. :)The link to the tutorial is http://djinni.wikia.com/wiki/Quest_System_101
 
Ok, fine...my quest now works so far, but.... now there is a problem with those quest items.Example: I've made an item with the picture of "it_potion_022", set it as quest item with following attributes: base type name - quest, Plot - true, Quest item - true.The base type name must be "quest", otherwise Djinni gives out an designer error message. This item should be available in Geralts Quest inventory slots, when the quest phase is completed.The problem is, the quest phase is set to completed as it should be but the item is invisible (or not there) in Geralts inventory and the Aurora log says:
Model it_quest_022 nor the default model it_quest_000 could be loaded.
So I think those quest items have to be set up in the journal.2da as well, but I haven't found out how this exactly works then. If someone has an answer for this.... :whistle:
 
Try model/appearance 1, 154 or 217 that looks like a potion. Watch the iit_quest_number.dds files in the unbifed _textures folder to find out how the number look like. Maybe you need some plugin to open this .dds files.
 
Ok, it works so far, but now I have a black sqare in my quest inventory slot... ??? ....any suggestions about what went wrong?
 
Mhh... I tried this numbers for model and appearance and it worked without any black square.
 
Ok it works now, I left the potion picture in the item description and it is the wrong picture now I think, because I have another picture then the model 217 in the quest slot now. I try to put another picture in it then.God, this Djinni really drives me mad.Much thanks Nayava. What should I do without you...? ;D
 
Top Bottom