DataStore2 Exceeding variable limit

Hello,

as the title states, I’m having an issue with DataStore2 I’ve exceeded the max variable amount and it’s haulted my progress. Has anyone ever reached this limit/issue? I can’t find anything online that seems a viable solution without having to rewrite about 2k lines of code, any help, info or suggestion is welcome!
Thanks!

Here’s my .combine, the reason there’s so many is becouse I’ve had to add the same variable 3 times to the master key since I’m making the game where a player has 3 character slots, and most of the keys are quest progress

DataStore2.Combine("SaveData5955", "Slot1Taken", "Slot1Level", "Slot1Creds", "Slot1Aspect", "Slot2Taken", "Slot2Level", "Slot2Creds", "Slot2Aspect", "Slot3Taken", "Slot3Level", "Slot3Creds", "Slot3Aspect", "Experience1","Experience2","Experience3", "Level1","Level2","Level3", "Aspect1","Aspect2","Aspect3", "Hair1","Hair2","Hair3", "Face1","Face2","Face3", "Clothes1","Clothes2","Clothes3", "QBind1","QBind2","QBind3", "EBind1","EBind2","EBind3", "FBind1","FBind2","FBind3", "LAltBind1","LAltBind2","LAltBind3", "Strength1","Strength2","Strength3", "Vitality1","Vitality2","Vitality3", "Agility1","Agility2","Agility3", "StatPoints1","StatPoints2","StatPoints3", "Credits1","Credits2","Credits3", "IronOre1","IronOre2","IronOre3", "CoalOre1","CoalOre2","CoalOre3", "TitaniumOre1","TitaniumOre2","TitaniumOre3", "RoughHide1","RoughHide2","RoughHide3", "HeavyHide1","HeavyHide2","HeavyHide3", "FineHide1","FineHide2","FineHide3", "RoughLeather1","RoughLeather2","RoughLeather3", "FineLeather1","FineLeather2","FineLeather3", "MasterworkLeather1","MasterworkLeather2","MasterworkLeather3", "IronIngot1","IronIngot2","IronIngot3", "SteelIngot1","SteelIngot2","SteelIngot3", "TitaniumIngot1","TitaniumIngot2","TitaniumIngot3", "Bridle1","Bridle2","Bridle3", "Palomino1","Palomino2","Palomino3", "Stallion1","Stallion2","Stallion3", "KillEnemyStarted1","KillEnemyStarted2","KillEnemyStarted3", "KillEnemyCompleted1","KillEnemyCompleted2","KillEnemyCompleted3", "KillEnemyCount1","KillEnemyCount2","KillEnemyCount3", "Collect5IronStarted1","Collect5IronStarted2","Collect5IronStarted3", "Collect5IronCompleted1","Collect5IronCompleted2","Collect5IronCompleted3", "CollectIronCount1","CollectIronCount2","CollectIronCount3", "Backpack1", "Backpack2", "Backpack3", "EquippedTool1", "EquippedTool2", "EquippedTool3", "EquippedHelmet1", "EquippedHelmet2", "EquippedHelmet3", "EquippedChestplate1", "EquippedChestplate2", "EquippedChestplate3", "EquippedLegplate1", "EquippedLegplate2", "EquippedLegplate3", "PosX1", "PosY1", "PosZ1", "PosX2", "PosY2", "PosZ2", "PosX3", "PosY3", "PosZ3", "PopulationControlStarted1", "PopulationControlCompleted1", "PopulationControlCount1", "PopulationControlStarted2", "PopulationControlCompleted2", "PopulationControlCount2", "PopulationControlStarted3", "PopulationControlCompleted3", "PopulationControlCount3", "OnwardStarted1", "OnwardCompleted1", "OnwardStarted2", "OnwardCompleted2", "OnwardStarted3", "OnwardCompleted3", "RaisingMoraleStarted1", "RaisingMoraleCompleted1", "RaisingMoraleCount1", "RaisingMoraleStarted2", "RaisingMoraleCompleted2", "RaisingMoraleCount2", "RaisingMoraleStarted3", "RaisingMoraleCompleted3", "RaisingMoraleCount3", "ToolsStarted1", "ToolsCompleted1", "ToolsCount1", "ToolsStarted2", "ToolsCompleted2", "ToolsCount2", "ToolsStarted3", "ToolsCompleted3", "ToolsCount3", "SeedlingsStarted1", "SeedlingsCompleted1", "SeedlingsCount1", "SeedlingsStarted2", "SeedlingsCompleted2", "SeedlingsCount2", "SeedlingsStarted3", "SeedlingsCompleted3", "SeedlingsCount3", "NewLifeStarted1", "NewLifeCompleted1", "NewLifeCount1", "NewLifeStarted2", "NewLifeCompleted2", "NewLifeCount2", "NewLifeStarted3", "NewLifeCompleted3", "NewLifeCount3", "TownLifeStarted1", "TownLifeCompleted1", "TownLifeStarted2", "TownLifeCompleted2", "TownLifeStarted3", "TownLifeCompleted3", "TheWolfProblemStarted1", "TheWolfProblemCount1", "TheWolfProblemCompleted1", "TheWolfProblemStarted2", "TheWolfProblemCount2", "TheWolfProblemCompleted2", "TheWolfProblemStarted3", "TheWolfProblemCount3", "TheWolfProblemCompleted3", "TheSmithyStarted1", "TheSmithyCompleted1", "TheSmithyStarted2", "TheSmithyCompleted2", "TheSmithyStarted3", "TheSmithyCompleted3", "SmithySuppliesStarted1", "SmithySuppliesCompleted1", "SmithySuppliesStarted2", "SmithySuppliesCompleted2", "SmithySuppliesStarted3", "SmithySuppliesCompleted3", "FarmersPleadStarted1", "FarmersPleadCompleted1", "FarmersPleadStarted2", "FarmersPleadCompleted2", "FarmersPleadStarted3", "FarmersPleadCompleted3", "CleaningUpStarted1", "CleaningUpCount1", "CleaningUpCompleted1", "CleaningUpStarted2", "CleaningUpCount2", "CleaningUpCompleted2", "CleaningUpStarted3", "CleaningUpCount3", "CleaningUpCompleted3", "ActivityReportStarted1", "ActivityReportCompleted1", "ActivityReportStarted2", "ActivityReportCompleted2", "ActivityReportStarted3", "ActivityReportCompleted3", "TeachAManToFishStarted1", "TeachAManToFishCompleted1", "TeachAManToFishStarted2", "TeachAManToFishCompleted2", "TeachAManToFishStarted3", "TeachAManToFishCompleted3", "CrabAttackStarted1", "CrabAttackCount1", "CrabAttackCompleted1", "CrabAttackStarted2", "CrabAttackCount2", "CrabAttackCompleted2", "CrabAttackStarted3", "CrabAttackCount3", "CrabAttackCompleted3", "ILoveFishingStarted1", "ILoveFishingCount1", "ILoveFishingCompleted1", "ILoveFishingStarted2", "ILoveFishingCount2", "ILoveFishingCompleted2", "ILoveFishingStarted3", "ILoveFishingCount3", "ILoveFishingCompleted3", "HighRoadsStarted1", "HighRoadsCompleted1", "HighRoadsStarted2", "HighRoadsCompleted2", "HighRoadsStarted3", "HighRoadsCompleted3", "PromotionStarted1", "PromotionCompleted1", "PromotionStarted2", "PromotionCompleted2", "PromotionStarted3", "PromotionCompleted3", "ANewFrontierStarted1", "ANewFrontierCompleted1", "ANewFrontierStarted2", "ANewFrontierCompleted2", "ANewFrontierStarted3", "ANewFrontierCompleted3", "DontHugTheBearsStarted1", "DontHugTheBearsCount1", "DontHugTheBearsCompleted1", "DontHugTheBearsStarted2", "DontHugTheBearsCount2", "DontHugTheBearsCompleted2", "DontHugTheBearsStarted3", "DontHugTheBearsCount3", "DontHugTheBearsCompleted3", "InvestigateStarted1", "InvestigateCount1", "InvestigateCompleted1", "InvestigateStarted2", "InvestigateCount2", "InvestigateCompleted2", "InvestigateStarted3", "InvestigateCount3", "InvestigateCompleted3", "TheKeeperStarted1", "TheKeeperCount1", "TheKeeperCompleted1", "TheKeeperStarted2", "TheKeeperCount2", "TheKeeperCompleted2", "TheKeeperStarted3", "TheKeeperCount3", "TheKeeperCompleted3", "PeaceStarted1", "PeaceCompleted1", "PeaceStarted2", "PeaceCompleted2", "PeaceStarted3", "PeaceCompleted3", "TheJourneyBeginsStarted1", "TheJourneyBeginsCompleted1", "TheJourneyBeginsStarted2", "TheJourneyBeginsCompleted2", "TheJourneyBeginsStarted3", "TheJourneyBeginsCompleted3")

Maybe instead of having one variable for each quest create a system that would for example store in a JSON the quest progress and then save the JSON.
You could have another JSON for the character

I’m a hobby programmer, so I’m not sure what you mean a JSON, is that a table?

A JSON is a document is that form:
{
key:value,
key2:value
}
You can convert a LUA table in a JSON by using the HttpService and JSONEncode, that will return a string that you can then store

How about saving all quests in a single table? Could I save a table to DataStore2? And if so could I later once the table is downloaded go through it with for i, v in pairs and do an if statement on the name? This would take a while to rework, but I’m willing to go through with it

Instead of adding all your strings after DataStore2.Combine(), add one string per combine. Like:
DataStore2.Combine(« SaveData5955 », « Slot1Taken« );
DataStore2.Combine(« SaveData5955 », «Slot1Level »);
Etc

2 Likes

I can do that??! Oh my god thank you

I am using DS2 and i used to do like you did. But then, it gaves to my game a huge throttling.

1 Like

Did combining each key separately fix it? Or was it just a temp workaround

The fact is you are using a huge amount of keys. Actually i am not sure if it would fix it. But at least it will limitate the throttling in game

1 Like

Also, at the save part when the value change, (Value.Changed:Connect(function()), use a debounce for the throttling

1 Like

I’m not getting the error anymore, it worked! Thanks a bunch man, I’ll do some testing, if it throttles I’ll have to use tables eventually. But for now this solution fixed it.

Good to hear, you’re welcome :+1:

1 Like

Already using an if statement on that, thanks tho