Aller au contenu

Photo

TransportAllToWaypoint


  • Veuillez vous connecter pour répondre
3 réponses à ce sujet

#1
jimbobx

jimbobx
  • Members
  • 6 messages
I'm using TransportAllToWaypoint to move the PC and any henchman from a doorway transition to a Waypoint. When I tested with 2 Henchies. Only 1 was transported with the PC. Any ideas?

#2
Xovian

Xovian
  • Members
  • 87 messages
Probably need to use a while loop to grab all of them, it's probably only grabbing the first one and then stops. Another reason you may need it, is because familiar/companions/summons can also be left behind with out it as well.

There is a function that looks at all in party, you may want to look into that or use it in combination with the transportalltowaypoint.

Modifié par Xovian, 01 septembre 2010 - 08:27 .


#3
GhostOfGod

GhostOfGod
  • Members
  • 863 messages
Yep. Looked at the function "TransportAllToWaypoint". It only grabs one of each follower type. So you might want to try something like so:

void TransportAllFollowersToLocation(object oPC, location oLoc)
{
    // Jump the PC
    AssignCommand(oPC, ClearAllActions());
    AssignCommand(oPC, JumpToLocation(oLoc));

    // Not a PC, so has no associates
    if (!GetIsPC(oPC))
        return;

    object oFollower = GetFirstFactionMember(oPC, FALSE);
    // Jump any associates
    while (GetIsObjectValid(oFollower))
    {
        int iType = GetAssociateType(oFollower);
        if (iType == ASSOCIATE_TYPE_HENCHMAN ||
            iType == ASSOCIATE_TYPE_DOMINATED ||
            iType == ASSOCIATE_TYPE_FAMILIAR ||
            iType == ASSOCIATE_TYPE_SUMMONED ||
            iType == ASSOCIATE_TYPE_ANIMALCOMPANION)
        {
            AssignCommand(oFollower, ClearAllActions());
            AssignCommand(oFollower, JumpToLocation(oLoc));
        }
        oFollower = GetNextFactionMember(oPC, FALSE);
    }

}


I haven't tested it yet but I think it will work. Hope it helps.

EDIT: Actually you could probably just do this since you can use the GetFirst/NextFaction member to filter for NPCs only:

void TransportAllFollowersToLocation(object oPC, location oLoc)
{
    // Jump the PC
    AssignCommand(oPC, ClearAllActions());
    AssignCommand(oPC, JumpToLocation(oLoc));

    // Not a PC, so has no associates
    if (!GetIsPC(oPC))
        return;

    object oFollower = GetFirstFactionMember(oPC, FALSE);
    // Jump any associates
    while (GetIsObjectValid(oFollower))
    {
        AssignCommand(oFollower, ClearAllActions());
        AssignCommand(oFollower, JumpToLocation(oLoc));
        oFollower = GetNextFactionMember(oPC, FALSE);
    }

}


Modifié par GhostOfGod, 01 septembre 2010 - 08:56 .


#4
jimbobx

jimbobx
  • Members
  • 6 messages
Used the 2nd one. Worked a treat. Thanks very much :)