Aller au contenu

Photo

Referring to created companions


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

#1
kamal_

kamal_
  • Members
  • 5 238 messages

I'd like to have a party member escort some saved villagers out of a dungeon, the companion will be removed from the party while they do this, and then the companion will return to their hangout. Removing the party member and having them go to the hangout is easy enough for companions in the story, but how to refer to companions created via the SoZ party creation method?



#2
kevL

kevL
  • Members
  • 4 052 messages
something like this:
object GetFirstRosterSoZ()
{
    object oRosterSoZ = GetFirstRosterMember();
    while (GetIsObjectValid(oRosterSoZ))
    {
        if (GetIsPlayerCreated(oRosterSoZ)) // <-
            return oRosterSoZ;

        oRosterSoZ = GetNextRosterMember();
    }

    return OBJECT_INVALID;
}

//RWT-OEI 07/08/08
// Characters created through the party creation mechanics
// are stored in the Roster system but are flagged as
// PlayerCreated to distinguish them from normal Roster
// contained NPCs. Note that if the character is not
// in the roster /at all/, this function returns false.
// This script function can query that flag.
// oCreature - object id of a creature to check
int GetIsPlayerCreated( object oCreature );
i imagine you'll want to also check for name or some other thingama-doobie. Other than that, they're just roster members

#3
kamal_

kamal_
  • Members
  • 5 238 messages

something like this:

object GetFirstRosterSoZ()
{
    object oRosterSoZ = GetFirstRosterMember();
    while (GetIsObjectValid(oRosterSoZ))
    {
        if (GetIsPlayerCreated(oRosterSoZ)) // <-
            return oRosterSoZ;

        oRosterSoZ = GetNextRosterMember();
    }

    return OBJECT_INVALID;
}
//RWT-OEI 07/08/08
// Characters created through the party creation mechanics
// are stored in the Roster system but are flagged as
// PlayerCreated to distinguish them from normal Roster
// contained NPCs. Note that if the character is not
// in the roster /at all/, this function returns false.
// This script function can query that flag.
// oCreature - object id of a creature to check
int GetIsPlayerCreated( object oCreature );
i imagine you'll want to also check for name or some other thingama-doobie. Other than that, they're just roster members

 

Yes, I'll want to check by name or tag or something so I can say "Bob, escort the villagers", or "Mary, escort the villagers". I want to let the player pick which companion will be handling the escort duties.



#4
kevL

kevL
  • Members
  • 4 052 messages
neat [tm]

Should be straight-up companion stuff then. But if ya ever need to know if a roster-character is SoZ style, that's the funct.