Hi there,
Hope you don't mind if I answer your question with a walkthrough. Sometimes it's easier to show than to explain.
Let's say you're modifying tat17_0xpazaa_01.dlg, so that it sort of looks like this (conditionals and scripts displayed in the tree in DLGEditor). Note the new nodes that have scripts with names that begin with "lordz" on lines 6-9.
1 [+]<k_con_talkedto> Hello human. Are you a hunter ... <k_act_talktrue>
2 [+]<k_ptat_fazzpaz_n> What do you do?<>
3 <k_ptat_fazzpaz_y> I want to ask about Pazaak (already listed)<>
4 <> Could I ask you about Tatooine? (already listed)<>
5 <> Heard any rumors from off-planet? (already listed)<>
6 [-]<lordz_c_tlk_n> I've never asked this, but do you have a store?<lordz_a_tlk>
7 <>Why yes, let me show you what I have<lordz_a_sto>
8 [-]<lordz_c_tlk_y>Hey could I see your store again?<>
9 <>Why yes, let me show you what I have (already listed) <lordz_a_sto>
10 <> I have to go. Goodbye. (already listed)<>
On line 6, we have a conditional script called lordz_c_tlk_n and a normal script called lordz_a_tlk. The conditional script needs to see if we've never asked this question before and if so, return true. The lordz_a_tlk script should then mark that this question has been asked before.
/* lordz_c_tlk_n.nss
Returns TRUE if the pazaak guy hasn't been asked
about his store */
int StartingConditional() {
int nSlot=4; // choose a slot store our flag 0-7, 4 is as good as any
int nHasSpoken = GetLocalBoolean(GetLastSpeaker(), nSlot); // get the value
return (!nHasSpoken); // return TRUE if boolean is false
}
/* lordz_a_tlk.nss
Sets the local boolean indicating that the pazaak guy
has been asked about his store. */
void main() {
int nSlot=4; // use the same slot as before!
SetLocalBoolean (GetLastSpeaker(), nSlot, TRUE);
}
For line 7, lordz_a_sto will open the store. stoffe provided the example script in this post. I assume you're going to man26aa_bar since you mentioned it. The tag for that store is "man26aa_bar" -- go figure.
/* lordz_a_sto.nss
Brings up the merchant screen for the dialog speaker.
Based on code from stoffe... see
http://www.lucasforums.com/showthread.php?p=1792006#post1792006)
*/
void main() {
object oStore = GetObjectByTag("man26aa_bar");
object oSpeaker = GetPCSpeaker();
if (!GetIsObjectValid(oStore))
oStore = CreateObject(OBJECT_TYPE_STORE, "man26aa_bar", GetLocation(OBJECT_SELF));
if (GetIsObjectValid(oStore))
DelayCommand(0.5, OpenStore(oStore, oSpeaker));
}
For line 8, we need a conditional that does the opposite of our previous conditional. Since KotOR1 dialogs don't support the NOT flag, we need to write a whole new conditional but it looks very much like the previous one.
/* lordz_c_tlk_y.nss
Returns TRUE if the pazaak guy has been asked
about his store at least once before*/
int StartingConditional() {
int nSlot=4; // choose a slot store our flag 0-7, 4 is as good as any
int nHasSpoken = GetLocalBoolean(GetLastSpeaker(), nSlot); // get the value
return nHasSpoken; // return value of the boolean
}
Line 9 is just a copy node of Line 7.