So for my turn based game the way I’m going to sort out turn based battles and positioning heavily relies on a party system, the problem is I have no knowledge as to how to make one, so I’m here to ask you pro coders for some tips or guides on how to create at least a baseline working one.
It depends on what you are trying to do with your party system.
For starters, you can do something like:
local newPartyInfo = {
Name = "Party 1",
PartyMembers = {
[1] = {
Name = entity1,
Keybind = "1" -- this is purely optional, i dont think u need this for a turn-based game
}
},
CurrentMemberOnField = certainEntity,
PartyEquippedStatus = true,
MaxMemberSlot = 3, -- the party max member count
}
Then you can just simply do the logic with another code to only use the specified party information. Ofc for a turn-based game, you need to account for something like SPD for their turns and stuff.
So at the base level the party system i make just contains a table of all the players and then sends that table over to the server script via remote event and puts those people in the battle with whatever positioning i make
Yeah you can do something like that if you want something simple to do
Whats with the “Entity1” and certainentity things
Just a placeholder, it depends on how you are gonna use your party system. Let’s say it is a player party system, then you just store their names or instances inside
Do you know how i would get the specific players that are inside the party? and like the invite system
Hm the most basic thing you can do is probably to just to loop through the PartyMembers to find a specific player.
local members = newPartyInfo[PartyMembers]
local function lookForPlayer(name)
for _, member in pairs(members) do
if member == name then
return member
end
end
end
lookForPlayer("Player1")
There are other ways without loop but they require you to know metatables and metamethods