Jump to content

Home

PC alone in party?


GeorgNihilus

Recommended Posts

Well finally something like this did it, in case someone interested :)

 

int StartingConditional() {

 

int iCnt = GetPartyMemberCount();

 

if (iCnt < 2)

return TRUE;

 

return FALSE;

}

 

bye :thmbup1:

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

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

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

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...