( FIXED ) Summons Don't Follow

For in-game support requests, and bug reports.
Balkoth
Posts: 188
Joined: Mon Feb 23, 2015 1:55 pm

Re: ( IN PROGRESS ) Summons Don't Follow

Post by Balkoth » Sun Mar 15, 2015 8:20 am

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));
    }
}

User avatar
tarashon
Posts: 857
Joined: Sun Jan 11, 2015 6:27 pm

Re: ( IN PROGRESS ) Summons Don't Follow

Post by tarashon » Sun Mar 15, 2015 6:58 pm

Talked with Seeker and will implement this new script right away...

Thanks for the scripting :)

/tara

User avatar
tarashon
Posts: 857
Joined: Sun Jan 11, 2015 6:27 pm

Re: ( FIXED ) Summons Don't Follow

Post by tarashon » Sun Mar 22, 2015 7:58 pm

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

Post Reply

Who is online

Users browsing this forum: No registered users and 19 guests