loleris
|
  |
| Joined: 23 Feb 2009 |
| Total Posts: 1610 |
|
|
| 20 Aug 2013 01:52 PM |
I used everything. Last time I was suggested to only save data when the player is leaving. That's what I use currently.
It seems it breaks less, but it still does ._.
HELP ME |
|
|
| Report Abuse |
|
|
bohdan77
|
  |
| Joined: 10 Aug 2008 |
| Total Posts: 7944 |
|
|
| 20 Aug 2013 01:53 PM |
Save when the changes happen. Saving when the player is leaving us unreliable. |
|
|
| Report Abuse |
|
|
loleris
|
  |
| Joined: 23 Feb 2009 |
| Total Posts: 1610 |
|
|
| 20 Aug 2013 01:53 PM |
| I saved when changes happened. It broke more often for me. |
|
|
| Report Abuse |
|
|
bohdan77
|
  |
| Joined: 10 Aug 2008 |
| Total Posts: 7944 |
|
|
| 20 Aug 2013 01:58 PM |
How does it break? Never breaks for me. |
|
|
| Report Abuse |
|
|
loleris
|
  |
| Joined: 23 Feb 2009 |
| Total Posts: 1610 |
|
|
| 20 Aug 2013 01:59 PM |
| When you return to the game you load empty data. And start it all over again. |
|
|
| Report Abuse |
|
|
|
| 20 Aug 2013 02:00 PM |
Well then:
You are doing it wrong. |
|
|
| Report Abuse |
|
|
| |
|
bohdan77
|
  |
| Joined: 10 Aug 2008 |
| Total Posts: 7944 |
|
| |
|
loleris
|
  |
| Joined: 23 Feb 2009 |
| Total Posts: 1610 |
|
|
| 20 Aug 2013 02:14 PM |
@Notunknown99
Omg thanks! That's all I need to know! It works now! |
|
|
| Report Abuse |
|
|
|
| 20 Aug 2013 02:15 PM |
| Glad to be able to help, despite having virtually no useful information! |
|
|
| Report Abuse |
|
|
loleris
|
  |
| Joined: 23 Feb 2009 |
| Total Posts: 1610 |
|
|
| 20 Aug 2013 02:32 PM |
| No no, I did everything that you have told me to! |
|
|
| Report Abuse |
|
|
bohdan77
|
  |
| Joined: 10 Aug 2008 |
| Total Posts: 7944 |
|
|
| 20 Aug 2013 02:36 PM |
| http://www.roblox.com/Data-Persistence-Simulator-updated-item?id=115939577 |
|
|
| Report Abuse |
|
|
stravant
|
  |
 |
| Joined: 22 Oct 2007 |
| Total Posts: 2893 |
|
|
| 20 Aug 2013 02:44 PM |
"I saved when changes happened. It broke more often for me."
That probably means that your saving code is subtly wrong, and calling it more often is causing the cases where it breaks to come up more often.
When a player leaves the server commits DP changes to the database. That means if you save on leave there's a race between your script and the server, you trying to save your stuff out before the server commits changes, and if the server wins your changes will not be saved.
You _have_ to save as changes happen as a result. There is no other correct way to do it. |
|
|
| Report Abuse |
|
|
|
| 20 Aug 2013 02:52 PM |
| ...Maybe we need a method for saving, like Player:SaveData()? |
|
|
| Report Abuse |
|
|
|
| 20 Aug 2013 02:52 PM |
| Or maybe Player:SetSaveReady()? (I guess it could also wait 5 seconds before saving, in case this is not used) |
|
|
| Report Abuse |
|
|
blocco
|
  |
| Joined: 14 Aug 2008 |
| Total Posts: 29474 |
|
|
| 20 Aug 2013 03:17 PM |
| @Notunknown99: Player:SaveData() is already in the API. However, it's unusable by scripts due to the fact that it may cause more requests to be made than would be optimal. |
|
|
| Report Abuse |
|
|
SN0X
|
  |
| Joined: 24 Oct 2011 |
| Total Posts: 7277 |
|
|
| 20 Aug 2013 03:44 PM |
LOL U IDIETS I NEVER HAD A PROBLEM WITH DATA PERSITANTS
HAHAHA UR DOING IT WRONG
(No, really. I haven't. And I'm using the "unreliable" method of saving when the player leaves.) |
|
|
| Report Abuse |
|
|
stravant
|
  |
 |
| Joined: 22 Oct 2007 |
| Total Posts: 2893 |
|
|
| 20 Aug 2013 03:44 PM |
Yeah, there's no way such behavior would be exposed, because it would spam the database with updates.
Case and point: You just asked for it exactly so that you can use your current code without many changes and spam the database with updates as a result. |
|
|
| Report Abuse |
|
|
As8D
|
  |
| Joined: 24 Dec 2009 |
| Total Posts: 2907 |
|
|
| 20 Aug 2013 03:50 PM |
mhm.
Also, for his problem about not having control over how he saves his stuff or whatever, I recommend making a fun system that works like DP, except it'll work offline too.
I've made one... that I seem to change some times... and use in different test games to... yeah, test it out 'with DP on' (ok, that was a lie, DP is off in solo mode, but we can make stuff behave as if it was on)
^ Oh yeah, and you can make it so it actually makes DP easier for you (you don't have to worry about :WaitForDataReady, as that's called when someone enters without having their DP loaded, yay!... in my case, that is) >_>
- As, just when did I fall into slumber? Seems like a week or so. Prob. a month. |
|
|
| Report Abuse |
|
|
bohdan77
|
  |
| Joined: 10 Aug 2008 |
| Total Posts: 7944 |
|
| |
|
|
| 20 Aug 2013 04:11 PM |
| Roblox would be so much better if you could save DP to the game as well as Players. Eg. game:SaveString("AllServersChat", "flipflop8421: Cookies") |
|
|
| Report Abuse |
|
|
bohdan77
|
  |
| Joined: 10 Aug 2008 |
| Total Posts: 7944 |
|
| |
|
As8D
|
  |
| Joined: 24 Dec 2009 |
| Total Posts: 2907 |
|
|
| 20 Aug 2013 04:20 PM |
Hah, ok Boh.
Hrm, flip, yes, per-server DP has been backed up by a lot of players. The example could be something more logical though >_>
- As, Informationsteknologi. Uhu. |
|
|
| Report Abuse |
|
|
abaw7
|
  |
| Joined: 23 Oct 2009 |
| Total Posts: 745 |
|
|
| 20 Aug 2013 04:26 PM |
| Like, a top-10 leader board. |
|
|
| Report Abuse |
|
|
|
| 20 Aug 2013 04:27 PM |
| By SaveData I was thinking more something that can ONLY be used after a player has disconnected. |
|
|
| Report Abuse |
|
|