Author Topic: Attempt number 2: reputation script issue...  (Read 400 times)

Legacy_Who said that I

  • Hero Member
  • *****
  • Posts: 931
  • Karma: +0/-0
Attempt number 2: reputation script issue...
« on: November 30, 2015, 08:32:05 pm »


               

okay I know I posted this some time ago but am trying this again since I cannot seem to find an issue for this and I am hoping you fine folk can help me with this '<img'> 


 


basically the issue is that the 2 factions are not counting down/up when one of the 2 factions is raised/lowered due to pc action. anyone know what I am doing wrong? 


 


Basically I want the players to know how much they have increased but apparently that remains stuck at -1


 


#include "nw_i0_generic"

void main()

{

object oPC = GetPCSpeaker();

object oFacMember = GetObjectByTag("SlayerFaction");

object oComm = GetObjectByTag("OrderOfArthem");

int PCCurrFac;

    // Raise the faction of the PC to the Slayer Organization.

    AdjustReputation(GetPCSpeaker(), OBJECT_SELF, 10);

    // Tell the PC that his/her faction has been lowered.

    SendMessageToPC(GetPCSpeaker(), "You have gained 5 points of faction with the guards.");

    // Set the value of PCCurrFac to the PCs current faction with the above group.

    PCCurrFac = GetFactionAverageReputation(oFacMember, oPC);

    // Tell the PC his/her current faction with said group.

    SendMessageToPC(GetPCSpeaker(), "Your current faction with the Slayers is " + IntToString(PCCurrFac) + ".");

    // Lower the faction of the PC to OrderOfArthem.

    AdjustReputation(GetPCSpeaker(), oComm, -10);

    // Tell the PC that his/her faction has been lowered.

    SendMessageToPC(GetPCSpeaker(), "You have lost 5 point of faction with the Order of Arthem.");

    // Set the value of PCCurrFac to teh PCs current faction with the above group.

    PCCurrFac = GetFactionAverageReputation(oComm, oPC);

    // Tell the PC his/her faction with said group.

    SendMessageToPC(GetPCSpeaker(), "Your current faction with the order of Arthem is " + IntToString(PCCurrFac) + ".");

 

}

 



               
               

               
            

Legacy_Asymmetric

  • Sr. Member
  • ****
  • Posts: 289
  • Karma: +0/-0
Attempt number 2: reputation script issue...
« Reply #1 on: November 30, 2015, 09:44:37 pm »


               

Could be a number of reasons. Hard to say without seeing the NPCs.


 


The first AdjustReputation may do nothing at all, depending what OBJECT_SELF is:



AdjustReputation(GetPCSpeaker(), OBJECT_SELF, 10);

I assume you want to use the Slayers Faction NPC.



AdjustReputation(GetPCSpeaker(), oFacMember, 10);

Keep in mind that AdjustReputation() fails, if the NPC has a plot flag. So check for plot flags.


 


Also: I always used GetReputation() instead of GetFactionAverageReputation(), although I'm not sure what the latter exactly does.



               
               

               
            

Legacy_Who said that I

  • Hero Member
  • *****
  • Posts: 931
  • Karma: +0/-0
Attempt number 2: reputation script issue...
« Reply #2 on: December 01, 2015, 11:46:00 am »


               Ah ok. Well most of the questline npc's are marked as plot. Think that might be the case then....