Note: LucasForums Archive Project
The content here was reconstructed by scraping the Wayback Machine in an effort to restore some of what was lost when LF went down. The LucasForums Archive Project claims no ownership over the content or assets that were archived on archive.org.

This project is meant for research purposes only.

[K1] Two Conditionals on one dialog entry

Page: 1 of 1
 Robespierre
03-29-2008, 12:02 AM
#1
Yes, I'm back. And my cluttering of the forums with my

This has been bugging me for a while, and try as I might I can't find a way around it. I need to put, in Kotor 1, two conditional scripts on one dialog entry. Is this possible? Obviously it is in Kotor 2, but is there any trick you can use to combine two conditional scripts such as:

int StartingConditional() {
object oWP = GetObjectByTag("swoop_trans", 0);
if ((GetIsObjectValid(oWP)) && (GetDistanceBetween(GetFirstPC(), oWP) < 20.0)) {
return FALSE;
}
return TRUE;
}

And:

int StartingConditional() {
return GetGlobalBoolean("Tele_m02ac");

}

Please and thank you!
 shockix
03-29-2008, 5:58 AM
#2
I think that the only way is to create a new script :

int StartingConditional() {
object oWP = GetObjectByTag("swoop_trans", 0);
if ((GetIsObjectValid(oWP)) && (GetDistanceBetween(GetFirstPC(), oWP) < 20.0) && !GetGlobalBoolean("Tele_m02ac")) {
return FALSE;
}
return TRUE;
}
 Robespierre
03-29-2008, 6:33 AM
#3
This doesn't work. It doesn't check the Global Boolean at all. I just don't quite know why...
 Pavlos
03-29-2008, 8:07 AM
#4
Been a while so forgive me if I'm a little rusty :).

Could I ask you what context this script is in? So, basically, what are you trying to do with this script?

I'm just not sure about your use of GetIsObjectValid(), you see.
 GeorgNihilus
03-29-2008, 2:33 PM
#5
You need one script to join them for K1 :) try this:

int StartingConditional() {
object oWP = GetObjectByTag("swoop_trans", 0);
int T = GetGlobalBoolean("Tele_m02ac");

if ((GetIsObjectValid(oWP)) && (GetDistanceBetween(GetFirstPC(), oWP) < 20.0) && T == 1) {
return FALSE;
}
return TRUE;
}

or ask for T = 0 in the if () according to what you intend to do ... :rolleyes:

hope it helps ...
 Robespierre
03-29-2008, 10:50 PM
#6
int StartingConditional() {
object oWP = GetObjectByTag("swoop_trans", 0);
if ((GetIsObjectValid(oWP)) && (GetDistanceBetween(GetFirstPC(), oWP) < 20.0)) {
return FALSE;
}
return TRUE;
}

Ah, this is a nice little code. Basically it removes a dialog entry if you're within a certain distance of an object (in this case my droid). But first it checks that the droid actually exists (otherwise my game went crazy and never showed the dialog entry) - hence the GetIsObjectValid().

EDIT: I tried the code, and it doesn't work either. Its still not checking the global boolean.

Basically this code checks the distance between the player and a waypoint. Then it checks a global boolean. If the global boolean returns True (or 1) AND the player isn't next to the waypoint, THEN the dialog entry shows. But at the moment its showing the waypoint regardless of whether or not the global boolean is true or false BUT it isn't showing the option if you're standing next to the relevant waypoint. So its half working.

Anybody got any ideas?
 shockix
03-30-2008, 6:52 AM
#7
Ok, now I know what you are looking for.
You want your dialog to begin only if the boolean is TRUE, the object is valid and the distance is >= 20.0.
So if only one of those conditions is not satisfied, the dialog won't begin.

Try this script :
int StartingConditional() {
object oWP = GetObjectByTag("swoop_trans", 0);
if ((!GetIsObjectValid(oWP)) || (GetDistanceBetween(GetFirstPC(), oWP) < 20.0) || (!GetGlobalBoolean("Tele_m02ac"))) {
return FALSE;
}
return TRUE;
}
 Robespierre
04-01-2008, 5:39 AM
#8
Well now its just constantly returning false. I'm really sorry about this problem...but any more ideas?
 swfan28
04-01-2008, 6:39 AM
#9
Do you have a waypoint with correct tag in place and is your global boolean declared in the globalcat.2da. If not then the checks for them will always return FALSE.
Page: 1 of 1