Author Topic: After crash you loose xp ,items,???  (Read 568 times)

Legacy_Knight_Shield

  • Hero Member
  • *****
  • Posts: 812
  • Karma: +0/-0
After crash you loose xp ,items,???
« on: September 27, 2010, 03:11:47 pm »


               Not sure if this is a scripting thing or not .One of the DM's informed me after a crash couple of days go ...they and some players lost   levels,gold, basically anything they had done in the last 2 hours of gaming .What would be the fix for this ?':huh:'
               
               

               
            

Legacy_Lightfoot8

  • Hero Member
  • *****
  • Posts: 4797
  • Karma: +0/-0
After crash you loose xp ,items,???
« Reply #1 on: September 27, 2010, 03:29:51 pm »


               The Fix is to have the server export(save) the Characters  at regular intervals.   It will add to the lag potental, But will protect the PC from loss due to a crash.
               
               

               
            

Legacy_Knight_Shield

  • Hero Member
  • *****
  • Posts: 812
  • Karma: +0/-0
After crash you loose xp ,items,???
« Reply #2 on: September 27, 2010, 03:32:54 pm »


               So maybe attach a script to the rest script or a recall stone ..something they would use regularly ?

Also when are the chars normally saved ...didnt see anything in the OnclientLeave slot.
               
               

               


                     Modifié par Knight_Shield, 27 septembre 2010 - 02:38 .
                     
                  


            

Legacy_Fester Pot

  • Hero Member
  • *****
  • Posts: 1698
  • Karma: +0/-0
After crash you loose xp ,items,???
« Reply #3 on: September 27, 2010, 03:39:15 pm »


               Characters are saved based on the script you write to save them.



FP!
               
               

               
            

Legacy_Knight_Shield

  • Hero Member
  • *****
  • Posts: 812
  • Karma: +0/-0
After crash you loose xp ,items,???
« Reply #4 on: September 27, 2010, 03:43:10 pm »


               Yes but when you login and play then log out normally ..then log back in yuor char has all their things.What saves them then ...is that hard coded ?
               
               

               
            

Legacy_Knight_Shield

  • Hero Member
  • *****
  • Posts: 812
  • Karma: +0/-0
After crash you loose xp ,items,???
« Reply #5 on: September 27, 2010, 04:04:33 pm »


               void main()

{

 ExportAllCharacters();

}





So basically just put this in a trigger or rest script ..something players use regularly?
               
               

               
            

Legacy_Lightfoot8

  • Hero Member
  • *****
  • Posts: 4797
  • Karma: +0/-0
After crash you loose xp ,items,???
« Reply #6 on: September 27, 2010, 04:28:27 pm »


               Yes that would work.   When one person rested  that would save every PC on the server.



And yes it is hard coded that when a player leaves the server, thier charcter gets saved.
               
               

               
            

Legacy_Knight_Shield

  • Hero Member
  • *****
  • Posts: 812
  • Karma: +0/-0
After crash you loose xp ,items,???
« Reply #7 on: September 28, 2010, 01:30:59 am »


               Thanks Lightfoot8 ....I dont know what this communnity would do without people like you .'<img'>
               
               

               


                     Modifié par Knight_Shield, 28 septembre 2010 - 12:56 .
                     
                  


            

Legacy_Khuzadrepa

  • Sr. Member
  • ****
  • Posts: 347
  • Karma: +0/-0
After crash you loose xp ,items,???
« Reply #8 on: September 28, 2010, 05:40:58 am »


               Something to note... Shifters/polymorphs can have issues with exports.

Here's what it says about this in the Lexicon:
"Exporting polymorphed characters causes the character to de-polymorph and re-polymorph. For the Hordes of the Underdark Shifter Prestige class, this causes all the equipment bonuses to be lost. (Early versions of Neverwinter Nights would incorrectly write out the data for the polymorphed creature causing character corruption.)"

So you might want to check them for polymorphs and export single non-polymorphed players instead.
               
               

               


                     Modifié par Khuzadrepa, 28 septembre 2010 - 04:41 .
                     
                  


            

Legacy_Knight_Shield

  • Hero Member
  • *****
  • Posts: 812
  • Karma: +0/-0
After crash you loose xp ,items,???
« Reply #9 on: October 27, 2010, 09:41:03 pm »


               Ok cant get the script right to not export poloymorphed characters..does anyone have an export all character script except if they are polymorph they would like to share ?
               
               

               
            

Legacy_GhostOfGod

  • Hero Member
  • *****
  • Posts: 1490
  • Karma: +0/-0
After crash you loose xp ,items,???
« Reply #10 on: October 27, 2010, 10:50:35 pm »


               Might have to do something like this:


int GetIsPolymorphed(object oPC)
{
    effect eCheck = GetFirstEffect(oPC);
    while(GetIsEffectValid(eCheck))
    {
        if(GetEffectType(eCheck) == EFFECT_TYPE_POLYMORPH)
        return TRUE;
        eCheck = GetNextEffect(oPC);
    }
    return FALSE;
}
void main()
{
    object oPC = GetFirstPC();
    while (GetIsObjectValid(oPC))
    {
        if (!GetIsPolymorphed(oPC))
        ExportSingleCharacter(oPC);
        oPC = GetNextPC();
    }
}

Hope that helps.
               
               

               


                     Modifié par GhostOfGod, 27 octobre 2010 - 09:53 .
                     
                  


            

Legacy_Knight_Shield

  • Hero Member
  • *****
  • Posts: 812
  • Karma: +0/-0
After crash you loose xp ,items,???
« Reply #11 on: October 28, 2010, 05:24:27 am »


               Thanks again....its wonderful when you add a script and it not only compiles but works.
I call this "exportsave" and put it in my rest script with a delay so if shifter rests it polymorphs back before being saved.I seen that somewhere..'Image