Page 3 of 3

Re: ( IN PROGRESS ) Summons Don't Follow

Posted: Sun Mar 15, 2015 8:20 am
by Balkoth
Give this a shot:

Code: Select all

// Local area transition script.
// Created by Somnium in 2015 for the Alangara server.
// This area-transition script teleports both the entering PC and any
// followers he might have, to a destination waypoint.
// Usage:
// 1) Put this script on an area transition trigger (onEnter event).
// 2) Place a local string named TELEPORT_TARGET on the trigger, with
//    a value corresponding to the tag of the target waypoint.

//// - Repeatedly attempts to jump to lTarget until successful
void FailsafeJump(object oJumper, location lTarget);

void main()
{
   object oPC = GetEnteringObject();
   if (GetIsObjectValid(oPC) && GetIsPC(oPC))
   {
       string targetName = GetLocalString(OBJECT_SELF, "TELEPORT_TARGET");

       if (targetName != "")
       {
           object target = GetWaypointByTag(targetName);
           location targetLocation = GetLocation(target);
           if (GetIsObjectValid(target))
           {
              FailsafeJump(oPC, targetLocation);
              object factionMember = GetFirstFactionMember(oPC, FALSE);
              while (GetIsObjectValid(factionMember))
              {
                 if (!GetIsPC(factionMember) && GetMaster(factionMember) == oPC)
                 {
                    FailsafeJump(factionMember, targetLocation);
                 }
                 factionMember = GetNextFactionMember(oPC, FALSE);
              }
           }
       }
   }
}

//// - Repeatedly attempts to jump to lTarget until successful
void FailsafeJump(object oJumper, location lTarget)
{
    float fDist = GetDistanceBetweenLocations(GetLocation(oJumper), lTarget);
    if (fDist > 1.5 || fDist < 0.0)
    {
        AssignCommand(oJumper, ClearAllActions());
        DelayCommand(0.05, AssignCommand(oJumper, ActionJumpToLocation(lTarget)));
        DelayCommand(0.1, FailsafeJump(oJumper, lTarget));
    }
}

Re: ( IN PROGRESS ) Summons Don't Follow

Posted: Sun Mar 15, 2015 6:58 pm
by tarashon
Talked with Seeker and will implement this new script right away...

Thanks for the scripting :)

/tara

Re: ( FIXED ) Summons Don't Follow

Posted: Sun Mar 22, 2015 7:58 pm
by tarashon
Seemes your scriptchange worked Wonders Balkoth, so thanks alot for that :)

PS.

If someone discovers some old spot I've forgotten where summons won't follow... post here...

/tara