Skip to content

Check for Henchmen in party

philbophilbo Member Posts: 19
Hey all,

I'm trying to make a conversation conditional that checks to see if a particular henchman is part of the players current party. I found the GetWorkingForPlayer function, but it only works if it is from a script attached to the particular henchmen. Also GetBeenHired does not work in cases where the henchman was hired, then fired or killed, it would still return true. At least that is how i understand these functions.

What is an efficient way to check from a conversation with an npc whether a particular henchman is in the current party?

I appreciate any help!

Comments

  • DazDaz Member Posts: 127
    edited July 2019
    You can do something like this:
    int GetHasHenchmanInParty(object oPC, string sHenchmanTag)
    {
        object oMember = GetFirstFactionMember(oPC, FALSE);
    
        while (oMember != OBJECT_INVALID)
        {
            if (GetTag(oMember) == sHenchmanTag)
                return TRUE;
    
            oMember = GetNextFactionMember(oPC, FALSE);
        }
    
        return FALSE;
    }
    

    Or, I'm not sure if GetFactionLeader() works on non PCs, but you can give it a try if the henchman is unique
    int StartingConditional()
    {
        return GetFactionLeader(GetObjectByTag("HENCHMAN_TAG")) == GetPCSpeaker();
    }
    
    Post edited by Daz on
  • philbophilbo Member Posts: 19
    @Daz

    Thank you for your response!

    I tried the second option first, and it worked!

    You are my hero
  • ProlericProleric Member Posts: 1,316
    GetMaster() works, too.
  • sarevok57sarevok57 Member Posts: 6,002
    man this was a life saver, it was taking me forever to get no where with this, thankfully this post existed
Sign In or Register to comment.