Author Topic: Script request.  (Read 393 times)

Legacy_Bazilbrush

  • Jr. Member
  • **
  • Posts: 56
  • Karma: +0/-0
Script request.
« on: January 10, 2011, 02:15:52 am »


               Would someone out there be able to write me a save on rest script? I have tried myself but with no joy. Hope someone can help.
               
               

               
            

Legacy_GhostOfGod

  • Hero Member
  • *****
  • Posts: 1490
  • Karma: +0/-0
Script request.
« Reply #1 on: January 10, 2011, 03:57:35 am »


               All you need to do for that is add a single line to your modules "OnPlayerRest" script at the bottom, just above the last curly bracket "}".

ExportSingleCharacter(oPC);
}

And if you want you can add a line that tells the player that they were just saved:

ExportSingleCharacter(oPC);
SendMessageToPC(oPC, "Your character has been saved.");
}


As far as making a module "OnPlayerRest" script from scratch, if that is what you are looking for, it completely depends on a lot of other things that you want to happen or not happen in your module when a player rests.

Hope that helps. Good luck.
               
               

               


                     Modifié par GhostOfGod, 10 janvier 2011 - 04:00 .
                     
                  


            

Legacy_Bazilbrush

  • Jr. Member
  • **
  • Posts: 56
  • Karma: +0/-0
Script request.
« Reply #2 on: January 12, 2011, 01:00:20 am »


               That works perfectly, thank you very much Ghost. :-)
               
               

               
            

Baaleos

  • Administrator
  • Hero Member
  • *****
  • Posts: 1916
  • Karma: +0/-0
Script request.
« Reply #3 on: January 12, 2011, 10:44:53 am »


               Note - I know this accomplishes what you require it to, but ExportSingleCharacter is Asynchronous - meaning it will not pause the execution of your code, while your character is saving.



Possible instances where you dont want to use ExportSingleCharacter include things such as

Letoscript changes that use GetNewestBic



The ExportAllServerCharacters (or whatever it is) method however, does stop execution of the code, and waits for the save to complete before moving on - which may be useful for certain things