GeorgNihilus Posted January 17, 2010 Share Posted January 17, 2010 Hey there now I need a script to check if the PC is alone in the party, any script master in the mood to enlighten me one more time? it's not in the game scripts is it? thanks Link to comment Share on other sites More sharing options...
GeorgNihilus Posted January 18, 2010 Author Share Posted January 18, 2010 Well finally something like this did it, in case someone interested int StartingConditional() { int iCnt = GetPartyMemberCount(); if (iCnt < 2) return TRUE; return FALSE; } bye Link to comment Share on other sites More sharing options...
JuniorModder Posted January 18, 2010 Share Posted January 18, 2010 Thanks, I'm sure I'll need this in my mod at some point. JM Link to comment Share on other sites More sharing options...
Qui-Gon Glenn Posted January 18, 2010 Share Posted January 18, 2010 Well finally something like this did it, in case someone interested int StartingConditional() { int iCnt = GetPartyMemberCount(); if (iCnt < 2) return TRUE; return FALSE; } bye One way to do it, and glad it worked! I think that you could shorten it, more elegant perhaps... and I may be wrong, so since your code works, by all means use it I am not sure that you need to have both boolean values in your if statement. Generally, false is assumed, so unless your condition is met to set it to TRUE, the script will return false. Also, it seems that this script might not work in all situations (although probably perfect for yours in the situation you are using it) as it would return true in an instance where an NPC was alone, like Atton in the cantina. Unfortunately, I am rusty with my function calls (and never good with them to begin with). GetObjectByTag() would seem to be handy here if you wanted to universalize the script. Not sure if this would compile, but here is my thought. Anyone wiser (just about any scripter here) watching - I will be happy to be corrected! int StartingConditional() { int iCnt = GetPartyMemberCount(); if (iCnt < 2) && GetObjectByTag("[color=darkorange]yourPCname[/color]") == "[color=darkorange]yourPCname[/color]" return TRUE; } Good Modding to you, GN! Link to comment Share on other sites More sharing options...
Pavlos Posted January 18, 2010 Share Posted January 18, 2010 You need not even do that much: int StartingConditional() { return (GetPartyMemberCount() < 2); } That should be sufficient if my memory serves, though it has been a while. Edit: And then any extra trimmings, such as checking the name of the PC, should you wish it. The only trouble with such a check is that it would only work if the PC's name were a known value. Link to comment Share on other sites More sharing options...
Qui-Gon Glenn Posted January 18, 2010 Share Posted January 18, 2010 As I was saying about the wiser.... Hey Pavlos Link to comment Share on other sites More sharing options...
stoffe Posted January 18, 2010 Share Posted January 18, 2010 You need not even do that much: int StartingConditional() { return (GetPartyMemberCount() < 2); } That should be sufficient if my memory serves, though it has been a while. Edit: And then any extra trimmings, such as checking the name of the PC, should you wish it. The only trouble with such a check is that it would only work if the PC's name were a known value. If this is for TSL: int StartingConditional() { return (GetPartyMemberCount() == 1) && GetIsPlayerMadeCharacter(GetFirstPC()); } Link to comment Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.