40 lines
1.5 KiB
Plaintext
40 lines
1.5 KiB
Plaintext
|
/*Starting conditional to test to make sure party members are close by in MP
|
||
|
games. Thanks to Warleader_6 for bringing this to my attention, and to Jack
|
||
|
Gorman for some of the scripts that were part of his Legs-of-the-trip script*/
|
||
|
//Also adds in custom tag functionality
|
||
|
#include "otres_inc"
|
||
|
|
||
|
int StartingConditional()
|
||
|
{
|
||
|
object oTrigger=OBJECT_SELF;
|
||
|
OTRESTokens(oTrigger);
|
||
|
object oTalker=GetPCSpeaker();
|
||
|
SetLocalObject(oTalker,"oTrigger",oTrigger);
|
||
|
if(GetLocalInt(oTalker,"bFinalNext"))
|
||
|
return FALSE;
|
||
|
object oFM=GetFirstFactionMember(oTalker);
|
||
|
oFM=GetNextFactionMember(oTalker);
|
||
|
if (oFM==OBJECT_INVALID) //single player
|
||
|
return TRUE;
|
||
|
|
||
|
// Loop to check each party members distance from the PC.
|
||
|
while (GetIsObjectValid(oFM))
|
||
|
{//begin while loop
|
||
|
// Skip dead party members
|
||
|
if (!GetIsDead(oFM))
|
||
|
{//begin not dead if
|
||
|
int iDistanceCheck = FloatToInt(GetDistanceToObject(oFM));
|
||
|
// Check to see if oPartyMember is within 10 meters. If not, send
|
||
|
// the message and exit the conditional as FALSE.
|
||
|
if (iDistanceCheck > 10)
|
||
|
{//begin distance check if
|
||
|
// If all party members are not present do not show travel dialog
|
||
|
return FALSE;
|
||
|
}//end distance check if
|
||
|
}//end not dead if
|
||
|
oFM = GetNextFactionMember(oTalker);
|
||
|
}//end while loop
|
||
|
//if all within 10 m show the travel dialog
|
||
|
return TRUE;
|
||
|
}
|