What is the most organized way to go about storing data for characters passives?

Hello everyone who reads this. I’m having trouble organizing my script right now, and it’s due to listing “passives” in the script which can get quite long. Is there a better way to do this? My script is already at 477 lines due to this alone and I only have 4 characters made out of a planned 50 or so. Thanks for the responses.

(If in the incorrect category, I apologize)

An easy option is to compress it on fewer lines like so:

Passive = {
	Passive_Buff1 = {
		Conditions = {"No_Condition_Boost"},
		Buffs = { {"Damage_Increase", 1.20}, {"Defense_Increase", 1.80} },
		Starting_From_Turn = 0,
		Begins_At_What_HP = -1,	
	-- ...

Also, you could put each character into a separate script.

I don’t know what else to say, horizontal screen space is severely underrated.

I don’t think there is anything wrong with the data for the characters being long. If your storing data its 100% advisable to use module scripts for that purpose. In the module script, have a function to retrieve the buff for the character. Real life data stores can have billions of lines long of json data. If your to worried about having to many lines in a script you could create multiple module scripts for each character, but it would not improve any performance I believe. Use ctrl-f and find the character you wanne modify the buff for to easily navigate the storage. But yeah don’t store large dictionary data in a script do it in a module script
Module scripts are perfect to act as databases with only intent to store code or to have code that multiple scripts can run.
It is pretty simple

  1. Create a module script and name it what you like
--Simple data retrieve
--This is the code in the module script
local module = {}
local characterStore = {
    character1= {
        buffType1 = {
           buff1 = {
           condition1 = {
module.getData = function(CharKey, buffKey)
      return characterStore[CharKey][buffKey]

This would be any script

local characterData = require(game.PATHTOMODULE)
--This will run the function module.getData = function(CharKey, buffKey) in the module
local characterData = characterData.getData(CharKey, buffKey)
local starting_From_turn = characterData["Starting_From_turn"]

Read this article of module scripts if your intrested