Author Topic: I need to determine the faction of the PC  (Read 373 times)

Legacy_GrandaddyBonegrinder

  • Newbie
  • *
  • Posts: 16
  • Karma: +0/-0
I need to determine the faction of the PC
« on: October 13, 2011, 08:31:55 pm »


               Greeting Ye who hold the knowlwdge,

I need to determine the faction of the PC (EnteringObject)
If the PCs faction is not BB then return…

How can I determine a PCs faction and then compare it to my
BB string?
 

The following can’t work because I’m trying to compare a
string to an object…

 [nwscript]

#include "NW_I0_GENERIC"

 void main()

{

     object oPC = GetEnteringObject();

     object oFaction = OBJECT_SELF;

     string sSetFaction;

     string BB;

       //test for BB faction

     
SetLocalString(oFaction, "sSetFaction", "BB");

        string
sTestman = GetLocalString(oFaction, "BB");       

if((!GetFactionEqual(sTestman,
OBJECT_SELF) == TRUE))

            return
TRUE;

 
}[/nwscript]

thanks '<img'>

Grandaddy
               
               

               
            

Legacy_Lightfoot8

  • Hero Member
  • *****
  • Posts: 4797
  • Karma: +0/-0
I need to determine the faction of the PC
« Reply #1 on: October 13, 2011, 10:56:20 pm »


               The Faction of the PC is a group faction that only the PC and the members of the pC's party belong to.   In short, SetFaction does not work on PC's  because they belong to there partys faction with the Party leader being the Faction Leader.
               
               

               
            

Legacy_Morbane

  • Jr. Member
  • **
  • Posts: 79
  • Karma: +0/-0
I need to determine the faction of the PC
« Reply #2 on: October 13, 2011, 11:00:37 pm »


               GetFactionEqual(oPC, GetObjectByTag("creaturetag")

that will compare the PC's and a predetermined creature's faction

void main() cannot return TRUE;
               
               

               
            

Legacy_Lightfoot8

  • Hero Member
  • *****
  • Posts: 4797
  • Karma: +0/-0
I need to determine the faction of the PC
« Reply #3 on: October 13, 2011, 11:15:42 pm »


               

Morbane wrote...

GetFactionEqual(oPC, GetObjectByTag("creaturetag")

that will compare the PC's and a predetermined creature's faction

void main() cannot return TRUE;



That will only tell you if the creature is in the PC's party as a Henchman, summoned creature, another PC in the party, Domanated ect.   There is no way to have the PC join or belong to any of the creature factions.  
               
               

               
            

Legacy_GrandaddyBonegrinder

  • Newbie
  • *
  • Posts: 16
  • Karma: +0/-0
I need to determine the faction of the PC
« Reply #4 on: October 14, 2011, 10:49:36 am »


               OK.... thank you very much!
               
               

               
            

Baaleos

  • Administrator
  • Hero Member
  • *****
  • Posts: 1916
  • Karma: +0/-0
I need to determine the faction of the PC
« Reply #5 on: October 14, 2011, 11:12:49 am »


               There is no way - via vanilla scripting.

NWNX_FUNCS does have a 'SetFactionID' function, that may be able to set the faction of the player directly to be that of a npc faction.

I have in the past, used the dm console commands to set a players faction, and it results in creatures on the Hostile faction going friendly to the player, and they all appear in the party list for the player.

It did result in some buggy behavior though.  The players were unable to go through doors and such after having their faction altered via the dm console.