Graal Forums  

Go Back   Graal Forums > Development Forums > NPC Scripting
FAQ Members List Calendar Today's Posts

Reply
 
Thread Tools Search this Thread Display Modes
  #1  
Old 07-05-2011, 12:22 PM
callimuc callimuc is offline
callimuc's Avatar
Join Date: Nov 2010
Location: Germany
Posts: 1,015
callimuc is a splendid one to beholdcallimuc is a splendid one to beholdcallimuc is a splendid one to beholdcallimuc is a splendid one to beholdcallimuc is a splendid one to behold
Player created by script?

Hey there.
I was browsing through the scripthelp and found something ... let´s say interesting (at least for me). It looks like there are commands to create a player by script? How would that work? Here are two scripts/commands I found with having it included:

TServerPlayer.destroy() - deletes the player, only works for players created by script
TServerPlayer.loadaccount() - loads the player, only works for players created by script; this function is called automatically when creating a player
__________________
MEEP!
Reply With Quote
  #2  
Old 07-05-2011, 12:29 PM
ffcmike ffcmike is offline
Banned
Join Date: Jul 2004
Location: London
Posts: 2,029
ffcmike has a reputation beyond reputeffcmike has a reputation beyond reputeffcmike has a reputation beyond reputeffcmike has a reputation beyond reputeffcmike has a reputation beyond reputeffcmike has a reputation beyond reputeffcmike has a reputation beyond reputeffcmike has a reputation beyond repute
Send a message via AIM to ffcmike Send a message via MSN to ffcmike
This doesn't create an actual player, just the object.
It allows you to do stuff like read (I believe you can only read the level name right now) and write to offline players.
There's TServerPlayer.saveaccount(); in order to do this.
Reply With Quote
  #3  
Old 07-05-2011, 12:32 PM
callimuc callimuc is offline
callimuc's Avatar
Join Date: Nov 2010
Location: Germany
Posts: 1,015
callimuc is a splendid one to beholdcallimuc is a splendid one to beholdcallimuc is a splendid one to beholdcallimuc is a splendid one to beholdcallimuc is a splendid one to behold
So is there any use for it?
__________________
MEEP!
Reply With Quote
  #4  
Old 07-05-2011, 12:44 PM
ffcmike ffcmike is offline
Banned
Join Date: Jul 2004
Location: London
Posts: 2,029
ffcmike has a reputation beyond reputeffcmike has a reputation beyond reputeffcmike has a reputation beyond reputeffcmike has a reputation beyond reputeffcmike has a reputation beyond reputeffcmike has a reputation beyond reputeffcmike has a reputation beyond reputeffcmike has a reputation beyond repute
Send a message via AIM to ffcmike Send a message via MSN to ffcmike
Quote:
Originally Posted by callimuc View Post
So is there any use for it?
I don't think there is beyond reading/writing data for offline players no.
One good example for this I can think of would be to have an sqlite database storing each player that has logged on to the server, and eventually you'd be able to retrieve all of those accounts and write stuff to them if you want to apply an update to everyone.
This is somewhat better than having an if(condition){} within the login function for each player.
Reply With Quote
  #5  
Old 07-05-2011, 01:16 PM
callimuc callimuc is offline
callimuc's Avatar
Join Date: Nov 2010
Location: Germany
Posts: 1,015
callimuc is a splendid one to beholdcallimuc is a splendid one to beholdcallimuc is a splendid one to beholdcallimuc is a splendid one to beholdcallimuc is a splendid one to behold
Hmm ok thx
__________________
MEEP!
Reply With Quote
Reply


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +2. The time now is 10:26 PM.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2026, vBulletin Solutions Inc.
Copyright (C) 1998-2019 Toonslab All Rights Reserved.