GeorgNihilus Posted July 15, 2007 Share Posted July 15, 2007 Hi people, I've been trying to modify preexisting game scripts to check if Mira is alone in the party with the PC, but for some reason they're not working , of course I'm not pretty much a scripter ... so can anyone enlighten me about it? thanks on advance Link to comment Share on other sites More sharing options...
stoffe Posted July 15, 2007 Share Posted July 15, 2007 Hi people, I've been trying to modify preexisting game scripts to check if Mira is alone in the party with the PC, but for some reason they're not working , of course I'm not pretty much a scripter ... so can anyone enlighten me about it? If this is meant as a dialog conditional script something like this would probably work: int StartingConditional() { int iCnt = GetPartyMemberCount(); if (iCnt != 2) return FALSE; int bPlayer = FALSE; int bMira = FALSE; int i; for (i = 0; i < iCnt; i++) { if (GetIsPlayerMadeCharacter(GetPartyMemberByIndex(i))) bPlayer = TRUE; else if (GetTag(GetPartyMemberByIndex(i)) == "Mira") bMira = TRUE; } return (bMira && bPlayer); } Link to comment Share on other sites More sharing options...
GeorgNihilus Posted July 15, 2007 Author Share Posted July 15, 2007 Thanks Stoffe , it works ... and yes, it was for a dialog conditional, in Mira's dlg. I'm gonna use it for another single party member dialogs in fact ... Link to comment Share on other sites More sharing options...
GeorgNihilus Posted July 27, 2007 Author Share Posted July 27, 2007 OK people, now I'm trying to use this script for K1 and I get this error: Compiling: k_con_missionalon.nss k_con_missionalon.nss(15): Error: Undeclared identifier "GetIsPlayerMadeCharacter" Compilation aborted with errors bla bla... that function doesn't exist in K1 right? so is there a similar function for K1 or I need a new script for checking if Carth or Mission are alone in the party? thanks Link to comment Share on other sites More sharing options...
stoffe Posted July 27, 2007 Share Posted July 27, 2007 OK people, now I'm trying to use this script for K1 and I get this error: k_con_missionalon.nss(15): Error: Undeclared identifier "GetIsPlayerMadeCharacter" that function doesn't exist in K1 right? so is there a similar function for K1 or I need a new script for checking if Carth or Mission are alone in the party? Yes, that function was added in TSL and does not exist in KOTOR 1. There is no standard function to check if a character is the player character in KOTOR 1, but you can make your own function that should work in normal circumstances, like: int GetIsPlayerMadeCharacter(object oChar) { return ((GetFirstPC() == oChar) && (GetTag(oChar) == "")); } ...which you would use just like you already tried to do. Just make sure your custom function is either in the top of the script where you want to use it, or in an include file used by that script. Link to comment Share on other sites More sharing options...
Mindtwistah Posted August 1, 2007 Share Posted August 1, 2007 What is the script to check if Mira is in your Party? Link to comment Share on other sites More sharing options...
stoffe Posted August 1, 2007 Share Posted August 1, 2007 What is the script to check if Mira is in your Party? If this is for use in a dialog you can use the standard script c_inprty_npc to check. Set the first (P1) parameter to the party slot number of the NPC to check for, as in: 0 Atton 1 BaoDur 2 Mand 3 g0t0 4 Handmaiden 5 hk47 6 Kreia 7 Mira 8 T3m4 9 VisasMarr 10 Hanharr 11 Disciple If it's not for use in a dialog you can check in other scripts like: if (IsNPCPartyMember(NPC_MIRA)) { // ... Mira is in the party. Let's party! ... } Link to comment Share on other sites More sharing options...
GeorgNihilus Posted August 3, 2007 Author Share Posted August 3, 2007 int GetIsPlayerMadeCharacter(object oChar) { return ((GetFirstPC() == oChar) && (GetTag(oChar) == "")); } all this is the function definition? or only the 1st part till object oChar?? I have an error if I define all this in the first part the script ... Link to comment Share on other sites More sharing options...
stoffe Posted August 3, 2007 Share Posted August 3, 2007 all this is the function definition? or only the 1st part till object oChar?? I have an error if I define all this in the first part the script ... It's a custom function that you either need to put above the first place you use it, like: int GetIsPlayerMadeCharacter(object oChar) { return ((GetFirstPC() == oChar) && (GetTag(oChar) == "")); } void main() { if (GetIsPlayerMadeCharacter(GetFirstPC())) { SendMessageToPC(GetFirstPC(), "I am The Player! Whoo!"); } } ... or use a forward declaration and put it anywhere in the script, like: int GetIsPlayerMadeCharacter(object oChar); void main() { if (GetIsPlayerMadeCharacter(GetFirstPC())) { SendMessageToPC(GetFirstPC(), "I am The Player! Whoo!"); } } int GetIsPlayerMadeCharacter(object oChar) { return ((GetFirstPC() == oChar) && (GetTag(oChar) == "")); } ...or put it in an include file, like... The include file (myutilities.nss): int GetIsPlayerMadeCharacter(object oChar) { return ((GetFirstPC() == oChar) && (GetTag(oChar) == "")); } The script using it: #include "myutilities" void main() { if (GetIsPlayerMadeCharacter(GetFirstPC())) { SendMessageToPC(GetFirstPC(), "I am The Player! Whoo!"); } } ...whichever you prefer given the situation. Link to comment Share on other sites More sharing options...
GeorgNihilus Posted August 6, 2007 Author Share Posted August 6, 2007 OK thanks a lot ... I finally defined it before the void main() { declaration ... now I can finish those pending dialogs with a single party member ... Link to comment Share on other sites More sharing options...
GeorgNihilus Posted August 12, 2007 Author Share Posted August 12, 2007 Ok now I want to negate the script in which Mira is alone, to check if she's NOT alone in the active party ... I only change one line in the script in which she is alone (which works) but it's not working ... what's wrong? // c_miranalon /* should return true if Mira is NOT alone in the party */ int GetIsPlayerMadeCharacter(object oChar) { return ((GetFirstPC() == oChar) && (GetTag(oChar) == "")); } int StartingConditional() { int iCnt = GetPartyMemberCount(); if (iCnt != 2) return FALSE; int bPlayer = FALSE; int bMira = FALSE; int i; for (i = 0; i < iCnt; i++) { if (GetIsPlayerMadeCharacter(GetPartyMemberByIndex(i) )) bPlayer = TRUE; else if (GetTag(GetPartyMemberByIndex(i)) != "Mira") //CHANGED SIGN bMira = TRUE; } return (bMira && bPlayer); } I only changeD the sign to "!=" in the line indicated with // ... shouldn't it detect the other member tags that way? Thanks on advance Link to comment Share on other sites More sharing options...
Tupac Amaru Posted August 13, 2007 Share Posted August 13, 2007 You didn't adjust the line that checks the number of party members. This will return true if the Exile, Mira and another NPC are in the party: // Current party consists of Mira, Exile and someone else. int StartingConditional() { return (IsNPCPartyMember(NPC_MIRA) && IsNPCPartyMember(NPC_PLAYER) && GetPartyMemberCount() > 2); } Link to comment Share on other sites More sharing options...
stoffe Posted August 13, 2007 Share Posted August 13, 2007 Ok now I want to negate the script in which Mira is alone, to check if she's NOT alone in the active party ... Just check the "Not" checkbox after the conditional script on the dialog node? That will make the node trigger if the conditional script returns false (i.e. Mira is not alone). No need for separate scripts unless I'm overlooking something. Link to comment Share on other sites More sharing options...
Tupac Amaru Posted August 14, 2007 Share Posted August 14, 2007 Just check the "Not" checkbox after the conditional script on the dialog node? That will make the node trigger if the conditional script returns false (i.e. Mira is not alone). No need for separate scripts unless I'm overlooking something.That wouldn't work here. The original script checks if three conditions are fulfilled. Just negating the script would return true if at least one of the conditions are not fulfilled. This includes the cases where the main character is the only party member or there are any three character in the party (don't have to be Mira) or the Exile is not the first PC. Link to comment Share on other sites More sharing options...
GeorgNihilus Posted August 14, 2007 Author Share Posted August 14, 2007 I see your point Tupac ... still I'm gonna check both options to check that NOT checkbox also ... thanks guys! Link to comment Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.