How do i make a conditional turn based combat system

a turn-based system which does not operate in rounds, instead it uses an Act List that is affected through various means and thus does not guarantee that each participant in a battle will have an equal number of turns. Units with higher speed take more turns than slower ones, making speed more important than in other turn-based battle systems. Players can substitute party members mid-battle adding a new level of strategy.

Spells and abilities (such as [Haste] or [Overdrives] modify the Act List, as some abilities require a longer cooldown time. Weaker abilities tend to require less cooldown, thus introducing a trade-off between speed and power. When a character’s turn begins, all action stops while the player decides upon an action. This shifts the focus from reflexes and quick decision-making to strategy and careful planning.

have only idea on how to code a system as explained above

3 Likes

just looking at all of this i can see how expensive in time this will be,

if it does not operate in rounds, you must specify the what is the SPEED factor about

speed is everything that will run in the game, for example, let’s say

there is a long bar, and each players has 3 fighters, 3vs3 match

but they can change one of them at any time, However, you can’t just ignore ‘‘the opponent’s character turn’’ see below:

The speed factor, will be really crucial , since this is not a turn based game, but at the same time, looks like it:

Each letter you see, is a ‘‘Character’’
[ X Y Z from Player 1]
[ D F G from Player 2 or NPC]
=============X===============Y===============Z=====D===F==G
after a few mili seconds or seconds, it will start to go this way <<<<<

==X=========Y=====D===Z==G==F==============================

As you noticed, X is the fastest Character, Y too, but D is faster than Z G and F
in a single ‘’ Round ‘’, X and Y will attack first.
But D may die in the process since we don’t know who X and Y will be attacking

this means, F and G still in the game [ don’t forget about the players doing actions]

before of all, when the BAR hits the END, the bar will freeze, and the player will be able to take an action, if you wish for something more advanced than time like

‘‘Real live-actions fights’’

then each time a ‘‘Letter’’ hits the END, the player will be able to do an action,
however, since this is live-action, the BAR WILL NOT STOP

this reminds us of Chrono trigger, where your opponents will not wait your attack, they will just attack. (but they will attack once per round, however)

that means, the speed factor is working, but, how we will script this?

i haven’t tried myself creating this stuff, but i will give some advice:

well, everything in scripting is just a bunch of values,
if you give a meaning to them, it will work like you wish to…

----- Characters and Visual bar ---------- XYZFGD etc

About the characters,

the bar is just some visual (take health bar as an example)
Letters can be some ImageLabels (showing icons of them)

---- Speed factor, and how scripting will be made --------

each character needs (before-hand) their own speed values, consider this as pokemon or something else

– Please insert all data inside a module, it would make the game more clean –

– if you understand about tables and modules, ur safe, if not… then i recommend.

local Chars = {

["Rock"] = {},
["Neo"] = {},
["Yela"] = {},

}

– each char must have their own values, HP, MP, Stat points like VIT, STR, INT, anyway

just like the example above

after that you will need to do this server-sided, for anti-exploit stuff

Let’s say you already scripted ‘’ the start button’’

the Timer is running, and all characters are at

======================================================XZDFGRW
at the start of the bar

by default, they will start like this

-since each character has as DIFFERENT SPEED VALUE
the server will start a function, inside this function it will need to start a countdown based on the Speed value, for example 5, 10, 2

all values will decrease slowly, until hits 0, the first one to hits 0 will freeze the timer in the server and it will fire a remote event to the specific player ( owner of the Character )
in this case NEO, from player 1

when that hits 0, player 1 will be able to use some ITEM, Action, anything, after playing some attack animation or something else, the Timer will run again

– every time you do some action, you will fire to the server a remote event, telling what action you did, and after that action, the server will just ‘’ continue the timer ‘’

only 1 remote event required, since you will need to the the action only

kinda hard to explain without code,

also, to make the ===========================XASDFASFGW
animations from RIGHT to LEFT, you will need to use [Tweening Service]
make sure to learn about it

this should be client-sided since it wil use tween animations on GUIS

to animate Icons according to the Speed value while it decreases on the bar

make sure to

(share from the server, the table containing all characters values )
this is usefull , so the client will be able to animate without having to receive every single time a 0.1 number)

also, this is, actually, sending their data from the server, something very essential, since without it, nothing will work properly, that’s why we need a copy from our table FROM the server

(via remote event of course) — with that – you will receive a specific table for the client, and the Original running on the server as always

don’t worry, server-sided table is still safe, you only sent a clone to the client

make sure to create links between your Code, and your GUIS, while animating guis

i can’t explain too much since this is kinda complex to explain via Text ( and i’m kinda lazy to post images here )

i’m creating a turn based fighthing thing, and what i explained here is how much progress it would take me to achieve that, and i swear, following those steps will work, however, attention is required , a single value will ruin it all

Other notes:

to make it appear to each duelist the Timer of each character, you must add in Replicated storage
like a copy of each Character stats,

CharName, Speed, Attack, Defense, Passive, Buffs, etc

but instead, everything will be a value ( Speed = NumberValue )
Attack = NumberValue ,
CharName = StringValue,
Passive = BoolValue – check if passive is active
Buffs = BoolValue - check if the char is under a buff effect

but, in the server-side script, right after the ‘’ timer function ‘’ activates,

make sure to show in a gui, the remaining time of each character on the bar

you can do that by creating, for example, variables

-still in replicated storage –

Char1 (NumberValue) - 5
Char2 (NumberValue) - 10
Char3 (NumberValue) - 2

so, when the timer goes down in the server, at the same time, these numbers will decrease in the replicated storage

and you can links them to some text, and make it update each time the values changes

Note: to make this happen server-sided, create this:

FOR EXAMPLE: this is creating a reference to Char1, Char2 and Char3

when those values change, it will change to the Client, or All Clients


game.ReplicatedStorage.Char1:GetPropertyChangedSignal("Value"):Connect(function()

-- each time this value changes in the replicated storage, it will run this function
-- this can be used to update the value to the client instantly
-- but i recommend using this CLIENT-SIDED

end)
4 Likes