Aller au contenu

Photo

Exit Event and Character Exporting


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

#1
henesua

henesua
  • Members
  • 3 883 messages
Is it redundant to add a ExportSingleCharacter function in the module's Exit Event?

I ask because I track some data on the PC Skin, and do not believe it is saved unless the PC is exported. And I want to ensure that the PC is exported when logging out.

#2
Shadooow

Shadooow
  • Members
  • 4 474 messages
Character is saved in OnExit automatically.

#3
Kato -

Kato -
  • Members
  • 392 messages
Since the function executes after an undetermined delay it might be risky to call it from the exit event. Nwnx_funcs hooks the event, though. Characters have always been saved automatically for me, I guess I'm lucky since I don't know what this depends on...

EDIT: Beaten by the punch, never mind if appropriate.


Kato

Modifié par Kato_Yang, 12 août 2012 - 04:36 .


#4
henesua

henesua
  • Members
  • 3 883 messages
Thanks. I wanted to verify this.

#5
henesua

henesua
  • Members
  • 3 883 messages
Also what is the order of Exit events.

Is it Trigger then Area then Module?

#6
Shadooow

Shadooow
  • Members
  • 4 474 messages

henesua wrote...

Also what is the order of Exit events.

Is it Trigger then Area then Module?

there is some info about this in lexicon, however it might be outdated and if you can try it yourself. New info about this would be welcome. (especially, if in any of those events, characters location can be found - hardly, but worth the try)

Btw, this automatic save character occurs a while before OnExit fires, I think that nwnx_cool is using this to fire OnPreExit where PC is still valid. It is however not hookable without nwnx, its internal use of the ExportChar function.

Modifié par ShaDoOoW, 12 août 2012 - 04:54 .


#7
henesua

henesua
  • Members
  • 3 883 messages
It is interesting that you say saving of the character happens sometime before the OnExit event script executes. This means that I can not depend on setting local vars to the PC skin just before exit.

#8
Shadooow

Shadooow
  • Members
  • 4 474 messages
Hm, correct, if you are doing this in the mentioned nwnx event, then this might be the reason why you have the problem you are mentioning. But if you are not using nwnx, then this doesnt apply the save and OnExit event are done in the same fashion practically, just the save occurs a bit earlier when PC is still valid. Since you cannot retrieve any items in normal OnExit, there is no such issue.