PDA

View Full Version : Script that checks availability for dialogue


Seamhainn
01-19-2008, 10:46 AM
Hello!

I copied this more or less from the Script, Source to check for availabilty for a dialogue line. Unfortunately it does not work. What is wrong here?


int StartingConditional() {
int iResult;
iResult = (GetGlobalNumber("DAN_JEDI_PLOT") == 7);
return iResult;
}


Thanks for any help!

sekan
01-19-2008, 11:04 AM
Hello!

I copied this more or less from the Script, Source to check for availabilty for a dialogue line. Unfortunately it does not work. What is wrong here?


int StartingConditional() {
int iResult;
iResult = (GetGlobalNumber("DAN_JEDI_PLOT") == 7);
return iResult;
}


Thanks for any help!

Test if this script works.



int StartingConditional() {
int nResumeTalk=GetGlobalNumber("DAN_JEDI_PLOT");
return nResumeTalk == 7;
}

Seamhainn
01-19-2008, 11:47 AM
It works!

Last question: how can I insure that the line is ALSO only spoken once?

If that problem is solved the Garrum and Tar'eelok Restoration is done (I hope)!

Thanks and take care

Marius Fett
01-19-2008, 12:41 PM
I think you'd have to use the k_con_talkedto script

Seamhainn
01-19-2008, 01:10 PM
I think you'd have to use the k_con_talkedto script

No, unfortunately I can't use it, as the pc might or might not have talked to the npc before.

Marius Fett
01-19-2008, 03:56 PM
You should still be able to use it...

Just attatch it to a node that says welcome back or something...

Seamhainn
01-19-2008, 04:12 PM
No, that will not work. Tar'eelok has - umong other lines - a line if the PC saved Juhani (and another if the PC killed Juhani). Both end the dialogue.

The script that checks for the availabilities are:


int StartingConditional() {
int iResult;
iResult = (GetGlobalNumber("DAN_JUHANI_PLOT") == 2);
return iResult;
}


and


int StartingConditional() {
int iResult;
iResult = (GetGlobalNumber("DAN_JUHANI_PLOT") == 3);
return iResult;
}


Both work perfectly well, but both also end the dialogue and make the other dialogue nodes which follow unavailable. So I want that the check also secures that the dialogue line in question only is said once and with another conversation initiated the following dialogue nodes are available.

EDIT: I know that is normally handled with a GlobalBoolean, but I don't know how that is scripted...

EDIT2: I just found a Boolean called DAN_TAREEJ_DONE which the developers created for that specific purpuse. Is there a possibility if the Boolean is used anywhere else in the game?

sekan
01-19-2008, 04:19 PM
This is the script that the game uses on beyala dialog


//:: k_pdan_juhani01
/*
Checks to see if DAN_BELAYAJ_DONE is FALSE (meaning
she has not mentioned Juhani before) and that
DAN_JUHANI_PLOT is 3 (meaning that Juhani has been
saved). This conversation will not repeat as
DAN_BELAYAJ_DONE is set to TRUE.
*/
//:: Created By: Peter T
//:: Copyright (c) 2002 Bioware Corp.
#include "k_inc_debug"

int StartingConditional()
{
int iResult;

iResult = ((GetGlobalBoolean("DAN_BELAYAJ_DONE") == FALSE) && (GetGlobalNumber("DAN_JUHANI_PLOT") == 3));
if (iResult)
SetGlobalBoolean("DAN_BELAYAJ_DONE", TRUE);

return iResult;
}




So there is two options we have. We use a old Boolean from taris althought i don't now how to reset Boolean as the Booleans from taris may already have been set the true :( or we make a new Boolean this could althought conflict with other mods.

However the script would look like these:


#include "k_inc_debug"

int StartingConditional()
{
int iResult;

iResult = ((GetGlobalBoolean("tag_of_boolean") == FALSE) && (GetGlobalNumber("DAN_JUHANI_PLOT") == 3));
if (iResult)
SetGlobalBoolean("tag_of_boolean", TRUE);

return iResult;
}


If player saved Jhuani



#include "k_inc_debug"

int StartingConditional()
{
int iResult;

iResult = ((GetGlobalBoolean("tag_of_boolean") == FALSE) && (GetGlobalNumber("DAN_JUHANI_PLOT") == 2));
if (iResult)
SetGlobalBoolean("tag_of_boolean", TRUE);

return iResult;
}


If player killed jhuani

Darkkender
01-19-2008, 04:22 PM
You can also create your own boolean variables in the Globals 2da file.

sekan
01-19-2008, 04:25 PM
You can also create your own boolean variables in the Globals 2da file.

Can i quote myself :xp: ?

or we make a new Boolean this could althought conflict with other mods.

Seamhainn
01-19-2008, 04:33 PM
I solved the problem (see my post above) as the developers seemed to have created the Boolean already :-) .

I'll send the .mod file to sekan for testing now...