Author Topic: Script issue with adjust reputation  (Read 548 times)

Legacy_DM_Vecna

  • Hero Member
  • *****
  • Posts: 501
  • Karma: +0/-0
Script issue with adjust reputation
« on: April 24, 2011, 07:59:36 pm »


                 I use the PRR system for custom factions and have about 40 total. However I have a bug that I cannot get rid of. It seems that my function is running adjust reputation twice on some of my custom faction creatures.
Here are my functions

This is in on module load:
DelayCommand(5.0, PRR_LoadModule());

This is PRR_LoadModule:
void PRR_LoadModule(){AWA_DEBUG( "Loading faction information..."); //debug
//AssignCommand(GetModule(), PRR_LoadFaction());//*AWA_LOAD_FACTORDelayCommand(1.0*AWA_LOAD_FACTOR, PRR_LoadFaction());DelayCommand(1.5*AWA_LOAD_FACTOR, PRR_LoadFaction());DelayCommand(2.0*AWA_LOAD_FACTOR, PRR_LoadFaction());DelayCommand(2.5*AWA_LOAD_FACTOR, PRR_LoadFaction());DelayCommand(3.0*AWA_LOAD_FACTOR, PRR_LoadFaction());DelayCommand(3.5*AWA_LOAD_FACTOR, PRR_LoadFaction());DelayCommand(4.0*AWA_LOAD_FACTOR, PRR_LoadFaction());DelayCommand(4.5*AWA_LOAD_FACTOR, PRR_LoadFaction());DelayCommand(5.0*AWA_LOAD_FACTOR, PRR_LoadFaction());DelayCommand(5.5*AWA_LOAD_FACTOR, PRR_LoadFaction());DelayCommand(6.0*AWA_LOAD_FACTOR, PRR_LoadFaction());DelayCommand(6.5*AWA_LOAD_FACTOR, PRR_LoadFaction());DelayCommand(7.0*AWA_LOAD_FACTOR, PRR_LoadFaction());DelayCommand(7.5*AWA_LOAD_FACTOR, PRR_LoadFaction());DelayCommand(8.0*AWA_LOAD_FACTOR, PRR_LoadFaction());DelayCommand(8.5*AWA_LOAD_FACTOR, PRR_LoadFaction());DelayCommand(9.0*AWA_LOAD_FACTOR, PRR_LoadFaction());DelayCommand(9.5*AWA_LOAD_FACTOR, PRR_LoadFaction());DelayCommand(10.0*AWA_LOAD_FACTOR, PRR_LoadFaction());DelayCommand(10.5*AWA_LOAD_FACTOR, PRR_LoadFaction());DelayCommand(11.0*AWA_LOAD_FACTOR, PRR_LoadFaction());DelayCommand(11.5*AWA_LOAD_FACTOR, PRR_LoadFaction());DelayCommand(12.0*AWA_LOAD_FACTOR, PRR_LoadFaction());DelayCommand(12.5*AWA_LOAD_FACTOR, PRR_LoadFaction());DelayCommand(13.0*AWA_LOAD_FACTOR, PRR_LoadFaction());DelayCommand(13.5*AWA_LOAD_FACTOR, PRR_LoadFaction());DelayCommand(14.0*AWA_LOAD_FACTOR, PRR_LoadFaction());DelayCommand(14.5*AWA_LOAD_FACTOR, PRR_LoadFaction());

This is PRR_LoadFaction
void PRR_LoadFaction()
{    
int nNth = GetLocalInt(GetModule(), "FactionFocus_Source");    
object oSourceFactionMember = GetObjectByTag("FACTION_FOCUS", nNth);//colunm    //while(oSourceFactionMember != OBJECT_INVALID)  
 if(oSourceFactionMember != OBJECT_INVALID)            
{            
int i = 0;            
object oTarget = GetObjectByTag("FACTION_FOCUS", i);//row            
//float fDelay;            
while(oTarget != OBJECT_INVALID)                  
 {                  
 string sSourceFactionMember = SQLEncodeSpecialChars(GetStringLowerCase(GetName(oSourceFactionMember)));                    
string sTarget = SQLEncodeSpecialChars(GetStringLowerCase(GetName(oTarget)));                    SQLExecDirect("SELECT " + sSourceFactionMember + " FROM tbl_factions WHERE tbl_player_player_character='" + sTarget + "'");                    if (SQLFetch())                            {                            int nAdjustment = StringToInt(SQLGetData(1));                            //fDelay += 0.10;// optional delay                            //DelayCommand( fDelay *AWA_LOAD_FACTOR, AdjustReputation( oFactionFocus, oTargetFocus, nAdjustRep ));//                            AdjustReputation( oTarget, oSourceFactionMember, nAdjustment );                            //AWA_DEBUG("PRR_LoadModule: target = "+GetName(oTarget)+" source = "+GetName(oSourceFactionMember)+" rep = "+IntToString(nAdjustment));                            }                            else                            {                            AWA_DEBUG("PRR ERROR: could not SELECT "+GetName(oSourceFactionMember)+" FROM tbl_factions WHERE tbl_player_player_character= "+GetName(oTarget));                            }                    i++;                    oTarget = GetObjectByTag("FACTION_FOCUS", i);                    }            }    //if (oSourceFactionMember == OBJECT_INVALID)            //{            //AWA_DEBUG("PRR_LoadFaction: finished "+GetName(oSourceFactionMember));            //nNth++;            SetLocalInt(GetModule(), "FactionFocus_Source", (GetLocalInt(GetModule(), "FactionFocus_Source") + 1) );            //}}

Thanks for any help
               
               

               


                     Modifié par DM_Vecna, 25 avril 2011 - 04:50 .
                     
                  


            

Legacy_DM_Vecna

  • Hero Member
  • *****
  • Posts: 501
  • Karma: +0/-0
Script issue with adjust reputation
« Reply #1 on: April 25, 2011, 08:19:18 am »


               In my debugging I made a breakthrough.

Here is a portion of my nwserverlog. It appears that somehow my while or if statment is going wonkers. To test this I set the adjust reputation to 50 instead of nAdjustment.

GameSpy Server Error: Unable to query the server. You may need to open port 3306 for incoming traffic.
[Mon Apr 25 00:14:26] *** Module load script commenced ***
[Mon Apr 25 00:14:36] Loading faction information...
[Mon Apr 25 00:14:36] 100
[Mon Apr 25 00:14:36] 50
[Mon Apr 25 00:14:36] 50
[Mon Apr 25 00:14:36] 50
[Mon Apr 25 00:14:36] 50
[Mon Apr 25 00:14:36] 50
[Mon Apr 25 00:14:36] 50
[Mon Apr 25 00:14:36] 50
[Mon Apr 25 00:14:36] 50
[Mon Apr 25 00:14:36] 50
[Mon Apr 25 00:14:36] 50
[Mon Apr 25 00:14:36] 50
[Mon Apr 25 00:14:36] 50
[Mon Apr 25 00:14:36] 50
[Mon Apr 25 00:14:36] 50
[Mon Apr 25 00:14:36] 50
[Mon Apr 25 00:14:36] 50
[Mon Apr 25 00:14:36] 50
[Mon Apr 25 00:14:36] 50
[Mon Apr 25 00:14:36] 50
[Mon Apr 25 00:14:36] 50
[Mon Apr 25 00:14:36] 50
[Mon Apr 25 00:14:36] 50
[Mon Apr 25 00:14:36] 50
[Mon Apr 25 00:14:36] 50
[Mon Apr 25 00:14:36] 50
[Mon Apr 25 00:14:36] 50
[Mon Apr 25 00:14:36] 50
[Mon Apr 25 00:14:36] PRR_LoadFaction: finished unknown
[Mon Apr 25 00:14:36] 100
[Mon Apr 25 00:14:36] 100
[Mon Apr 25 00:14:36] 50
[Mon Apr 25 00:14:36] 50
[Mon Apr 25 00:14:36] 50
[Mon Apr 25 00:14:36] 50
[Mon Apr 25 00:14:36] 50
[Mon Apr 25 00:14:36] 50
[Mon Apr 25 00:14:36] 50
[Mon Apr 25 00:14:36] 50
[Mon Apr 25 00:14:36] 50
[Mon Apr 25 00:14:36] 50
[Mon Apr 25 00:14:36] 50
[Mon Apr 25 00:14:36] 50
[Mon Apr 25 00:14:36] 50
[Mon Apr 25 00:14:36] 50
[Mon Apr 25 00:14:36] 50
[Mon Apr 25 00:14:36] 50
[Mon Apr 25 00:14:36] 50
[Mon Apr 25 00:14:36] 50
[Mon Apr 25 00:14:36] 50
[Mon Apr 25 00:14:36] 50
[Mon Apr 25 00:14:36] 50
[Mon Apr 25 00:14:36] 50
[Mon Apr 25 00:14:36] 50
[Mon Apr 25 00:14:36] 50
[Mon Apr 25 00:14:36] 50
[Mon Apr 25 00:14:36] 50
[Mon Apr 25 00:14:36] PRR_LoadFaction: finished undead
[Mon Apr 25 00:14:36] 100
[Mon Apr 25 00:14:36] 100
[Mon Apr 25 00:14:36] 100
[Mon Apr 25 00:14:36] 50
[Mon Apr 25 00:14:36] 50
[Mon Apr 25 00:14:36] 50
[Mon Apr 25 00:14:36] 50
[Mon Apr 25 00:14:36] 50
[Mon Apr 25 00:14:36] 50
[Mon Apr 25 00:14:36] 50
[Mon Apr 25 00:14:36] 50
[Mon Apr 25 00:14:36] 50
[Mon Apr 25 00:14:36] 50
[Mon Apr 25 00:14:36] 50
[Mon Apr 25 00:14:36] 50
[Mon Apr 25 00:14:36] 50
[Mon Apr 25 00:14:36] 50
[Mon Apr 25 00:14:36] 50
[Mon Apr 25 00:14:36] 50
[Mon Apr 25 00:14:36] 50
[Mon Apr 25 00:14:36] 50
[Mon Apr 25 00:14:36] 50
[Mon Apr 25 00:14:36] 50
[Mon Apr 25 00:14:36] 50
[Mon Apr 25 00:14:36] 50
[Mon Apr 25 00:14:36] 50
[Mon Apr 25 00:14:36] 50
[Mon Apr 25 00:14:36] 50
[Mon Apr 25 00:14:36] PRR_LoadFaction: finished mulrok
[Mon Apr 25 00:14:36] 100
[Mon Apr 25 00:14:36] 100
[Mon Apr 25 00:14:36] 100
[Mon Apr 25 00:14:36] 100
[Mon Apr 25 00:14:36] 50
[Mon Apr 25 00:14:36] 50
[Mon Apr 25 00:14:36] 50
[Mon Apr 25 00:14:36] 50
[Mon Apr 25 00:14:36] 50
[Mon Apr 25 00:14:36] 50
[Mon Apr 25 00:14:36] 50
[Mon Apr 25 00:14:36] 50
[Mon Apr 25 00:14:36] 50
[Mon Apr 25 00:14:36] 50
[Mon Apr 25 00:14:36] 50
[Mon Apr 25 00:14:36] 50
[Mon Apr 25 00:14:36] 50
[Mon Apr 25 00:14:36] 50
[Mon Apr 25 00:14:36] 50
[Mon Apr 25 00:14:36] 50
[Mon Apr 25 00:14:36] 50
[Mon Apr 25 00:14:36] 50
[Mon Apr 25 00:14:36] 50
[Mon Apr 25 00:14:36] 50
[Mon Apr 25 00:14:36] 50
[Mon Apr 25 00:14:36] 50
[Mon Apr 25 00:14:36] 50
[Mon Apr 25 00:14:36] 50
[Mon Apr 25 00:14:36] PRR_LoadFaction: finished spell_target
[Mon Apr 25 00:14:36] 100
[Mon Apr 25 00:14:36] 100
[Mon Apr 25 00:14:36] 100
[Mon Apr 25 00:14:36] 100
[Mon Apr 25 00:14:36] 100
[Mon Apr 25 00:14:36] 50
[Mon Apr 25 00:14:36] 50
[Mon Apr 25 00:14:36] 50
[Mon Apr 25 00:14:36] 50
[Mon Apr 25 00:14:36] 50
[Mon Apr 25 00:14:36] 50
[Mon Apr 25 00:14:36] 50
[Mon Apr 25 00:14:36] 50
[Mon Apr 25 00:14:36] 50
[Mon Apr 25 00:14:36] 50
[Mon Apr 25 00:14:36] 50
[Mon Apr 25 00:14:36] 50
[Mon Apr 25 00:14:36] 50
[Mon Apr 25 00:14:36] 50
[Mon Apr 25 00:14:36] 50
[Mon Apr 25 00:14:36] 50
[Mon Apr 25 00:14:36] 50
[Mon Apr 25 00:14:36] 50
[Mon Apr 25 00:14:36] 50
[Mon Apr 25 00:14:36] 50
[Mon Apr 25 00:14:36] 50
[Mon Apr 25 00:14:36] 50
[Mon Apr 25 00:14:36] 50
[Mon Apr 25 00:14:36] PRR_LoadFaction: finished animal
[Mon Apr 25 00:14:36] 100
[Mon Apr 25 00:14:36] 100
[Mon Apr 25 00:14:36] 100
[Mon Apr 25 00:14:36] 100
[Mon Apr 25 00:14:36] 100
[Mon Apr 25 00:14:36] 100
[Mon Apr 25 00:14:36] 50
[Mon Apr 25 00:14:36] 50
[Mon Apr 25 00:14:36] 50
[Mon Apr 25 00:14:36] 50
[Mon Apr 25 00:14:36] 50
[Mon Apr 25 00:14:36] 50
[Mon Apr 25 00:14:36] 50
[Mon Apr 25 00:14:36] 50
[Mon Apr 25 00:14:36] 50
[Mon Apr 25 00:14:36] 50
[Mon Apr 25 00:14:36] 50
[Mon Apr 25 00:14:36] 50
[Mon Apr 25 00:14:36] 50
[Mon Apr 25 00:14:36] 50
[Mon Apr 25 00:14:36] 50
[Mon Apr 25 00:14:36] 50
[Mon Apr 25 00:14:36] 50
[Mon Apr 25 00:14:36] 50
[Mon Apr 25 00:14:36] 50
[Mon Apr 25 00:14:36] 50
[Mon Apr 25 00:14:36] 50
[Mon Apr 25 00:14:36] 50
[Mon Apr 25 00:14:36] PRR_LoadFaction: finished rogue
[Mon Apr 25 00:14:37] 100
[Mon Apr 25 00:14:37] 100
[Mon Apr 25 00:14:37] 100
[Mon Apr 25 00:14:37] 100
[Mon Apr 25 00:14:37] 100
[Mon Apr 25 00:14:37] 100
[Mon Apr 25 00:14:37] 100
[Mon Apr 25 00:14:37] 50
[Mon Apr 25 00:14:37] 50
[Mon Apr 25 00:14:37] 50
[Mon Apr 25 00:14:37] 50
[Mon Apr 25 00:14:37] 50
[Mon Apr 25 00:14:37] 50
[Mon Apr 25 00:14:37] 50
[Mon Apr 25 00:14:37] 50
[Mon Apr 25 00:14:37] 50
[Mon Apr 25 00:14:37] 50
[Mon Apr 25 00:14:37] 50
[Mon Apr 25 00:14:37] 50
[Mon Apr 25 00:14:37] 50
[Mon Apr 25 00:14:37] 50
[Mon Apr 25 00:14:37] 50
[Mon Apr 25 00:14:37] 50
[Mon Apr 25 00:14:37] 50
[Mon Apr 25 00:14:37] 50
[Mon Apr 25 00:14:37] 50
[Mon Apr 25 00:14:37] 50
[Mon Apr 25 00:14:37] 50
[Mon Apr 25 00:14:37] PRR_LoadFaction: finished neutral_dungeon
[Mon Apr 25 00:14:37] 100
[Mon Apr 25 00:14:37] 100
[Mon Apr 25 00:14:37] 100
[Mon Apr 25 00:14:37] 100
[Mon Apr 25 00:14:37] 100
[Mon Apr 25 00:14:37] 100
[Mon Apr 25 00:14:37] 100
[Mon Apr 25 00:14:37] 100
[Mon Apr 25 00:14:37] 50
[Mon Apr 25 00:14:37] 50
[Mon Apr 25 00:14:37] 50
[Mon Apr 25 00:14:37] 50
[Mon Apr 25 00:14:37] 50
[Mon Apr 25 00:14:37] 50
[Mon Apr 25 00:14:37] 50
[Mon Apr 25 00:14:37] 50
[Mon Apr 25 00:14:37] 50
[Mon Apr 25 00:14:37] 50
[Mon Apr 25 00:14:37] 50
[Mon Apr 25 00:14:37] 50
[Mon Apr 25 00:14:37] 50
[Mon Apr 25 00:14:37] 50
[Mon Apr 25 00:14:37] 50
[Mon Apr 25 00:14:37] 50
[Mon Apr 25 00:14:37] 50
[Mon Apr 25 00:14:37] 50
[Mon Apr 25 00:14:37] 50
[Mon Apr 25 00:14:37] 50
[Mon Apr 25 00:14:37] PRR_LoadFaction: finished hextorite
[Mon Apr 25 00:14:37] 100
[Mon Apr 25 00:14:37] 100
[Mon Apr 25 00:14:37] 100
[Mon Apr 25 00:14:37] 100
[Mon Apr 25 00:14:37] 100
[Mon Apr 25 00:14:37] 100
[Mon Apr 25 00:14:37] 100
[Mon Apr 25 00:14:37] 100
[Mon Apr 25 00:14:37] 100
[Mon Apr 25 00:14:37] 50
[Mon Apr 25 00:14:37] 50
[Mon Apr 25 00:14:37] 50
[Mon Apr 25 00:14:37] 50
[Mon Apr 25 00:14:37] 50
[Mon Apr 25 00:14:37] 50
[Mon Apr 25 00:14:37] 50
[Mon Apr 25 00:14:37] 50
[Mon Apr 25 00:14:37] 50
[Mon Apr 25 00:14:37] 50
[Mon Apr 25 00:14:37] 50
[Mon Apr 25 00:14:37] 50
[Mon Apr 25 00:14:37] 50
[Mon Apr 25 00:14:37] 50
[Mon Apr 25 00:14:37] 50
[Mon Apr 25 00:14:37] 50
[Mon Apr 25 00:14:37] 50
[Mon Apr 25 00:14:37] 50
[Mon Apr 25 00:14:37] 50
[Mon Apr 25 00:14:37] PRR_LoadFaction: finished elelhadez
[Mon Apr 25 00:14:37] 100
[Mon Apr 25 00:14:37] 100
[Mon Apr 25 00:14:37] 100
[Mon Apr 25 00:14:37] 100
[Mon Apr 25 00:14:37] 100
[Mon Apr 25 00:14:37] 100
[Mon Apr 25 00:14:37] 100
[Mon Apr 25 00:14:37] 100
[Mon Apr 25 00:14:37] 100
[Mon Apr 25 00:14:37] 100
[Mon Apr 25 00:14:37] 50
[Mon Apr 25 00:14:37] 50
[Mon Apr 25 00:14:37] 50
[Mon Apr 25 00:14:37] 50
[Mon Apr 25 00:14:37] 50
[Mon Apr 25 00:14:37] 50
[Mon Apr 25 00:14:37] 50
[Mon Apr 25 00:14:37] 50
[Mon Apr 25 00:14:37] 50
[Mon Apr 25 00:14:37] 50
[Mon Apr 25 00:14:37] 50
[Mon Apr 25 00:14:37] 50
[Mon Apr 25 00:14:37] 50
[Mon Apr 25 00:14:37] 50
[Mon Apr 25 00:14:37] 50
[Mon Apr 25 00:14:37] 50
[Mon Apr 25 00:14:37] 50
[Mon Apr 25 00:14:37] 50
[Mon Apr 25 00:14:37] PRR_LoadFaction: finished vlaskyoriil
[Mon Apr 25 00:14:37] 100
[Mon Apr 25 00:14:37] 100
[Mon Apr 25 00:14:37] 100
[Mon Apr 25 00:14:37] 100
[Mon Apr 25 00:14:37] 100
[Mon Apr 25 00:14:37] 100
[Mon Apr 25 00:14:37] 100
[Mon Apr 25 00:14:37] 100
[Mon Apr 25 00:14:37] 100
[Mon Apr 25 00:14:37] 100
[Mon Apr 25 00:14:37] 100
[Mon Apr 25 00:14:37] 50
[Mon Apr 25 00:14:37] 50
[Mon Apr 25 00:14:37] 50
[Mon Apr 25 00:14:37] 50
[Mon Apr 25 00:14:37] 50
[Mon Apr 25 00:14:37] 50
[Mon Apr 25 00:14:37] 50
[Mon Apr 25 00:14:37] 50
[Mon Apr 25 00:14:37] 50
[Mon Apr 25 00:14:37] 50
[Mon Apr 25 00:14:37] 50
[Mon Apr 25 00:14:37] 50
[Mon Apr 25 00:14:37] 50
[Mon Apr 25 00:14:37] 50
[Mon Apr 25 00:14:37] 50
[Mon Apr 25 00:14:37] 50
[Mon Apr 25 00:14:37] 50
[Mon Apr 25 00:14:37] PRR_LoadFaction: finished blackwillow
[Mon Apr 25 00:14:37] 100
[Mon Apr 25 00:14:37] 100
[Mon Apr 25 00:14:37] 100
[Mon Apr 25 00:14:37] 100
[Mon Apr 25 00:14:37] 100
[Mon Apr 25 00:14:37] 100
[Mon Apr 25 00:14:37] 100
[Mon Apr 25 00:14:37] 100
[Mon Apr 25 00:14:37] 100
[Mon Apr 25 00:14:37] 100
[Mon Apr 25 00:14:37] 100
[Mon Apr 25 00:14:37] 100
[Mon Apr 25 00:14:37] 50
[Mon Apr 25 00:14:37] 50
[Mon Apr 25 00:14:37] 50
[Mon Apr 25 00:14:37] 50
[Mon Apr 25 00:14:37] 50
[Mon Apr 25 00:14:37] 50
[Mon Apr 25 00:14:37] 50
[Mon Apr 25 00:14:37] 50
[Mon Apr 25 00:14:37] 50
[Mon Apr 25 00:14:37] 50
[Mon Apr 25 00:14:37] 50
[Mon Apr 25 00:14:37] 50
[Mon Apr 25 00:14:37] 50
[Mon Apr 25 00:14:37] 50
[Mon Apr 25 00:14:37] 50
[Mon Apr 25 00:14:37] 50
[Mon Apr 25 00:14:37] PRR_LoadFaction: finished tarantula
[Mon Apr 25 00:14:37] 100
[Mon Apr 25 00:14:37] 100
[Mon Apr 25 00:14:37] 100
[Mon Apr 25 00:14:37] 100
[Mon Apr 25 00:14:37] 100
[Mon Apr 25 00:14:37] 100
[Mon Apr 25 00:14:37] 100
[Mon Apr 25 00:14:37] 100
[Mon Apr 25 00:14:37] 100
[Mon Apr 25 00:14:37] 100
[Mon Apr 25 00:14:37] 100
[Mon Apr 25 00:14:37] 100
[Mon Apr 25 00:14:37] 100
[Mon Apr 25 00:14:37] 50
[Mon Apr 25 00:14:37] 50
[Mon Apr 25 00:14:37] 50
[Mon Apr 25 00:14:37] 50
[Mon Apr 25 00:14:37] 50
[Mon Apr 25 00:14:37] 50
[Mon Apr 25 00:14:37] 50
[Mon Apr 25 00:14:37] 50
[Mon Apr 25 00:14:37] 50
[Mon Apr 25 00:14:37] 50
[Mon Apr 25 00:14:37] 50
[Mon Apr 25 00:14:37] 50
[Mon Apr 25 00:14:37] 50
[Mon Apr 25 00:14:37] 50
[Mon Apr 25 00:14:37] 50
[Mon Apr 25 00:14:37] PRR_LoadFaction: finished orc_2
[Mon Apr 25 00:14:37] 100
[Mon Apr 25 00:14:37] 100
[Mon Apr 25 00:14:37] 100
[Mon Apr 25 00:14:37] 100
[Mon Apr 25 00:14:37] 100
[Mon Apr 25 00:14:37] 100
[Mon Apr 25 00:14:37] 100
[Mon Apr 25 00:14:37] 100
[Mon Apr 25 00:14:37] 100
[Mon Apr 25 00:14:37] 100
[Mon Apr 25 00:14:37] 100
[Mon Apr 25 00:14:37] 100
[Mon Apr 25 00:14:37] 100
[Mon Apr 25 00:14:37] 100
[Mon Apr 25 00:14:37] 50
[Mon Apr 25 00:14:37] 50
[Mon Apr 25 00:14:37] 50
[Mon Apr 25 00:14:37] 50
[Mon Apr 25 00:14:37] 50
[Mon Apr 25 00:14:37] 50
[Mon Apr 25 00:14:37] 50
[Mon Apr 25 00:14:37] 50
[Mon Apr 25 00:14:37] 50
[Mon Apr 25 00:14:37] 50
[Mon Apr 25 00:14:37] 50
[Mon Apr 25 00:14:37] 50
[Mon Apr 25 00:14:37] 50
[Mon Apr 25 00:14:37] 50
[Mon Apr 25 00:14:37] PRR_LoadFaction: finished orc_1
[Mon Apr 25 00:14:38] 100
[Mon Apr 25 00:14:38] 100
[Mon Apr 25 00:14:38] 100
[Mon Apr 25 00:14:38] 100
[Mon Apr 25 00:14:38] 100
[Mon Apr 25 00:14:38] 100
[Mon Apr 25 00:14:38] 100
[Mon Apr 25 00:14:38] 100
[Mon Apr 25 00:14:38] 100
[Mon Apr 25 00:14:38] 100
[Mon Apr 25 00:14:38] 100
[Mon Apr 25 00:14:38] 100
[Mon Apr 25 00:14:38] 100
[Mon Apr 25 00:14:38] 100
[Mon Apr 25 00:14:38] 100
[Mon Apr 25 00:14:38] 50
[Mon Apr 25 00:14:38] 50
[Mon Apr 25 00:14:38] 50
[Mon Apr 25 00:14:38] 50
[Mon Apr 25 00:14:38] 50
[Mon Apr 25 00:14:38] 50
[Mon Apr 25 00:14:38] 50
[Mon Apr 25 00:14:38] 50
[Mon Apr 25 00:14:38] 50
[Mon Apr 25 00:14:38] 50
[Mon Apr 25 00:14:38] 50
[Mon Apr 25 00:14:38] 50
[Mon Apr 25 00:14:38] 50
[Mon Apr 25 00:14:38] PRR_LoadFaction: finished dwarven
[Mon Apr 25 00:14:38] 100
[Mon Apr 25 00:14:38] 100
[Mon Apr 25 00:14:38] 100
[Mon Apr 25 00:14:38] 100
[Mon Apr 25 00:14:38] 100
[Mon Apr 25 00:14:38] 100
[Mon Apr 25 00:14:38] 100
[Mon Apr 25 00:14:38] 100
[Mon Apr 25 00:14:38] 100
[Mon Apr 25 00:14:38] 100
[Mon Apr 25 00:14:38] 100
[Mon Apr 25 00:14:38] 100
[Mon Apr 25 00:14:38] 100
[Mon Apr 25 00:14:38] 100
[Mon Apr 25 00:14:38] 100
[Mon Apr 25 00:14:38] 100
[Mon Apr 25 00:14:38] 50
[Mon Apr 25 00:14:38] 50
[Mon Apr 25 00:14:38] 50
[Mon Apr 25 00:14:38] 50
[Mon Apr 25 00:14:38] 50
[Mon Apr 25 00:14:38] 50
[Mon Apr 25 00:14:38] 50
[Mon Apr 25 00:14:38] 50
[Mon Apr 25 00:14:38] 50
[Mon Apr 25 00:14:38] 50
[Mon Apr 25 00:14:38] 50
[Mon Apr 25 00:14:38] 50
[Mon Apr 25 00:14:38] PRR_LoadFaction: finished elven
[Mon Apr 25 00:14:38] 100
[Mon Apr 25 00:14:38] 100
[Mon Apr 25 00:14:38] 100
[Mon Apr 25 00:14:38] 100
[Mon Apr 25 00:14:38] 100
[Mon Apr 25 00:14:38] 100
[Mon Apr 25 00:14:38] 100
[Mon Apr 25 00:14:38] 100
[Mon Apr 25 00:14:38] 100
[Mon Apr 25 00:14:38] 100
[Mon Apr 25 00:14:38] 100
[Mon Apr 25 00:14:38] 100
[Mon Apr 25 00:14:38] 100
[Mon Apr 25 00:14:38] 100
[Mon Apr 25 00:14:38] 100
[Mon Apr 25 00:14:38] 100
[Mon Apr 25 00:14:38] 100
[Mon Apr 25 00:14:38] 50
[Mon Apr 25 00:14:38] 50
[Mon Apr 25 00:14:38] 50
[Mon Apr 25 00:14:38] 50
[Mon Apr 25 00:14:38] 50
[Mon Apr 25 00:14:38] 50
[Mon Apr 25 00:14:38] 50
[Mon Apr 25 00:14:38] 50
[Mon Apr 25 00:14:38] 50
[Mon Apr 25 00:14:38] 50
[Mon Apr 25 00:14:38] 50
[Mon Apr 25 00:14:38] PRR_LoadFaction: finished ing
[Mon Apr 25 00:14:38] 100
[Mon Apr 25 00:14:38] 100
[Mon Apr 25 00:14:38] 100
[Mon Apr 25 00:14:38] 100
[Mon Apr 25 00:14:38] 100
[Mon Apr 25 00:14:38] 100
[Mon Apr 25 00:14:38] 100
[Mon Apr 25 00:14:38] 100
[Mon Apr 25 00:14:38] 100
[Mon Apr 25 00:14:38] 100
[Mon Apr 25 00:14:38] 100
[Mon Apr 25 00:14:38] 100
[Mon Apr 25 00:14:38] 100
[Mon Apr 25 00:14:38] 100
[Mon Apr 25 00:14:38] 100
[Mon Apr 25 00:14:38] 100
[Mon Apr 25 00:14:38] 100
[Mon Apr 25 00:14:38] 100
[Mon Apr 25 00:14:38] 50
[Mon Apr 25 00:14:38] 50
[Mon Apr 25 00:14:38] 50
[Mon Apr 25 00:14:38] 50
[Mon Apr 25 00:14:38] 50
[Mon Apr 25 00:14:38] 50
[Mon Apr 25 00:14:38] 50
[Mon Apr 25 00:14:38] 50
[Mon Apr 25 00:14:38] 50
[Mon Apr 25 00:14:38] 50
[Mon Apr 25 00:14:38] PRR_LoadFaction: finished gnoll
[Mon Apr 25 00:14:38] 100
[Mon Apr 25 00:14:38] 100
[Mon Apr 25 00:14:38] 100
[Mon Apr 25 00:14:38] 100
[Mon Apr 25 00:14:38] 100
[Mon Apr 25 00:14:38] 100
[Mon Apr 25 00:14:38] 100
[Mon Apr 25 00:14:38] 100
[Mon Apr 25 00:14:38] 100
[Mon Apr 25 00:14:38] 100
[Mon Apr 25 00:14:38] 100
[Mon Apr 25 00:14:38] 100
[Mon Apr 25 00:14:38] 100
[Mon Apr 25 00:14:38] 100
[Mon Apr 25 00:14:38] 100
[Mon Apr 25 00:14:38] 100
[Mon Apr 25 00:14:38] 100
[Mon Apr 25 00:14:38] 100
[Mon Apr 25 00:14:38] 100
[Mon Apr 25 00:14:38] 50
[Mon Apr 25 00:14:38] 50
[Mon Apr 25 00:14:38] 50
[Mon Apr 25 00:14:38] 50
[Mon Apr 25 00:14:38] 50
[Mon Apr 25 00:14:38] 50
[Mon Apr 25 00:14:38] 50
[Mon Apr 25 00:14:38] 50
[Mon Apr 25 00:14:38] 50
[Mon Apr 25 00:14:38] PRR_LoadFaction: finished halfling
[Mon Apr 25 00:14:38] 100
[Mon Apr 25 00:14:38] 100
[Mon Apr 25 00:14:38] 100
[Mon Apr 25 00:14:38] 100
[Mon Apr 25 00:14:38] 100
[Mon Apr 25 00:14:38] 100
[Mon Apr 25 00:14:38] 100
[Mon Apr 25 00:14:38] 100
[Mon Apr 25 00:14:38] 100
[Mon Apr 25 00:14:38] 100
[Mon Apr 25 00:14:38] 100
[Mon Apr 25 00:14:38] 100
[Mon Apr 25 00:14:38] 100
[Mon Apr 25 00:14:38] 100
[Mon Apr 25 00:14:38] 100
[Mon Apr 25 00:14:38] 100
[Mon Apr 25 00:14:38] 100
[Mon Apr 25 00:14:38] 100
[Mon Apr 25 00:14:38] 100
[Mon Apr 25 00:14:38] 100
[Mon Apr 25 00:14:38] 50
[Mon Apr 25 00:14:38] 50
[Mon Apr 25 00:14:38] 50
[Mon Apr 25 00:14:38] 50
[Mon Apr 25 00:14:38] 50
[Mon Apr 25 00:14:38] 50
[Mon Apr 25 00:14:38] 50
[Mon Apr 25 00:14:38] 50
[Mon Apr 25 00:14:38] PRR_LoadFaction: finished gnomish
[Mon Apr 25 00:14:38] 100
[Mon Apr 25 00:14:38] 100
[Mon Apr 25 00:14:38] 100
[Mon Apr 25 00:14:38] 100
[Mon Apr 25 00:14:38] 100
[Mon Apr 25 00:14:38] 100
[Mon Apr 25 00:14:38] 100
[Mon Apr 25 00:14:38] 100
[Mon Apr 25 00:14:38] 100
[Mon Apr 25 00:14:38] 100
[Mon Apr 25 00:14:38] 100
[Mon Apr 25 00:14:38] 100
[Mon Apr 25 00:14:38] 100
[Mon Apr 25 00:14:38] 100
[Mon Apr 25 00:14:38] 100
[Mon Apr 25 00:14:38] 100
[Mon Apr 25 00:14:38] 100
[Mon Apr 25 00:14:38] 100
[Mon Apr 25 00:14:38] 100
[Mon Apr 25 00:14:38] 100
[Mon Apr 25 00:14:38] 100
[Mon Apr 25 00:14:38] 50
[Mon Apr 25 00:14:38] 50
[Mon Apr 25 00:14:38] 50
[Mon Apr 25 00:14:38] 50
[Mon Apr 25 00:14:38] 50
[Mon Apr 25 00:14:38] 50
[Mon Apr 25 00:14:38] 50
[Mon Apr 25 00:14:38] PRR_LoadFaction: finished svirfneblin
[Mon Apr 25 00:14:38] 100
[Mon Apr 25 00:14:38] 100
[Mon Apr 25 00:14:38] 100
[Mon Apr 25 00:14:38] 100
[Mon Apr 25 00:14:38] 100
[Mon Apr 25 00:14:38] 100
[Mon Apr 25 00:14:38] 100
[Mon Apr 25 00:14:38] 100
[Mon Apr 25 00:14:38] 100
[Mon Apr 25 00:14:38] 100
[Mon Apr 25 00:14:38] 100
[Mon Apr 25 00:14:38] 100
[Mon Apr 25 00:14:38] 100
[Mon Apr 25 00:14:38] 100
[Mon Apr 25 00:14:38] 100
[Mon Apr 25 00:14:38] 100
[Mon Apr 25 00:14:38] 100
[Mon Apr 25 00:14:38] 100
[Mon Apr 25 00:14:38] 100
[Mon Apr 25 00:14:38] 100
[Mon Apr 25 00:14:38] 100
[Mon Apr 25 00:14:38] 100
[Mon Apr 25 00:14:38] 50
[Mon Apr 25 00:14:38] 50
[Mon Apr 25 00:14:38] 50
[Mon Apr 25 00:14:38] 50
[Mon Apr 25 00:14:38] 50
[Mon Apr 25 00:14:38] 50
[Mon Apr 25 00:14:38] PRR_LoadFaction: finished duergar
[Mon Apr 25 00:14:39] 100
[Mon Apr 25 00:14:39] 100
[Mon Apr 25 00:14:39] 100
[Mon Apr 25 00:14:39] 100
[Mon Apr 25 00:14:39] 100
[Mon Apr 25 00:14:39] 100
[Mon Apr 25 00:14:39] 100
[Mon Apr 25 00:14:39] 100
[Mon Apr 25 00:14:39] 100
[Mon Apr 25 00:14:39] 100
[Mon Apr 25 00:14:39] 100
[Mon Apr 25 00:14:39] 100
[Mon Apr 25 00:14:39] 100
[Mon Apr 25 00:14:39] 100
[Mon Apr 25 00:14:39] 100
[Mon Apr 25 00:14:39] 100
[Mon Apr 25 00:14:39] 100
[Mon Apr 25 00:14:39] 100
[Mon Apr 25 00:14:39] 100
[Mon Apr 25 00:14:39] 100
[Mon Apr 25 00:14:39] 100
[Mon Apr 25 00:14:39] 100
[Mon Apr 25 00:14:39] 100
[Mon Apr 25 00:14:39] 50
[Mon Apr 25 00:14:39] 50
[Mon Apr 25 00:14:39] 50
[Mon Apr 25 00:14:39] 50
[Mon Apr 25 00:14:39] 50
[Mon Apr 25 00:14:39] PRR_LoadFaction: finished jacala
[Mon Apr 25 00:14:39] 100
[Mon Apr 25 00:14:39] 100
[Mon Apr 25 00:14:39] 100
[Mon Apr 25 00:14:39] 100
[Mon Apr 25 00:14:39] 100
[Mon Apr 25 00:14:39] 100
[Mon Apr 25 00:14:39] 100
[Mon Apr 25 00:14:39] 100
[Mon Apr 25 00:14:39] 100
[Mon Apr 25 00:14:39] 100
[Mon Apr 25 00:14:39] 100
[Mon Apr 25 00:14:39] 100
[Mon Apr 25 00:14:39] 100
[Mon Apr 25 00:14:39] 100
[Mon Apr 25 00:14:39] 100
[Mon Apr 25 00:14:39] 100
[Mon Apr 25 00:14:39] 100
[Mon Apr 25 00:14:39] 100
[Mon Apr 25 00:14:39] 100
[Mon Apr 25 00:14:39] 100
[Mon Apr 25 00:14:39] 100
[Mon Apr 25 00:14:39] 100
[Mon Apr 25 00:14:39] 100
[Mon Apr 25 00:14:39] 100
[Mon Apr 25 00:14:39] 50
[Mon Apr 25 00:14:39] 50
[Mon Apr 25 00:14:39] 50
[Mon Apr 25 00:14:39] 50
[Mon Apr 25 00:14:39] PRR_LoadFaction: finished jumon
[Mon Apr 25 00:14:39] 100
[Mon Apr 25 00:14:39] 100
[Mon Apr 25 00:14:39] 100
[Mon Apr 25 00:14:39] 100
[Mon Apr 25 00:14:39] 100
[Mon Apr 25 00:14:39] 100
[Mon Apr 25 00:14:39] 100
[Mon Apr 25 00:14:39] 100
[Mon Apr 25 00:14:39] 100
[Mon Apr 25 00:14:39] 100
[Mon Apr 25 00:14:39] 100
[Mon Apr 25 00:14:39] 100
[Mon Apr 25 00:14:39] 100
[Mon Apr 25 00:14:39] 100
[Mon Apr 25 00:14:39] 100
[Mon Apr 25 00:14:39] 100
[Mon Apr 25 00:14:39] 100
[Mon Apr 25 00:14:39] 100
[Mon Apr 25 00:14:39] 100
[Mon Apr 25 00:14:39] 100
[Mon Apr 25 00:14:39] 100
[Mon Apr 25 00:14:39] 100
[Mon Apr 25 00:14:39] 100
[Mon Apr 25 00:14:39] 100
[Mon Apr 25 00:14:39] 100
[Mon Apr 25 00:14:39] 50
[Mon Apr 25 00:14:39] 50
[Mon Apr 25 00:14:39] 50
[Mon Apr 25 00:14:39] PRR_LoadFaction: finished rhumanian
[Mon Apr 25 00:14:39] 100
[Mon Apr 25 00:14:39] 100
[Mon Apr 25 00:14:39] 100
[Mon Apr 25 00:14:39] 100
[Mon Apr 25 00:14:39] 100
[Mon Apr 25 00:14:39] 100
[Mon Apr 25 00:14:39] 100
[Mon Apr 25 00:14:39] 100
[Mon Apr 25 00:14:39] 100
[Mon Apr 25 00:14:39] 100
[Mon Apr 25 00:14:39] 100
[Mon Apr 25 00:14:39] 100
[Mon Apr 25 00:14:39] 100
[Mon Apr 25 00:14:39] 100
[Mon Apr 25 00:14:39] 100
[Mon Apr 25 00:14:39] 100
[Mon Apr 25 00:14:39] 100
[Mon Apr 25 00:14:39] 100
[Mon Apr 25 00:14:39] 100
[Mon Apr 25 00:14:39] 100
[Mon Apr 25 00:14:39] 100
[Mon Apr 25 00:14:39] 100
[Mon Apr 25 00:14:39] 100
[Mon Apr 25 00:14:39] 100
[Mon Apr 25 00:14:39] 100
[Mon Apr 25 00:14:39] 100
[Mon Apr 25 00:14:39] 50
[Mon Apr 25 00:14:39] 50
[Mon Apr 25 00:14:39] PRR_LoadFaction: finished hebdezi
[Mon Apr 25 00:14:39] 100
[Mon Apr 25 00:14:39] 100
[Mon Apr 25 00:14:39] 100
[Mon Apr 25 00:14:39] 100
[Mon Apr 25 00:14:39] 100
[Mon Apr 25 00:14:39] 100
[Mon Apr 25 00:14:39] 100
[Mon Apr 25 00:14:39] 100
[Mon Apr 25 00:14:39] 100
[Mon Apr 25 00:14:39] 100
[Mon Apr 25 00:14:39] 100
[Mon Apr 25 00:14:39] 100
[Mon Apr 25 00:14:39] 100
[Mon Apr 25 00:14:39] 100
[Mon Apr 25 00:14:39] 100
[Mon Apr 25 00:14:39] 100
[Mon Apr 25 00:14:39] 100
[Mon Apr 25 00:14:39] 100
[Mon Apr 25 00:14:39] 100
[Mon Apr 25 00:14:39] 100
[Mon Apr 25 00:14:39] 100
[Mon Apr 25 00:14:39] 100
[Mon Apr 25 00:14:39] 100
[Mon Apr 25 00:14:39] 100
[Mon Apr 25 00:14:39] 100
[Mon Apr 25 00:14:39] 100
[Mon Apr 25 00:14:39] 100
[Mon Apr 25 00:14:39] 50
[Mon Apr 25 00:14:39] PRR_LoadFaction: finished aspian
[Mon Apr 25 00:14:39] 100
[Mon Apr 25 00:14:39] 100
[Mon Apr 25 00:14:39] 100
[Mon Apr 25 00:14:39] 100
[Mon Apr 25 00:14:39] 100
[Mon Apr 25 00:14:39] 100
[Mon Apr 25 00:14:39] 100
[Mon Apr 25 00:14:39] 100
[Mon Apr 25 00:14:39] 100
[Mon Apr 25 00:14:39] 100
[Mon Apr 25 00:14:39] 100
[Mon Apr 25 00:14:39] 100
[Mon Apr 25 00:14:39] 100
[Mon Apr 25 00:14:39] 100
[Mon Apr 25 00:14:39] 100
[Mon Apr 25 00:14:39] 100
[Mon Apr 25 00:14:39] 100
[Mon Apr 25 00:14:39] 100
[Mon Apr 25 00:14:39] 100
[Mon Apr 25 00:14:39] 100
[Mon Apr 25 00:14:39] 100
[Mon Apr 25 00:14:39] 100
[Mon Apr 25 00:14:39] 100
[Mon Apr 25 00:14:39] 100
[Mon Apr 25 00:14:39] 100
[Mon Apr 25 00:14:39] 100
[Mon Apr 25 00:14:39] 100
[Mon Apr 25 00:14:39] 100
               
               

               
            

Legacy_Greyfort

  • Sr. Member
  • ****
  • Posts: 442
  • Karma: +0/-0
Script issue with adjust reputation
« Reply #2 on: April 25, 2011, 09:41:54 pm »


               ok to start go through your function script and instead of craming it on one line make them new lines for easy debuging, then when done make them on liners if you must. it always help you look at the logical flow of your script. IE

if ( a=1)
    {
    // something happens
    }else{
           // something else happens
           }

I treied to copy and paste your script and its a little dificult to figure what you have commented out, and what you are useing.

I tried to clean it up a little but I dont have prr system, but if you clean the script up I might be able to find the error.


This is PRR_LoadFaction
void PRR_LoadFaction()
{
int nNth = GetLocalInt(GetModule(), "FactionFocus_Source");
object oSourceFactionMember = GetObjectByTag("FACTION_FOCUS", nNth);//colunm    //while(oSourceFactionMember != OBJECT_INVALID)
if(oSourceFactionMember != OBJECT_INVALID)
   {
int i = 0;
object oTarget = GetObjectByTag("FACTION_FOCUS", i);//row
//float fDelay;
while(oTarget != OBJECT_INVALID)
   {
string sSourceFactionMember = SQLEncodeSpecialChars(GetStringLowerCase(GetName(oSourceFactionMember)));
string sTarget = SQLEncodeSpecialChars(GetStringLowerCase(GetName(oTarget)));
SQLExecDirect("SELECT " + sSourceFactionMember + " FROM tbl_factions WHERE tbl_player_player_character='" + sTarget + "'");
if (SQLFetch())
   {
   int nAdjustment = StringToInt(SQLGetData(1));
//fDelay += 0.10;// optional delay
//DelayCommand( fDelay *AWA_LOAD_FACTOR,
//AdjustReputation( oFactionFocus, oTargetFocus, nAdjustRep ));
//AdjustReputation( oTarget, oSourceFactionMember, nAdjustment );
//AWA_DEBUG("PRR_LoadModule: target = "+GetName(oTarget)+"
//source = "+GetName(oSourceFactionMember)+" rep = "+IntToString(nAdjustment));
   }else{
   AWA_DEBUG("PRR ERROR: could not SELECT "+GetName(oSourceFactionMember)+
   " FROM tbl_factions WHERE tbl_player_player_character= "+GetName(oTarget));
   }
   i++;
   oTarget = GetObjectByTag("FACTION_FOCUS", i);
   }//end of while
   }//end of if(oSourceFactionMember != OBJECT_INVALID)
//if (oSourceFactionMember == OBJECT_INVALID)
//{            //AWA_DEBUG("PRR_LoadFaction: finished "+GetName(oSourceFactionMember));
//nNth++;            SetLocalInt(GetModule(), "FactionFocus_Source",
//(GetLocalInt(GetModule(), "FactionFocus_Source") + 1) );
//}
}

if you look at script you posted and this edited version it looks like in your useing // remarks messed something up, as I look at it quickly.  I am groggy so I might have missed something.  Also you said its adjusting a faction more then once, it makes me think of the all the un commented remarks, do you have a on altered version of your function?
               
               

               
            

Legacy_DM_Vecna

  • Hero Member
  • *****
  • Posts: 501
  • Karma: +0/-0
Script issue with adjust reputation
« Reply #3 on: April 26, 2011, 03:02:51 am »


                Sorry the formating got all screwie when I posted here.

Can anyone tell me how to properly post code in the new forum?
               
               

               


                     Modifié par DM_Vecna, 26 avril 2011 - 02:04 .
                     
                  


            

Legacy_DM_Vecna

  • Hero Member
  • *****
  • Posts: 501
  • Karma: +0/-0
Script issue with adjust reputation
« Reply #4 on: April 26, 2011, 07:00:54 am »


               hopefully this is more legible. loop is still bleeding over to the next loop.

 void PRR_LoadModule()
{          
 int nNth = 0;            
object oSourceFactionMember = GetObjectByTag("FACTION_FOCUS", nNth);//colunm            while(oSourceFactionMember != OBJECT_INVALID)            
{                    
string sName = GetName(oSourceFactionMember);                    
AWA_DEBUG(sName+" "+IntToString(nNth));/////////////////////////////////////////////                    
int i = 0;                    
object oTarget = GetObjectByTag("FACTION_FOCUS", i);//row                          
 while(oTarget != OBJECT_INVALID)                            
{                                    
if (!GetFactionEqual(oSourceFactionMember, oTarget))                                  
 {                                  
 AdjustReputation( oTarget, oSourceFactionMember, 15 );                                    AWA_DEBUG(IntToString(GetReputation(oSourceFactionMember, oTarget )));                                  
}                            
i++;                            
oTarget = GetObjectByTag("FACTION_FOCUS", i);                          
}            
nNth++;            
oSourceFactionMember = GetObjectByTag("FACTION_FOCUS", nNth);          
 }
}
               
               

               


                     Modifié par DM_Vecna, 26 avril 2011 - 06:04 .
                     
                  


            

Legacy_Xardex

  • Sr. Member
  • ****
  • Posts: 414
  • Karma: +0/-0
Script issue with adjust reputation
« Reply #5 on: April 26, 2011, 12:44:19 pm »


               ----
               
               

               


                     Modifié par Xardex, 26 avril 2011 - 11:47 .
                     
                  


            

Legacy_Xardex

  • Sr. Member
  • ****
  • Posts: 414
  • Karma: +0/-0
Script issue with adjust reputation
« Reply #6 on: April 26, 2011, 12:46:59 pm »


               Try to put your script in quotes or code brackets
[code [/code
[quote [/quote
(Remember to close the brackets with ]

I prefer quote.


EDIT

Stupid forums, not showing up your messages until you already posted another post because you thought the first one didnt get through.
               
               

               


                     Modifié par Xardex, 26 avril 2011 - 11:49 .
                     
                  


            

Legacy_Lightfoot8

  • Hero Member
  • *****
  • Posts: 4797
  • Karma: +0/-0
Script issue with adjust reputation
« Reply #7 on: April 26, 2011, 05:24:41 pm »


               Here is a long shot.   Make sure that you do not have any of your " FACTION_FOCUS", creatures in another area.   Perhaps by having them report a debug as to the area they are in.
               
               

               
            

Legacy_DM_Vecna

  • Hero Member
  • *****
  • Posts: 501
  • Karma: +0/-0
Script issue with adjust reputation
« Reply #8 on: April 27, 2011, 03:39:33 am »


               All FACTION_FOCUS creatures report from the same area with no duplicates.
               
               

               
            

Legacy_Lightfoot8

  • Hero Member
  • *****
  • Posts: 4797
  • Karma: +0/-0
Script issue with adjust reputation
« Reply #9 on: April 27, 2011, 05:13:46 am »


               The last script you posted looks good to me.  The first one I never cluld read that well.

If I had to guess at what was going wrong, It would be the fact that it used delayed commands to itterate through the list of FACTION_FOCUS objects.  The order of the list may be changing between some of the iterations.   I am not sure if the order of the list by possistion is kept outside of a single code block.

If you really wanted to do it with the delays, I would sugest first building a list of your objects into a local array.  The retriving your oSourceFactionMember from that.
               
               

               
            

Legacy_Lightfoot8

  • Hero Member
  • *****
  • Posts: 4797
  • Karma: +0/-0
Script issue with adjust reputation
« Reply #10 on: April 28, 2011, 02:17:01 am »


               That segustion I made about building a list if the Objects, Was a real brain fart. 

To add the delays back in it would be simpler to just pass the Faction as an argument.  something like this.

void  PRR_LoadFaction(object oSourceFactionMember);

void PRR_LoadModule()
{
   int nNth = 0;
   object oSourceFactionMember = GetObjectByTag("FACTION_FOCUS", nNth);//colunm
   while(oSourceFactionMember != OBJECT_INVALID)
   {
      DelayCommand(0.5*nNth*AWA_LOAD_FACTOR, PRR_LoadFaction(oSourceFactionMember));
      nNth++;
      oSourceFactionMember = GetObjectByTag("FACTION_FOCUS", nNth);
   }
}

////////////////////////////////////////////////

void  PRR_LoadFaction(object oSourceFactionMember)
{
      string sName = GetName(oSourceFactionMember);
      AWA_DEBUG(sName+" "+IntToString(nNth));/////////////////////////////////////////////
      int i = 0;
      object oTarget = GetObjectByTag("FACTION_FOCUS", i);//row
      while(oTarget != OBJECT_INVALID)
      {
        if (!GetFactionEqual(oSourceFactionMember, oTarget))
        {
          AdjustReputation( oTarget, oSourceFactionMember, 15 );
          AWA_DEBUG(IntToString(GetReputation(oSourceFactionMember, oTarget )));
        }
        i++;
        oTarget = GetObjectByTag("FACTION_FOCUS", i);
      }
}
               
               

               
            

Legacy_DM_Vecna

  • Hero Member
  • *****
  • Posts: 501
  • Karma: +0/-0
Script issue with adjust reputation
« Reply #11 on: April 28, 2011, 03:57:46 am »


               I have tried this all different ways. With delays and without. I now am thinking there is an error that happens when you nest a while loop inside another. It would not be noticed unless you go through a couple of times and are adding to the previous number set, if that makes sense. I am going to try to use if statements instead and see if I get the same error.
               
               

               
            

Legacy_Lightfoot8

  • Hero Member
  • *****
  • Posts: 4797
  • Karma: +0/-0
Script issue with adjust reputation
« Reply #12 on: April 28, 2011, 04:23:39 am »


               Ok, I think I am starting to see the problem here.  You are assuming that GetObjectByTag(sTag,nIndex)  will always return the Objects in the same order.  Or at least that is what I think you are doing.    useing the nIndex to set up a square 2d array.  Where the nIndex will be the same for each object in the current run of any  given script, there is no Garrentee that the nIndex will return the same object in a different or even future run of the same script.
               
               

               
            

Legacy_DM_Vecna

  • Hero Member
  • *****
  • Posts: 501
  • Karma: +0/-0
Script issue with adjust reputation
« Reply #13 on: April 28, 2011, 06:41:48 am »


               well, this is a simplified version of what I am using. However I have run it about a hundred times and it does always return the creatures in the same order. BUT, I think I found the problem. When adjustreputation fires. It changes the how how oSource feels about oTarget by nAdjustnemt but ALSO changes how oTarget feels about oSource by nAdjustment. I am not sure why it is doing this. I do havethe factions all set to 0 in the faction editor...maybe that is why? I am throwing bug test after bug test at it for three days now '<img'> Next I am trying to see if clearpersonalrepuation might help.
               
               

               
            

Legacy_DM_Vecna

  • Hero Member
  • *****
  • Posts: 501
  • Karma: +0/-0
Script issue with adjust reputation
« Reply #14 on: May 01, 2011, 05:25:05 am »


               So, I have still not found a fix for this. I have been bug testing this for some time and learning more about the problem but still cannot figure out a stable fix. I realize that some of my previous posts were confusing so here is a short recap.

If you take two creatures from different factions (CreatureA and CreatureB)
If you:
AdjustReputation(CreatureA,CreatureB,15)
then:
AdjustReputation(CreatureB, CreatureA, 15)
you would think that GetReputation would return 15 for both. However what I find is that the second GetReputation returns 30.
I can issustrate where it goes from there if someone would like as it starts a cycle.
Does anyone know a way to examine the Bioware function of AdjustReputation or how to get around this.
What I would like is for both to return 15