Aller au contenu

Photo

Attempt number 2: reputation script issue...


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

#1
Who said that I

Who said that I
  • Members
  • 492 messages

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 :) 

 

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) + ".");
 
}

 



#2
Asymmetric

Asymmetric
  • Members
  • 165 messages

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.


  • Who said that I aime ceci

#3
Who said that I

Who said that I
  • Members
  • 492 messages
Ah ok. Well most of the questline npc's are marked as plot. Think that might be the case then....