Robespierre Posted March 29, 2008 Share Posted March 29, 2008 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! Link to comment Share on other sites More sharing options...
shockix Posted March 29, 2008 Share Posted March 29, 2008 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; } Link to comment Share on other sites More sharing options...
Robespierre Posted March 29, 2008 Author Share Posted March 29, 2008 This doesn't work. It doesn't check the Global Boolean at all. I just don't quite know why... Link to comment Share on other sites More sharing options...
Pavlos Posted March 29, 2008 Share Posted March 29, 2008 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. Link to comment Share on other sites More sharing options...
GeorgNihilus Posted March 29, 2008 Share Posted March 29, 2008 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 ... hope it helps ... Link to comment Share on other sites More sharing options...
Robespierre Posted March 30, 2008 Author Share Posted March 30, 2008 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? Link to comment Share on other sites More sharing options...
shockix Posted March 30, 2008 Share Posted March 30, 2008 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; } Link to comment Share on other sites More sharing options...
Robespierre Posted April 1, 2008 Author Share Posted April 1, 2008 Well now its just constantly returning false. I'm really sorry about this problem...but any more ideas? Link to comment Share on other sites More sharing options...
swfan28 Posted April 1, 2008 Share Posted April 1, 2008 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. Link to comment Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.