Author Topic: Save Character to Server function  (Read 457 times)

Legacy_Wall3T

  • Hero Member
  • *****
  • Posts: 748
  • Karma: +0/-0
Save Character to Server function
« on: September 09, 2015, 02:37:18 am »


               

im running a lil server for me and my friends, and i use a custom on rest menu system.


 


the one thing i couldnt figure out.....how to add a save character function to it!


 


sure there *is* the one on the menu screen.... but that only goes toward the players vault..... what im looking for is way to have players save there characters in-game (or on-server?)


 


does anyone know of any such resource i could use? links, or an actual script would be very helpful!


 


and... if you need any further questions ....do ask!



               
               

               
            

Legacy_The Mad Poet

  • Hero Member
  • *****
  • Posts: 715
  • Karma: +0/-0
Save Character to Server function
« Reply #1 on: September 09, 2015, 03:07:46 am »


               

void main()
{
    object oPC = GetPCSpeaker();

    ExportSingleCharacter(oPC);
}

If all you are trying to do is just allow people to save their character server side then this should do it. Just put it in a conversation node that saves "Save Character" or something like that.



               
               

               
            

Legacy_kalbaern

  • Hero Member
  • *****
  • Posts: 1531
  • Karma: +0/-0
Save Character to Server function
« Reply #2 on: September 09, 2015, 03:11:16 am »


               

Add what I post below to your module's OnPlayerRest event script.


 


if (GetLastRestEventType() == REST_EVENTTYPE_REST_FINISHED)
{
    ExportSingleCharacter(oPC);
}


               
               

               
            

Legacy_Wall3T

  • Hero Member
  • *****
  • Posts: 748
  • Karma: +0/-0
Save Character to Server function
« Reply #3 on: September 09, 2015, 05:32:10 am »


               

wow okay.... thats a quick response. thank you both! ill end the topic here by saying thanks again!


 


andto clarify, what im looking for is not a way to export player characters to there Local vault, but to my server vault



               
               

               
            

Legacy_The Mad Poet

  • Hero Member
  • *****
  • Posts: 715
  • Karma: +0/-0
Save Character to Server function
« Reply #4 on: September 09, 2015, 04:24:27 pm »


               

And to help clarify ExportSingleCharacter


 


http://www.nwnlexico...SingleCharacter


 


It does export to servervault.