Author Topic: Script reputation count?  (Read 306 times)

Legacy_Who said that I

  • Hero Member
  • *****
  • Posts: 931
  • Karma: +0/-0
Script reputation count?
« on: July 21, 2015, 07:48:17 am »


               

okay now I am the foggiest on what the HELL is going on with this one.....


 


I got a script for when a player does a quest his/her reputation to that faction is being raised by 10 points (or that is supposed to be the case) and the player will see how much rep the player got with that faction.


 




#include "nw_i0_generic"

void main()

{

   object oPC = GetPCSpeaker();

   object oFacMember = GetObjectByTag("OBJECT_SELF"); // OBJECT_SELF is better if they're the same

   int PCCurrFac = GetFactionAverageReputation(oFacMember, oPC);

 

   AdjustReputation(oPC, oFacMember, 10);

   SendMessageToPC(oPC, "Your reputation has raised by 10 points with guards.");

   SendMessageToPC(oPC, "Your current reputation with guards is " + IntToString(PCCurrFac) + ".");

}

 



 



So....here is the problem I am having:


 


first of....the player cannot see how much rep they got after completing the quest since it is stuck at  -1


Using this on multiple quest givers does not seem to really work.


 


Now I realise I might just be missing something very minor here but I believe that I have tried just about anything I could think of to fix this...


 


so if anyone can fix this issue for me then many thanks!!!! '<img'> 



               
               

               
            

Legacy_GhostOfGod

  • Hero Member
  • *****
  • Posts: 1490
  • Karma: +0/-0
Script reputation count?
« Reply #1 on: July 21, 2015, 11:13:20 am »


               

Hmm. The tag of the NPC is OBJECT_SELF? What if there's more than one. It's only going to find the first one on the list which might not have any rep?


And you'd need to adjust the rep before defining that int or at least account for the +10. Maybe something more like so?


 


#include "nw_i0_generic"

void main()

{

   object oPC = GetPCSpeaker();

   object oFacMember = OBJECT_SELF;


   AdjustReputation(oPC, oFacMember, 10);


   int PCCurrFac = GetFactionAverageReputation(oFacMember, oPC);


   SendMessageToPC(oPC, "Your reputation has raised by 10 points with guards.");

   SendMessageToPC(oPC, "Your current reputation with guards is " + IntToString(PCCurrFac) + ".");

}


 


There could be more to this system that we need to see but I suppose you could try and see if that helps.



               
               

               
            

Legacy_Who said that I

  • Hero Member
  • *****
  • Posts: 931
  • Karma: +0/-0
Script reputation count?
« Reply #2 on: July 21, 2015, 11:53:44 am »


               Could work, thanks!


Basically there are (as current) 6 Quests in a single area and each quest is supposed to give you +10 points to the area faction in order for the player to be able to proceed to the next area.


Normally i use the tag of the character that gives the rep points but that does not really give a different effect.


The script itself exist in action taken in the conversation tab after the player finished a quest.


But will let you know if this will work, i do appreciate the help '<img'>
               
               

               
            

Legacy_Who said that I

  • Hero Member
  • *****
  • Posts: 931
  • Karma: +0/-0
Script reputation count?
« Reply #3 on: July 21, 2015, 04:45:57 pm »


               

well it appears to work, thanks a lot! '<img'>