After crash you loose xp ,items,???
Débuté par
Knight_Shield
, sept. 27 2010 02:11
#1
Posté 27 septembre 2010 - 02:11
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 ?
#2
Posté 27 septembre 2010 - 02:29
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.
#3
Posté 27 septembre 2010 - 02:32
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.
Also when are the chars normally saved ...didnt see anything in the OnclientLeave slot.
Modifié par Knight_Shield, 27 septembre 2010 - 02:38 .
#4
Posté 27 septembre 2010 - 02:39
Characters are saved based on the script you write to save them.
FP!
FP!
#5
Posté 27 septembre 2010 - 02:43
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 ?
#6
Posté 27 septembre 2010 - 03:04
void main()
{
ExportAllCharacters();
}
So basically just put this in a trigger or rest script ..something players use regularly?
{
ExportAllCharacters();
}
So basically just put this in a trigger or rest script ..something players use regularly?
#7
Posté 27 septembre 2010 - 03:28
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.
And yes it is hard coded that when a player leaves the server, thier charcter gets saved.
#8
Posté 28 septembre 2010 - 12:30
Thanks Lightfoot8 ....I dont know what this communnity would do without people like you .
Modifié par Knight_Shield, 28 septembre 2010 - 12:56 .
#9
Posté 28 septembre 2010 - 04:40
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.
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 .
#10
Posté 27 octobre 2010 - 08:41
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 ?
#11
Posté 27 octobre 2010 - 09:50
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.
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 .
#12
Posté 28 octobre 2010 - 04:24
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..
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..





Retour en haut







