so i am trying to make a pokemon capture game and right now i have NO idea how to make a datastore to save what creatures you have so that when you enter a battle, it sends out what creatures first in your lineup like loomian legacy does.
heres a video that shows what i got
I’m not sure you need a datastore for this. Instead, create a way to store what creatures they have, for example, three string values. Then, when the player leaves and joins is when the data store will be put into action. Keep in mind, this is a feedback site and not a request site. You have a lot of progress on your game so far, but you still need to do research in order to make it better. Part of being a roblox developer is problem solving and style, this we can’t help you with. Here are a couple of posts that could help you with what you want to make
DataStores (Video That Helped Me)
GuiButtons (Video Regarding Style)
thank you i get it have inside the player values and then datastoring the values thanks theres just no creature capture game tutorials that work
This is the hard part about being developer, you need to adapt what you have learned from basic concepts to create complex ideas. Sadly, there is nearly no information on a creature capture game, HOWEVER, there are videos on how to use math with values. Now, how on earth does that get you anywhere. Well. . . After creating the creatures, you can give them two simple number values. One for damage, and one for health, you could of course add more depending on what you want. Then, add the same values for the users creature as well. Now you can apply what you have learned from the math post and figure out how to subtract the amount damage that the attacker deals from the health of the attacked. Once the creature is at or below zero health, you can create a script to kill it off. Sorry if this disappoints you, but there will never be a tutorial on how to create the game that YOU want to make because it’s (hopefully) a new game and not direct copy of one game.
This may be too much but im pretty sure (not 100% sure, I forgot where I got this information) that the Loomian Legacy battle engine is a heavily modified luau port of Pokemon Showdown. You could base it on Pokemon Showdowns action queue system or simply port the TypeScript code to luau.
From what I remember they simply call the switch function inside the battle engine.
Also, its incredibly table based. Your gonna have hundreds of tables just for one battle. Capture based games are incredibly hard to make. It can take thousands of lines of code to make an efficient and functional battle system.
I would first recommend you make some sort of an inventory system where you can store the monsters you encounter. You don’t need to save them as soon as you find them you can just make it so that everything saves when a player leaves the game, or save once per minute or something to make the game more optimized. For the inventory system, I recommend that you use dictionaries and then attach these dictionaries to the player. You would need a module that has 1 dictionary with all players each player would be a sub dictionary with pokemon and each pokemon would be a sub dictionary with the stats they have.
For example:
local Players = game:GetService("Players")
local module = {} -- All players are here
local function appendPlayer(player)
module[player] = {}
end
Players.PlayerAdded:Connect(appendPlayer)
return module
That would be a brief version of what the player’s script would look like then you can require the module to get all players and insert the pokemon as dictionaries into the players and then just save the entire player dictionary and load it to the user when the user rejoins.
Here is how the pokemon script would look like. You can just require this from your encounter script and call the function.
local PlayerModule = require(pathToPlayerModule)
local Pokemon = {}
function Pokemon:AppendPokemon(player, pokemon)
local playerDictionary = PlayerModule[player]
playerDictionary[UniquePokemonID] = {
name = "name";
exp = 0;
level = 1;
} -- ETC you get the point
end
return Pokemon
Here is a good YT video I recommend you watch follow along and he will teach you how to use dictionaries when saving data: Advanced Roblox Scripting Tutorial #13 - Data Store / Saving Player Data (Beginner to Pro 2019) - YouTube
it is a new game with new creatures and new story